Skip to main content
Version: 5.4

Script Plug-in

Editing scripts

warning

Attention: Within a Docker container, only assemblies compiled for .net Core are supported.

The script plug-in allows you to freely define transfer and trigger objects with your own C # code. In this respect, the plug-in configuration differs from the other plug-ins: After assigning the name and type, open a code editor to edit the script.

At code-editor

  • create assembly references
  • define input and output parameters
  • you already find the basic methods you can program
  • there are tools for OPC access and writing log messages

The script plug-in allows you to describe complex issues in the transfer object and triggers; For example, to perform conversions or to trigger complex database queries.

At the top of the menu bar you will find the “Rename script” button (blank sheet with pen) to change the previous name of your script.

note

Note: In larger application scenarios, the router will be part of an overall strategy, eg. For example, where code carrying business logic is deposited. Even with smaller projects, it makes sense to consider whether z. B. Conversions in the router or stored procedures in the database are made.

IDisposable

We recommend that you include the IDisposable interface in the script. This allows you to free memory, e.g. when you open ports or start threads in the script. Open ports or running threads will be closed or terminated at the end of the script. Write the required code in the corresponding method.

public void Dispose()
{
// your code
}

The Dispose method is called when:

  • you publish the script after changes
  • Sie das Script ohne Veränderungen veröffentlichen
  • after deleting a connection, you publish it
  • the plug-in is stopped (this always happens when publishing)

Creating scripts

Script Plug-In

  1. Open the plug-in by double-clicking “Script” at the plug-in menu. You receive the list of transfer object scripts and trigger scripts on two tabs.
  2. Choose “Add script” to create a new script and specify name and type. When you create a new script, the script opens automatically in the script editor. Or double-click on an existing entry to open the script in the script editor.
  3. Program your script (see below). Remember to compile and save.

Transfer objects and triggers are then available for connection configuration.