Script package
The script package contains the elements required to run script files in Octoplant:
- The script interpreter
- Standard commands
- Supported keywords and functions
- Sample configuration and script files
Script files use the SCRIPT extension. They contain structured text and commands that the interpreter processes at run time.
How the interpreter runs scripts
The interpreter uses information from initialization files and interface files to determine which script to run and how to execute it. The steps below summarize the process.
- A script-relevant event occurs on the server or client side.
- Octoplant creates the interface file with event, component, and user data.
- Octoplant evaluates the initialization file for the event (for example,
BeforeEdit.ini). - The interpreter selects the script file assigned to the component type or uses the default script file.
- The interpreter processes the commands in the selected script file.
- After the script finishes, Octoplant continues the standard workflow and applies any returned values.
Example
A user selects an RW 5000 project and starts the editor with F4.
The component type ID of the RW component is DC14F6773F0B4705886A3457646C92B6.
User configuration
The initialization file maps component types to the script file that should run.
The user configures the BeforeEdit.ini file as follows:
Execution flow
- Octoplant evaluates the
BeforeEdit.iniinitialization file. - Octoplant creates the interface file and starts the interpreter.
- The interpreter checks whether a script is assigned to the component type ID.
- The interpreter selects the script file
RW5000_OldEditor.script. - The interpreter analyzes and executes the instructions in the script file.
- After the script finishes, the system continues the process and applies the script return values.
Related topics