.NET Script Plug-in .NET C# Script

Scripting with .NET / C#

No system can cater for each and every need. This is why a certain degree of flexibility is always needed. The Script plug-in offers additional flexibility because it allows you to define transfer objects and triggers for use with the OPC Router yourself. You are permitted to use basic functions of the OPC Router directly in the script. You can also connect external .NET assemblies, if this is important for your project.

Run a free test now

Example for C# Script in OPC Router

C# Script plug-in for individual triggers and transfer objects

That’s how easy it is.

Connecting Systems

What’s Transfer, Trigger and Browsing?

Transfer Objects

The transfer object of the Script plug-in contains all your written scripts.

Script Editor

The Script Editor can be opened directly in the transfer object, and allows easy editing of the respective script. The editor provides syntax highlighting. Once you have edited your script, you can validate your script as well. The library items of the OPC Router are directly accessible and made available in a tree structure. They already contain all predefined methods for implementation.
The only requirement: You need your own code with its own logical data model, which you paste into the methods.  If you want these to interact with other objects of the transfer, you can define parameter accordingly.

Parameters

Parameters are data files that present your script as input or output data fields during transfer. The fields can belong to different types and can be arranged as arrays.

Trigger

The Script plug-in has its own trigger function, which is the Script Trigger.

Script Trigger

The Script Trigger carries out previously defined C# scripts, which allows the implementation of individual triggers, based on your own logic models. This can be done with the same editor that is used to create a transfer object; and with the very same convenient configuration functions.

Browsing

The Script plug-in delivers defined Script Parameters as transfer data fields to external systems.

.NET C# Script Plug-in Application Examples

Develop triggers and transfer objects according to your own requirements

With the Script Plug-in you can create transfer objects and triggers according to your own needs with just a few lines of C# code. When defining your own trigger, you can define input parameters which you can then check for a trigger condition according to your own logic to trigger the connection if necessary.
Using a self-written transfer object, data can be processed, transformed (ETL) and processed with .NET libraries in any way you like. In practice, script objects are often placed between other transfer objects to “translate” data between the two transfer objects.

Script Symbol
Symbol Arrows
OPC Router Symbol
DLL Symbol
Symbol Arrows
OPC Router Symbol

Include Third-Party Assemblies

Some vendors provide APIs via .NET assemblies to gain access to their systems. These assemblies can easily be made available via a reference in the Script Plug-in, so that the objects and methods of the third-party API can be used in the script itself. In an OPC Router project, systems that do not have their own OPC Router Plug-in (e.g. Python) are also included in the Industry 4.0 infrastructure.

Here you will find further information
about OPC Router and Plug-ins.

Plug-ins
Run a free test now