Create PLC application
First of all, a PLC application must be created with corresponding variables that are to be published via OPC UA.
-
Create a new controller project with the PLC Designer.
-
Create a PLC application for your use case.
-
Declare variables of different types within the PLC application that you want to publish via OPC UA.
For complex PLC applications it is helpful to declare separate variables for OPC UA communication. The advantage is that it is easier for the programmer to see what is to be released for OPC UA communication and that internal application variables are not mistakenly accessible via OPC UA.
This can be done, for example, via a separate global variable list or via a structure prepared specifically for the use case.
In some situation it is also helpful to copy internal application variables to variables to be published within the PLC application. For example, if only one element from an array is to be published, this can be copied to a separate variable especially for communication. Thus, the complete array is not accessible via OPC UA.