Script Editor

Three types of scripting are available in PARCview: client-side scripts, MDE scripts, and server-side scripts. Client-side scripts are ad hoc calculations using the data currently being displayed; these calculated values are not historized. Server-side scripts are calculated by PARCcalc Server and are historized. MDE scripts are calculated by MDE displays using cell values rather than input values and are historized into the MDE source.

The Script Editor is used to create client-side scripts. Client-side scripts are divided into three categories: Expressions, Simple Formulas, and Advanced Formulas. Expressions are one-line modifiers that perform calculations on normalized data and can be added to the end of a tag using the  syntax /EXPR= “expression”. Expressions are ideal for short, simplistic calculations that will not need to be used repeatedly or require much variability to generalize. Formulas are similar to expressions, but a formula can contain multiple lines of code and is saved independently from any scripted tags that call it. Formulas can also accept arguments, allowing for more flexibility.

The Script Editor is also used to create calc tags. Calc tags are formulas or expressions that have be saved to create new independent tags. A calc tag can have its own name, description, units, range, interpolation type, and draw mode like any process tag and can be used throughout PARCview.

The Script Editor can be launched from the PARCview Explorer, the Tag Browser, or from Trend.

In the PARCview Explorer, navigate to the Tools ribbon and select Script Editor.

In Tag Browser, select Script Editor in the Source ribbon. This will open the script editor with whatever tag was selected as the base UTag.

Also in the Tag Browser, the Script Editor can be launched by right clicking a tag in the window and selecting Script Editor. This will open the script editor with whatever tag was selected as the base UTag.

In Trend, right-click in the plot area and select Add Calc.

The New Calc Tag Name window will appear where the name and source of a new calc tag can be specified. The new calc tag will be saved to the database after clicking the Create/Save Calc Tag button in the ribbon bar of the Script Editor.