Trigger Status Change
A Trigger Status Change event trigger executes when the status of a trigger changes.
Defining a trigger status change event trigger
To define a trigger status change event trigger, follow these steps:
- From the Workbench left pane, expand the node where
you want to define the trigger status change event
trigger.
- Select the Project icon to display
the Projects window, right-click a
specific project tab to display its pop-up menu, and
then select New.
You also can select the New button at the bottom of the Projects window when a specific project tab has already been selected. - 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. - From the Event tab, select the
Trigger Event Type down-arrow, expand
the Internal category, and then select
Trigger Status Change.
The Event tab becomes active with parameters that accommodate the trigger status change event.
Parameter | Description |
---|---|
Project Name | Displays a list of all projects
defined on the current node. Select the project that contains the trigger you want to monitor for changes. The option == Current Project == can be used to indicate the project that this device status change event trigger is defined in. |
Trigger Name | Displays a list of triggers defined
within the project you selected in
Project Name. Select the trigger that |
Fire on Load | Options are True and False. If set to True, the trigger will execute whenever the status of the trigger specified in Trigger Name changes to Loaded. This status change might occur when the specified project or trigger are started depending on the order in which they are started. |
Fire on Unload | Options are True and False. If set to True, the trigger will execute whenever the status of the trigger specified in Trigger Name changes to Unloaded. This status change might occur when the specified project or trigger is stopped depending on the order in which they are stopped or when the trigger becomes disabled. |
Trigger status change event type trigger event variables
The input event variables available to a trigger status change event trigger are:
Event variable | Data type | Description |
---|---|---|
Is Disabled | BOOL | The current state of the trigger,
relative to being disabled. The values
can be: True - the trigger is state is disabled (Is Loaded = False and State = Disabled). False - the trigger is not disabled. |
Is Loaded | BOOL | The current status of the trigger,
relative to being loaded. The values
can be: True - the trigger is loaded (Is Disabled = False and State = Started). False - the trigger is not loaded (State could be Started, Stopped or Disabled). |
Project Name | STRING | The name of the project where the trigger is defined. |
State | STRING | The current state of the trigger
project. The value can be:
|
Trigger Name | STRING | The name of the trigger whose status has changed. |
Project state, trigger status and trigger state
Projects are the "containers" that triggers are defined in and they have their own state: Started or Stopped. This allows the group of triggers that are defined in a project to be collectively controlled by the state of the project.
The trigger execution component maintains the state of each project (Started or Stopped), the state of each trigger (Started, Stopped, Disabled, and the transition states of Starting and Stopping) and the status of each trigger (Loaded and Unloaded). This can be seen on the project windows and an individual project's tab where the list of the triggers defined in the project are displayed.
The trigger status change event trigger event variables
can be used to determined the specific state and status of
the trigger.
In order for a trigger to execute:
- Its status must be Loaded, which also means the project is Started
- Its state must be Started