Example Program For Providing A Method For Opc Ua Clients - Siemens SIMATIC ET 200AL System Manual

Distributed i/o system
Hide thumbs Also See for SIMATIC ET 200AL:
Table of Contents

Advertisement

OPC UA communication
9.3 Using the S7-1500 as an OPC UA server
The following table describes the different categories of error codes.
Table 9- 5
Error code
(hexadecimal values)
0000_0000
8xxx_xxxx
Axxx_xxxx
B080_C300
B08x_yz00
For more error codes, see Error codes (Page 194)
Assignment of data types (SIMATIC – OPC UA)
For the input and output parameters of methods, please note the explanations regarding the
rules on usable data types in the section "Mapping of data types" (Using OPC UA
companion specifications (Page 203)).
Supply of structured data types with nested arrays
If a structured data type (Struct/UDT) contains an array, the OPC UA server does not
provide information about the length of this array.
If you use such a structure as the input or output parameter of a server method, for example,
you must ensure that the nested array is supplied with the correct length when the method is
called.
If you do not adhere to this rule, the method fails with the error code "BadInvalidArgument".
9.3.4.3

Example program for providing a method for OPC UA clients

Example program for a server method
This section includes the complete program code for the example program "OpenDoor".
The example shows you how a user program uses the instructions
"OPC_UA_ServerMethodPre" and "OPC_UA_ServerMethodPost".
The instructions are described in the sections OPC_UA_ServerMethodPre (Page 184) and
OPC_UA_ServerMethodPost (Page 187).
The program provides a server method for OPC UA clients: The program sets the output
parameter "Result" to the value 1 when the input parameter "Number" has the value 1.
In order to keep the example easy and simple, a detailed error evaluation ("Status"
parameter) is not included.
190
Error codes for the status
Explanation
Instruction finished successfully.
OPC UA specific error
PLCopen specific error
Insufficient resources
SIMATIC-specific error
Function Manual, 12/2017, A5E03735815-AF
Communication

Advertisement

Table of Contents
loading

Table of Contents