|
Scripts |
Top Previous Next |
|
The viewing and modification of Calculated Pen scripts can be done via the Edit Page Dialog. The Edit page dialog can be accessed by clicking on the Edit Page toolbar or menu item.
After selecting a Calculated pen in the Page's list of pens a script can be created in the Script Text Box.
The Script text box has code completion functionality. Pressing Control and the space key brings up the code completion context menu in the script text box.
When the dot character is typed in the Script text box the code completer checks if the text preceding the dot character is of a valid Entity or Attribute. If the text preceding the dot character is a valid Entity or Attribute a context menu with the properties and functions that are available for that object.
When the opening round bracket character is typed in the Script text box the code completer checks if the preceding the opening round bracket character is of a valid Function. If the text preceding the dot character is a valid function then a context menu with the parameters for the function is shown.
A script can comprise of a simple arithmetical operation on a pen. An example of this is: return NPPHOS.KG.Value + 10
A script can comprise of arithmetical operation on multiple pens. An example of this is : return NPPHOS.KG.Value - NPPPHOS.KG24LIM.Value + 5
A script can get offset data. The offset applies on how many rows the data is offset at. An example of this is: if IsOffsetDataAvailable(NPPHOS.KG, 2) : return GetOffsetData(NPPHOS.KG,2) else : return NPPHOS.KG.NoValue
If an entity begins with a numeric value then an underscore is placed in front of the entity. An example of this is: return _00FIQ008.LSR.Value + 10
If an entity has a Minus symbol in the entity then the Minus symbol must be replaced with a underscore. An example of this using the Sump-Hi.PV pen is: return Sump_Hi.PV.Value + 10
|