You are here: Start » Technical Issues » Communicating over OPC UA

Communicating over OPC UA

Aurora Vision Studio provides a simple implementation of a OPC UA client, supporting client-server mode communication, allowing to establish connection(s) with OPC UA compatible servers over the OPC TCP binary protocol, allowing to read and write values of variable nodes in the server address space.

Working with OPC UA

The functionality is provided by the filters from the OPC UA category.

First, optionally, if a secure connection is required by the application (message encryption, signing, identity verification), the OPCUAClient_SetupSecurityCertificates filter needs to be invoked to set up the security configuration and certificates environment.

Next, the OPCUAClient_Connect must be invoked to establish a connection with a OPC UA server. Multiple connection filters can be invoked in the same application to establish connections with multiple server endpoints at the same time.

After establishing the connection with a server the filters from OPCUAClient_ReadValue and OPCUAClient_WriteValue groups can be used to respectively read a value from a server variable and write a value to a server variable. The read and write filter variants needs to be picked according to the type of the accessed variable. The table below shows which filters can be used to access given OPC UA variable data types:

OPC UA Data TypePossible access filters
Boolean OPCUAClient_ReadBoolValue, OPCUAClient_WriteBoolValue
Byte, SByte, Int16, UInt16, Int32, UInt32, StatusCode OPCUAClient_ReadIntegerValue, OPCUAClient_WriteIntegerValue
Byte, SByte, Int16, UInt16, Int32, UInt32, Int64, UInt64 OPCUAClient_ReadLongValue, OPCUAClient_WriteLongValue
Float, Double OPCUAClient_ReadRealValue, OPCUAClient_WriteRealValue, OPCUAClient_ReadDoubleValue, OPCUAClient_WriteDoubleValue
DateTime, UtcTime OPCUAClient_ReadLongValue, OPCUAClient_WriteLongValue
Enumerations OPCUAClient_ReadIntegerValue, OPCUAClient_WriteIntegerValue
Arrays of: Byte, SByte, Int16, UInt16, Int32, UInt32, Boolean, Enumerations OPCUAClient_ReadIntegerArrayValue, OPCUAClient_WriteIntegerArrayValue
Arrays of: Float, Double OPCUAClient_ReadRealArrayValue, OPCUAClient_WriteRealArrayValue
String, LocalizedText, XmlElement, Guid OPCUAClient_ReadStringValue, OPCUAClient_WriteStringValue
ByteString, Image, ImageBMP, ImagePNG, ImageJPG OPCUAClient_ReadByteBufferValue, OPCUAClient_WriteByteBufferValue

The filters in the table above can also work with OPC UA data types derived from the basic types they support.

For the information on how to send images to the OPC UA server see the description of the OPCUAClient_WriteByteBufferValue filter.

When finishing the work with the OPC UA server the OPCUAClient_Close filter can be used to terminate the connection.

Previous: Communication with Modbus TCP devices Next: Project Files