Configuration of OPC-Conversions

The OPC server offers the feature to online convert process data. The OPC-Server takes care of online-conversion in both communication directions : :

Sample:

Configuration of OPC-Conversions 1:

The OPC-Server presents a converted variable as data type "VT_R8 / Double" to OPC-client - independent of the actual numerical datatyp in the PLC.

The usage of OPC-Conversions needs the configuration of a TPY-File (AutoCfgSymFile) for the corresponding device and AutoCfg 8.

Step 1: Configuration of OPC-Conversions in OPC-Server

In the first step you need to configure TwinCAT OPC-Server for conversions. This is a one-time configuration and does not need to be repeated when changes to the PLC project occur.

Start TwinCAT-OPC-Configurator "Start - All Programs - TwinCAT System - TwinCAT OPC - TwinCAT OPC Configurator"

Configuration of OPC-Conversions 2:

Navigate to "Conversions", right click and select menue "New".

Configuration of OPC-Conversions 3:

For "Name" please enter a name for this alarm definition. This name has to be OPC conform, no special characters allowed.With "OK" you see the dialog to configure in detail your new "Conversion".

Configuration of OPC-Conversions 4:

The following table gives an overview about all possible configuration settings.

Parameter

Beschreibung

Conversion ID

ID which is important for step 2.

Type

0: No conversion.
1. Linear conversion.

Clamping [optional]

Defines a maxmium and minimum value. If this value is higher/lower, it will be clamped.

High EU

 

Low EU [optional]

 

High IR [optional]

 

Low IR [optional]

 

H Clamping [optional]

 

L Clamping [optional]

 

Disable [optional]

Deactivates the conversion setting.

Save the configuration via "File" --> "Save As". After the configuration has been saved, you will be asked if this configuration should be set as the startup-configuration.

Configuration of OPC-Conversions 5:

The configuration will be automatically activated on next restart of the OPC-Server.

Configuration of OPC-Conversions 6:

Step 2: Configuration of PLC-Variables for OPC-Conversion

With previous steps we defined a "conversion-Template" with detailed information about conversion handling. Now we define, which PLC variable should be handled with conversion. Similar to the Data Access feature, this configuration also occurs by adding comments to the PLC-project.

Beispiel:

Configuration of OPC-Conversions 7:

Configuration of OPC-Conversions 8:

Today just global PLC-variables can be linked to conversion-templates. Elements of structures or arrays can not be configured as an OPC-conversion.