Replace a Script

You improved a procedure and want the new version to run. What to do depends on whether its interface changed.

Same interface: replace the file

The interface is unchanged when no parameter was added, removed, renamed, moved to another group or given another type. Reordering parameters within a group does not change it, and neither does a change to the body, the description, the default value or min and max.

  1. Copy the new <procedure>.hdvp (and the interface file, if it changed) into the script folder.

  2. Restart the app.

  3. Check: v1/<module>/status/code is 0. v1/<module>/script/procedure-hash shows the new file’s hash; script/interface-hash is unchanged.

The new vision logic runs behind the same nodes. Your PLC program needs no change.

Changed interface: accept it on purpose

A changed interface changes the module’s nodes and breaks PLC programs written for the old ones. The Script Runner therefore never applies it on its own:

  1. Copy the new procedure into the script folder and restart the app.

  2. Read v1/<module>/status/code. Expected: -10005 (interface changed). status/text gives the accepted and the current hash. The module keeps only its status/, script/ and fixed run nodes and accepts no request.

  3. Compare v1/<module>/script/interface with what your PLC program expects. Adapt the PLC program.

  4. Copy v1/<module>/script/interface-hash into the module’s acceptedInterfaceHash in the application file and restart the app.

  5. Check: status/code is 0, and the new nodes are there.

List a changed interface in your own release notes: for everyone who calls the module it is a breaking change.

Going back

Copy the previous procedure file back into the script folder and restart the app. If its interface hash is the accepted one, the module is built as before.