How to extract or read data from OPC-UA server

Questions regarding the use of the .NET SDK 2.0 for Server or Client development or integration into customer products ...

Moderator: uasdknet

Post Reply
uniashish9970
Jr. Member
Jr. Member
Posts: 1
Joined: 18 Jun 2018, 12:13

How to extract or read data from OPC-UA server

Post by uniashish9970 »

I am student and i am new to OPC-UA. I am working on project where i am using Codesys software as OPC-UA server and I am done with coding for discovery and subscription by coding simple client application in .NET SDK. I want to read the variables from the server.
How i can able to read the variable in OPC-UA client based on .NET SDK, if i am not using ua-modeler for address space design and i have server as software PLC (Codesys)?

martenbyebye
Hero Member
Hero Member
Posts: 21
Joined: 03 Mar 2017, 16:08

Re: How to extract or read data from OPC-UA server

Post by martenbyebye »

Hi,

I guess you solved it? Reading a node has nothing to do with the modeler. If you can browse the information model with any client, e.g. with UaExpert, you should be able to find out the NodeId and do a normal Read using the .NET SDK.

Code: Select all

var nodesToRead = new List<ReadValueId>();
nodesToRead.Add(new ReadValueId { NodeId = nodeId, AttributeId = Attributes.Value });
var dataValues = this.session.Read(nodesToRead, 0,TimestampsToReturn.Both, new RequestSettings());

ucsballen
Full Member
Full Member
Posts: 5
Joined: 25 Aug 2018, 01:04

Re: How to extract or read data from OPC-UA server

Post by ucsballen »

uniashish,

What if you don't have the node ID. How do you browse the address space and obtain the node ID?

ucsballen
Full Member
Full Member
Posts: 5
Joined: 25 Aug 2018, 01:04

Re: How to extract or read data from OPC-UA server

Post by ucsballen »

Never mind I figured out the answer.

Post Reply