Context
Context object is an input point for accessing context-dependent objects, their methods and fields.
Fields
Name
Description
expression
Contains an object of Expression type with information about the expression being executed
currentTrigger
Contains the name of the trigger that initiated the execution of the expression (string)
data
Contains an object of DataMap type for obtaining values of data triggers at the moment of expression execution
bundle
Contains a Bundle object for transferring data between expressions
token
Intended to store arbitrary data obtained during the execution of an expression
signalTime
Contains the time when the trigger was fired
Examples
The following example demonstrates a script that adds 1 or 1000 to the current value of the expression, depending on which of the triggers was activated. In this example, the expression has two periodic triggers at intervals of 100 ms (trig_100ms) and 1000 ms (trig_1000ms).
The next example demonstrates the use of the token property. The code in the listing returns the arithmetic mean of the last three values obtained from the tag. This is possible because the value of the token property is stored and available during the next execution of the expression. In this example, the expression has a data trigger (trig_number) with a numeric tag.
Last updated