The JavaScript Unit can be used to write and execute JavaScript. This Unit uses the onCore Code Editor which can be accessed via the Inspector. Declaring Input and Output PortsDeclare Input Ports with i_MyVar and Output Ports with o_MyVar. Input and Output Ports Data TypesThere are five types of Input/Output ports:
Examples:
|
Default Functions
By default there are three functions:
- Startup: is executed when the JavaScript Unit is triggered.
- Shutdown: is executed when the "execute" function is done.
- Execute: is executed after the "startup" function.
Using Project Variables
Project Variables can be used globally in certain Units (JavaScript, Shell Command). To use a Project Variable, enclose the Variable name in '$', for example "$myVariable$".