Trigger

Parent Previous Next

Trigger

The Trigger type of event is used when the user wants to execute some event when a tag is triggered.


To configure the Trigger, follow the steps below:


1.   In the Type ComboBox field, select the value Trigger.


2.   In the Action Type ComboBox field, select the desired type (Execute an Expression or a Service).


3.   In the Trigger TextBox field, insert a tag that will trigger the event.


graphic



Example:


In this example, we are going to increment a Tag value every time another Tag changes its value.


.     Create two tags in Tags Document named as TriggerTag (integer) and TagIncrement (integer).




.     Next, create a document Trigger and name it  TriggerDoc, and then insert a new item.

.     In the item configuration, keep the Trigger Type as Trigger, in the Action Type select the value Expression.

.     In the field Trigger insert the following configuration: @TriggerTag.

       and in the Expression field insert: @TagIncrement++;


graphic



.     At this point, we will create a new Graphics Document named TriggerTest. In this document, create two new TextBox objects.

.     After creating the objects, set the fields Text with the following configuration: @TriggerTag. In the first one and in the second one with: @TagIncrement.


graphic



.     Save the modifications and set the TriggerTest document to be the Startup Document.

.     Execute the RunTime.

.     Now, every time the user changes the value of the @TriggerTag's TextBox, the tag @TagIncrement will have its value increased by one.