Example of application combining Tag event and scripts

<< Click to Display Table of Contents >>

Manual > Server Creation Guide > Events > Event Applications >

Example of application combining Tag event and scripts

Define the occurrence conditions by combining Script Ver1 and Tag event

If you want to trigger an event under complex conditions that cannot be fully defined using Tag event, you can achieve this by combining it with Script Ver.1 actions.

 

Specifically, prepare a tag specifically for storing the result of the judgment, judge the condition using script Ver1, and assign the result to the tag for judgment. When the tag is TRUE, Tag event will be generated.

 

Example) If "U01.F01.T02" is in the range of 50 to 100

 

U01.F01.T01  =  U01.F01.T02 > 50 And U01.F01.T02 < 100

 

 

Example: If the average value of "U01.F01.T02" and "U01.F01.T03" exceeds 100

 

U01.F01.T01  = (U01.F01.T02 + U01.F01.T03 ) / 2 > 100

 

In this case, the Script Ver1 action that performs the condition comparison can be called by periodically calculating using the Periodic event or Scheduled event created for that purpose. Alternatively, create Tag event based on the tag used on the right side of the calculation, and set it so that an event occurs when the value of each tag changes, so that Script Ver1 is executed every time the tag used for evaluation changes.

 

 

hint

Normally, tags like the above are created using virtual devices or memory devices. Numeric tags for memory devices can also use decimal points.

 

hint

For information on Script Ver1 actions, please refer to "Script Ver1".