Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
How to read Items from OPC UA?
August 5, 2022
11:48, EEST
Avatar
CC
Member
Members
Forum Posts: 8
Member Since:
August 4, 2022
sp_UserOfflineSmall Offline

I couldnt find any example of how to read one exact Item from my Server. So how would you read a specific Item which lets say has the ID 1.

August 8, 2022
9:57, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 1026
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Hi,

Please clarify what you mean, a term “one item from server” doesn’t mean anything in OPC UA.

Just to doublecheck even though you used UA in the title, are you actually trying to connect to a OPC Classic Server and not OPC UA Server (these are basically 2 completely different technologies; like there are gateways to convert things, but our java-based SDK is only for OPC UA)?

Assuming the term was just used in a more generic interpretation (or based on the Classic background) and we are talking about OPC UA, note that in OPC UA there are Nodes which are defined via unique NodeId and then each node has an number of Attributes (of which the NodeId is one as well). Thus you will know or look up the NodeId and then with that you can select an attribute of the node when reading.

So, assuming you mean e.g. the Value Attribute of a node, then you would use one of the UaClient.readValue(…) methods with the NodeId, or readAttribute if something else than Value.

August 10, 2022
14:34, EEST
Avatar
CC
Member
Members
Forum Posts: 8
Member Since:
August 4, 2022
sp_UserOfflineSmall Offline

Hey, i am talking about the OPC UA Server. The problem i have right now is that i cant read any Node or any attribute even though i know the nodeID. I dont really understand what to give into ( new NodeID(i, x) ). So my question now is what is i and x. I think that i must be the identifier of the nodeid or am i wrong?

August 10, 2022
14:38, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 1026
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Did you already read the tutorials that come with the SDK?

Also, please use e.g. https://www.prosysopc.com/products/opc-ua-browser/ first to look around the address space “tree”, it might make more sense after that.

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 1919

Currently Online:
9 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Heikki Tahvanainen: 402

hbrackel: 144

rocket science: 88

pramanj: 86

Francesco Zambon: 83

Ibrahim: 78

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

Member Stats:

Guest Posters: 0

Members: 738

Moderators: 7

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1524

Posts: 6451

Newest Members:

jonathonmcintyre, fannielima, kristiewinkle8, rust, christamcdowall, redaahern07571, nigelbdhmp, travistimmons, AnnelCib, dalenegettinger

Moderators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1026, Jimmy Ni: 26, Matti Siponen: 346, Lusetti: 0

Administrators: admin: 1