Getting Started Last updated: 02-06-2024
System requirements
The software solution consists of two components: an OPC UA Server component that is installed on an IPC and native client libraries for your PLC environment. The client libraries provide an easy and fast way to exchange data with the OPC UA Server and to execute functions.
DEPRAG Smart |
---|
Operating system: Windows 10 or newer or corresponding server version, 64 bit - alternative Raspberry Pi 4 or newer or similar devices with Linux ARM processor
CPU: 2 cores with at least 1.5GHz
Hard disk space: at least 1GB
|
The client libraries are provided for the following PLC providers. Other, not listed PLC providers can - if they offer an OPC UA Client - be connected by simply calling the OPC UA Server.
Beckhoff TwinCAT 3 | Siemens TIA Portal | |
---|---|---|
OPC UA capable control
Installation of the Beckhoff TwinCAT OPC UA package (TF6100)
|
OPC UA capable controller
TIA Portal V17
OPC UA Runtime license
Current firmware version of the controller CPU
|
Installation
The following explains how to install the DEPRAG Smart OPC UA Server on a Windows system. For installation on a Raspberry PI 4, follow the steps in the supplied Readme.tx
Here you can select how DEPRAG Smart will be used after installation:
OPC UA
The structure of the return values is described below. These always have the same, following structure.
Structure of the return values
Indicates whether the execution of the method was OK.
Contains method execution details
Description of the error if the method execution was not successful.
Execution time of the OPC UA Server for the triggered function
Beckhoff TwinCAT 3
The following explains how to integrate and use DEPRAG Smart in your TwinCAT 3 project.
Download DEPRAG Smart Library and TwinCAT 3 Sample Project
The following content for use with TwinCAT 3 can be downloaded from the DEPRAG Smart website in the left-hand navigation under "Service" in the "PLC Integration" submenu:
Return codes/error codes in TwinCAT 3
Each method in the TwinCAT 3 example returns a return value of type HRESULT. This can contain either the predefined SUCCESS codes or ERROR codes for HRESULT (To the description on the Beckhoff website) or the ERROR codes of the OPC UA client (To the description on the Beckhoff website).
Before the first execution and during the execution the return values of the methods return "S_FALSE". On successful execution, the methods return "S_OK". On incorrect execution, the methods return one of the previously described ERROR codes.
Return values of type "STRING"
In principle, string variables within method returns can have a maximum length of 80 characters, even if they are defined in the corresponding return type with a length of 255 characters.
Siemens TIA Portal
For the deployment a Siemens TIA Portal in version V17 or newer is required. A corresponding OPC UA runtime license must be purchased from Siemens and deposited.
Start DEPRAG Smart and set up your Siemens TIA project. In the Tia Portal you can establish the online connection to the DEPRAG SMART server and use the functions.
For a detailed description of the individual commissioning steps using the Siemens TIA Portal, please refer to the documentation of the PLC supplier.
In the following examples and explanations concerning the calls of nodes via Siemens TIA Portal are shown.
Startup and OPC UA client configuration:
The commissioning and the OPC UA Client configuration can be found in the S7 user module description of the OPC UA Client. "Siemens OPC UA module"
Lists and method calls without switching
The following steps describe the procedure of lists and method calls without switching
The remaining output parameters (Busy, Done, Error, Status) are optional.
If the input MaintainSession is "TRUE", the connection to the OPC UA Server is established and maintained after the function has been executed. The function can then be started by a positive edge at input REQ.
Lists and method calls with switching
The following steps describe the procedure of lists and method calls with switching
The index number of the variables MethodHdl and MethodResult depends on the position of the method in the method list.
If the input MaintainSession is "TRUE", the connection to the OPC UA Server is established and maintained after the function has been executed. The function can then be started by a positive edge at input REQ.
ATTENTION!
The variable MaintainSession must be reset before each switching operation, otherwise it will lead to connection problems.
Processing of large strings (>255 characters)
In order for the WSTRING data type to be able to display more than 255 characters in the TIA Portal programming environment, this data type must be assigned a fixed, defined size. In order to be able to change this assignment for the PLC data types used, you must first copy the PLC data type to be changed and then rename it.
CAUTION! The name of the copied PLC data type must not match the name of an existing PLC data type, as the changes will be reversed during the compilation process.
In the newly created PLC data type, a permanently defined size can now be assigned to the variable of the WSTRING data type.
Create a variable (e.g. local variable in a function block) with the newly created data type and link it to the respective input / output argument of the method call.
CAUTION! In the data blocks OpcUaClientInterface_Data and OpcUaClientInterface_Configuration, no new variables may be created or existing variables modified, since the initial state of these data blocks is restored during a compilation process.
Special case!
If the copied data type contains several PLC data types, all PLC data types that are affected by the modification of the tag must also be copied and created again. The data type should then, as described above, be reproduced again using the newly created / existing PLC data types.