.NET Based OPC UA Client/Server SDK
2.6.4.435
|
A session with the server must be established.
The following dialog shows an example implementation of the Read service. Press the button “Show Code” to display the corresponding code, and the button “Help” to show this documentation page.
Press the button “...” to open a Browse window and select a NodeId of a variable with a structured DataType, e.g. ServerStatus. Confirm your choice by pressing “OK”.
The NodeId is now displayed in the field “Node Id” and the drop-down shows all available Data Encodings for the DataType of the selected Variable node. Standard values are “Default Binary” and “Default XML”.
On pressing the button “Read”, the variable is read using the specified data encoding and the response is displayed at “Read Response”. Check the box in front of “Use Asynchronous Pattern” to call “BeginRead” instead of “Read”.
Calling the Read service itself works in the same way as shown in the other Read examples. The difference is that the DataEncoding is set in the ReadValueId. In this example, the DataEncoding can be set in the GUI. The CacheManager of the session is used to get the BrowseName of the encoding node.
In most use cases, one of the standard encodings “Default Binary” or “Default XML” is used. Then you can hard code the DataEncodings with
or