Schedule


A Schedule event trigger executes when a schedule frequency (type of schedule) and occurrence criteria are met.

The schedule frequency options include: Periodic, Hourly, Day of Month and Weekdays.
The occurrence criteria is specific to the schedule frequency.

The trigger component handles the calculation of the schedule frequency and occurrence criteria. If the occurrence criteria is met, the schedule event trigger is scheduled to execute.
This alleviates the trigger's application logic from determining the frequency and occurrence criteria since the last instance of the trigger's execution before deciding to execute the application logic in the trigger's actions.

A Schedule event trigger can also be manually executed using the Workbench and the trigger's pop-up menu (right-click the trigger) and the Fire Trigger option.
Using the Workbench to manually execute a Schedule event trigger does not impact the trigger's schedule for being executed (Periodic, Hourly, etc.).

Defining a schedule event trigger

To define a schedule event trigger, follow these steps:

  1. From the Workbench left pane, expand the node where you want to define the schedule event trigger.
  2. Select the Project icon to display the Projects window, right click a specific project tab to display its pop-up menu, and then click New.
    You also can select the New button at the bottom of the Projects window when a specific project tab has already been selected.
  3. The new Trigger window appears.
    Name the trigger. The trigger name can be up to 64 characters and include letters, numbers, and the underscore character. Spaces are allowed.
  4. From the Event tab, select the Trigger Event Type down-arrow, and then select Schedule.

    The Event tab becomes active with parameters that accommodate the schedule event.
  5. Use the Frequency down-arrow to display a list of options, then select the frequency option you want to use.

    Each frequency option has specific occurrence parameters.

The following describes each frequency option and its occurrence parameters:

Option Description
Periodic The Periodic option is used to specify a millisecond interval.
  • In the Period (ms) parameter, enter a whole number of milliseconds between 0 and 3600000. 3600000 is the number of milliseconds in an hour.
    For example, if you enter a value of 5000, the trigger will execute every 5 seconds.
Hourly The Hourly option is used to specify the number of minutes after the hour and the days of the week.
  • In the Minutes after the hour parameter, enter a whole number between 0 and 59.
  • At least one day of the week check box must be selected. Multiple check boxes or the All check box can be selected.
Day of Month The Day of Month option is used to specify a time and day of the month, for one or more months.
  • In the Time parameter, enter the time of day that you want the trigger to execute. Use a HH:MM (hour:minute) and AM or PM for the format.
    Time set in military format will be converted to the corresponding AM PM time format.
  • Select the Day of Month down-arrow, and then select a day option of 1 through 31.
    If you select 31, those months that do not contain 31 days become unavailable. Likewise, selecting 29 or 30 will make February unavailable.
    There is also a Last Day of Month option.
  • At least one month check box must be selected. Multiple check boxes or the All check box can be selected.
Weekdays The Weekdays option is used to specify a time, the day, the week, and the month.
  • In the Time parameter, enter the time of day that you want the trigger to execute. Use a HH:MM (hour:minute) and AM or PM for the format.
    Time set in military format will be converted to the corresponding AM PM time format.
  • At least one day of the week check box must be selected. Multiple check boxes or the All check box can be selected.
  • At least one week check box must be selected. Multiple check boxes or the All check box can be selected.
  • At least one month check box must be selected. Multiple check boxes or the All check box can be selected.

Schedule event type trigger event variables

The input event variable available to a schedule event trigger is:

Event variable Data type Description
Scheduled Time TIMESTAMP The date and time that the trigger was scheduled to execute. This is usually the same as the $EVENT_TIME macro.

Complete the trigger definition

Complete the definition of the trigger, including the follow trigger components:

Use the Validate button to check the parameters and then the Save button to save the trigger's definition.
The trigger will be listed in the Project's tab list of triggers in the Stopped state.

Schedule event trigger frequency and occurrence criteria considerations

The Frequency option and Occurrence criteria parameters control how frequently a schedule event trigger executes.

The requirements of the application, the characteristics of any device variables' updates and the capability of the system need to be understood when designing the application solution. Considerations include:

  • If the event requirement for when a trigger executes naturally aligns with one of the available trigger event types, then use that trigger event type instead of using a schedule event trigger.
    For example, if a trigger needs to execute when a device variable's value meets a certain condition, then use a data event trigger.
    If a schedule event trigger was used instead, then every time it was executed, it would need to determine if the device variable's value current value meets the condition before continuing with the application logic. This is an inefficient use of system resources.
  • If you have a requirement to execute a trigger for a shift-based configuration (for example, 3 times a day, at 8 hour intervals, beginning at 8:30 AM) that has a frequency that can not be directly satisfied with the frequency and occurrence options, you will have to use the options available to satisfy the requirement.
    For this example, you could create three separate schedule event triggers that use the Weekdays option. One trigger could be called shift1 with a trigger time of 8:30 AM. A second trigger called shift2 with a trigger time of 4:30 PM, and a third trigger called shift3 with a trigger time of 12:30 AM. You further can use the schedule event triggers along with a subtrigger event trigger to organize common trigger logic. The three schedule event triggers could all call a single subtrigger event trigger where the common application logic was defined.