Sequencer - RunScript
The RunScript can be added to Basic Block Execution Control Chart (ECC) State
blocks. and are intended to run short Chai scripts using local Argument and CDPPort values when the State
becomes active.
The RunScript can also trigger sending a local Event when no script is set or the script calls emit();
function and the output is connected to an EventOut.
Note: When RunScript does not call emit();
function or is not connected to EventOut output, no event is emitted as a result of running a non empty script.
As an alternative the State
blocks can also have run operation(s) that indicate what operators to execute when the state becomes the current state in ECC.
Note: With Basic Block TransitionMode
property option P makes it also possible to run RunScript
script when the ECC stays in the same state during the process run instead of only on transitioning to a State
.
Properties
Property | Description |
---|---|
Script | Script to execute, when the last statement evaluates to true any connected local event will be emitted. All Argument names, <state_name>.Time , <state_name>.Visited , <state_name>.Active , <port_name>.Connected and <port_name>.<api_name> can be used in the expression as immutable variables. See Expression Syntax for more details. |
RoutingList | List of routings to local events to emit when the scrips is empty or emit(); function is called in script. |
Note: All the available unrouted variables in the expression, like Arguments and Port values, are mutable.
Note: Nested Port and Operator block outputs are inputs from RunScript's perspective and vice versa.
Note: All mutable block output values used in expressions must be cast to a primitive value using cast operator ArgumentOut = double(ArgumentOut) + 0.5;
. Input values can be used directly without casting ArgumentOut = ArgumentIn + 0.5;
Note: All routed input and output Arguments and Port values will not be updatable by RunScript
.
See Chai script for syntax help.
Get started with CDP Studio today
Let us help you take your great ideas and turn them into the products your customer will love.