Skip to content

The script package

Scripts are available as files with the extension *.script. SCRIPT files contain structured text and simple commands in script language. The content of the files can be analyzed by the interpreter contained in the script package and executed.

Calling scripts with the script interpreter

  1. A script event occurs.
  2. The corresponding script interface is called.
  3. An interface file with information about the affected component is created.
  4. The interpreter is started and checks whether a script is assigned to this component type for this script event. It searches for a file with the name {Component type ID}.script.

    • If this is not the case, the system checks whether a default script has been defined in the {Script event}.ini file.
    • If this does not exist, the system checks whether a script is assigned to the component type in the {Script event}.ini file.

    Info

    The SCRIPT file must be in the same folder as the interpreter.

  5. If a script is found, the interpreter analyzes the instructions it contains and executes them. If no script is found, the system's default action is executed.

Example

An RSLogix 5000 project has been selected and the editor started with F4. The component type ID of the RSLogix component is DC14F6773F0B4705886A3457646C92B6. The BeforeEdit.ini file looks like this:

[General]
Default =
DC14F6773F0B4705886A3457646C92B6 = RSLogix5000_OldEditor
  1. octoplant calls the BeforeEdit script interface.
  2. The script interface creates the interface file and starts the interpreter.
  3. The interpreter checks whether a script is assigned to the component type ID.
  4. The script RSLogix5000_OldEditor.script is assigned to the component type ID.
  5. The interpreter analyzes the instructions in the SCRIPT file and executes them.
  6. After the script is finished, the process is executed taking into account the return values of the script.