<< Click to Display Table of Contents >> Manual > Server Creation Guide > Action Edition > Action Reference > Script Ver1 (SC1) |
How to read the manual
This chapter is for reference information only.
For construction procedures, please refer to "Performing calculations between tags at regular intervals (SC1)" in the Surveillance System Construction Guide.
Features of this action
The Script Ver1 action can execute scripts using "SC1 syntax".
Script Ver1 is a simple script that performs operations between tags using operators such as + - * / < >. It is designed to be easy to use, and does not support if statements (conditional branching) or for statements (repetitive processing). If you want to perform more advanced processing, please consider using the "Script Ver2" action.
The following is an example of a script.
U01.F01.T01 = 1 U01.F01.T02 = U01.F01.T03 * (U01.F01.T04 + 1) U01.F01.T05 = (U01.F01.T06 + U01.F01.T07 + U01.F01.T08) / 3 U01.F01.T09 = (U01.F01.T10 And U01.F01.T11) Or (U01.F01.T12 And U01.F01.T13) |
For information about the syntax available in Script Ver. 1, please refer to Script Ver. 1 (SC1 syntax) in the Script section. |
In Ver4, this action was simply called the "tag script" action, but in Ver5 and later, the script syntax system has been expanded and streamlined to SC1 syntax and SC2 syntax, and the name has been changed to the "Script Ver1" action. |
Action Settings
The settings for this action are explained below.
Action specifications |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
none
|
||||||||||
dialog |
■ Script
Click the Select Script button (...) from the Script tab to display the script editor.
■ Script Editor
Scripts are written in the script editor, which can also contain multi-line expressions.
You can also edit the script in a text editor such as Notepad and then copy and paste it.
|
||||||||||
■ Script Editor (Advanced Settings)
Clicking the "Advanced Settings" button in the script editor will display a detailed settings screen for the script's operation.
▪How to get tag values in a script
This is how to get the value of the tag included on the right side of the script.
▪When communication fails in a script, retry X times
▪Calculate by treating the indefinite value as 0
|
In the "Advanced Settings" tab, you can specify the timing for executing a script (SC1) before an action is executed, or the timing for adjusting the execution of the action (setting the execution wait time). For details on the advanced settings of each action, see "Settings on the Advanced Settings tab of an action". |