Trigger Tag

Not counted towards your tag license limit.

Trigger tags can be used to activate a process at a set time and date. They may be configured to repeat at regular intervals, or they can be configured to trigger based on an expression or another tag’s value. By drawing the Trigger tag on a page, you can also provide a way for operators to manually trigger an event.

As well as defining a schedule or event that will set the trigger to 1 (On), you can should also define a schedule for when it will be reset to 0 in preparation for the next trigger event. This may be configured as a delay measured in seconds after the On trigger event, it may be set to a regular schedule or it may be tied to an expression or tag value.

The trigger depends on the underlying Windows operating system and your server's system clock. It should not be relied upon for precise to-the-second starts or stops.

There is only once source of information to determine the Trigger tag's value, and that is the server's system clock. The value of the trigger tag on any client workstation follows the value on the server in real-time. Regardless of the location of client workstations, any given trigger will occur only once, on the server, in the server's time zone, accounting for DST.

In a multi-server configuration, the trigger tag will follow the NetworkValues service to determine which workstation is the server and therefore which time to trigger on. If no server list has been provided for the NetworkValues service, the default server list is used.

The time of the latest ON-state is saved. On a restart, the time for the next OFF-state is checked. The tag will start in the appropriate state depending on whether the trigger-off following the last ON is in the past (therefore start in the OFF state) or future (therefore ON). In short, the tag will work as it should while the application is running, even if a trigger event is missed due to downtime.

 

An "Enable" parameter is provide to allow you to control whether the Trigger tag is activated or not. If the tag is drawn on a page, this can be toggled by right-clicking on the widget. Disabling a Trigger tag will also force its value to be 0 (OFF).

In VTS applications created prior to version 10, the scheduling option of both the On Condition and Off Condition could be disabled by setting the "Every" field to 0. This has been replaced by an "Enable" check box, but applications created in earlier versions will continue to work without modification.

Trigger tag properties: On Conditions tab

This tab is used to set the condition that will switch the tag’s value to 1. The tag may be switched to an ON state based on a schedule or based on an expression (which may include a tag).

Both options may be configured, resulting in a tag that will be triggered both on a regular schedule and also in response to an event.

Note the field labeled "Enable". When not selected, this means that no schedule is in effect. All other time-related fields will be disabled.

Note also the Starting Time. This serves as both an initial trigger time and the base date for repeating trigger events. For example, to trigger a report to be created at midnight on the first day of each month, you would set the following values:

  • "Enable" field selected.
  • "Starting Time" set to 12:00 a.m. on the first day of this month.

(Setting the first day of next month would achieve the same result, but putting the base date of repeating events in the past ensures that you do not miss the first iteration.)

  • "Every" value set to 1.
  • "Months" option selected.
  • "Same Day as Starting Day" selected. ("Same Day" refers to date in the month, not day of the week)

You must also configure the Off Conditions tab to set the schedule or condition that will reset the tag’s value to 0. After the trigger has occurred and the tag’s value set to 1, it remains at a value of 1. If you need a 0 to non-zero transition to trigger an event, you must reset the value to Off (0) before the next desired On-time.

Enable

Must be selected in order for the trigger to activate based on a time and date schedule.

Starting Time

Sets the base date and time for the schedule configuration options. Subsequent configuration options will be counted from this start time. If set to the future, no trigger will occur until that date.

Every [N] Seconds / Minutes / Hours / Days

The field beside "Every" controls the frequency of the following units.

For example, if the Every value is set to 1 and the Hours check box is selected, then beginning with the time configured in the Start Time, the trigger will be set to true every hour.

If the Every value is set to 7 and the Days check box is selected, then beginning with the configured Start Time date, the trigger will be set to true every week at the time given in Start Time.

Day check boxes

Allow you to control which days the Trigger tag will operate on. For example, you may choose to disable the trigger’s action on weekends by deselecting Saturday and Sunday.

These check boxes will not be enabled when the Months option is selected.

Months

Selecting the Months option is similar to configuring to Trigger tag to switch on every N Hours. If this option is chosen, then further refinements include "On The" or "Same Day as Starting Day".

For example, you may wish to configure the trigger to run "on the 1st Wednesday" or "on the 2nd Monday" of the month. Alternatively, of you have selected "Same Day as Starting Day" then the trigger will run on the given numeric day of the month, at the selected time.

When the Months option is selected, the Day check boxes will not be enabled.

Expression

Select a tag, or enter an expression that will be used to activate the Trigger tag. The On condition will be set when the selected tag or expression’s value becomes non-zero.

Trigger tag properties: Off Conditions tab

This tab is used to set the condition that will switch the tag’s value to 0, resetting the Trigger tag for the next scheduled event. The tag may be switched to an OFF state based on a delay in seconds after switching ON, a schedule, or based on an expression (which may include a tag).

A combination of options may be configured, resulting in a trigger that will reset either based on time, or in response to an event.

Note the field labeled "Every". When set to 0 this means that no schedule is in effect. All other time-related fields will be disabled.

Delay

When set to a value greater than 0, the Trigger tag’s value will be set to 0 (OFF) this many seconds after being triggered by the On Condition.

Enable

Must be selected in order for the trigger to de-activate based on a time and date schedule.

Starting Time

Used to set the base date and time for the reset (Off-condition) schedule. The other configuration options on this tab will be counted from the given Starting Time.

Every [N] Seconds / Minutes / Hours / Days

The field beside "Every" controls the frequency of the following units.

For example, if the Every value is set to 1 and the Hours check box is selected, then beginning with the time configured in the Start Time, the trigger will be reset to 0 every hour.

If the Every value is set to 7 and the Days check box is selected, then beginning on the configured Start Time date, the tag will be reset to 0 every week.

Day check boxes

Allow you to control which days the reset schedule will operate on. For example, you may choose to not reset the tag to 0 on weekends by deselecting Saturday and Sunday.

These check boxes will not be enabled when the Months option is selected.

Months

Configures the tag to reset to 0 every month. If this option is chosen, then further refinements include "On The" or "Same Day as Starting Day".

For example, you may wish to configure the trigger to reset "on the 1st Wednesday" or "on the 2nd Monday" of the month. If you have selected "Same Day as Starting Day" then the trigger will be reset on the given numeric day of the month, at the selected time.

When the Months option is selected, the Day check boxes will not be enabled.

Expression

Select a tag, or enter an expression that will be used to reset the Trigger tag’s value to 0. The Trigger tag’s value will be set to 0 when the value of the selected tag or expression becomes non-zero.

Trigger tag properties: Options tab

A trigger tag may be drawn as a button on a page, thus allowing operators to trigger the associated action at unscheduled times, if required. By adding a custom privilege, you can restrict access, allowing only authorized users to use the button.

Select the Disable option to deactivate the Trigger tag. Disabling a Trigger tag forces its value to 0.

Trigger tag properties: Display tab

When this tag is represented on screen by widgets that can use a Style Settings tag, you can save development time by choosing the Style Settings tag that holds the correct display configuration for this tag instance.

The default configuration will use System Style, the default style tag that is automatically part of every new VTScada application.