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 can I bind data to variable
March 9, 2017
4:11, EET
Avatar
tzls
Member
Members
Forum Posts: 4
Member Since:
October 20, 2016
sp_UserOfflineSmall Offline

Hi
Now I have a periodic variation and want to bind it to a variable in address space.First I got the variable node by the method findNode(NodeId) in class com.prosysopc.ua.server.NodeManager,then change the value of the node by the method updateValue(Object) in class com.prosysopc.ua.server.nodes.UavariableNode.It can work ,but the methods should be called every few seconds.Do you have some suggestions ?

March 9, 2017
10:11, EET
Avatar
Heikki Tahvanainen
Moderator
Members

Moderators
Forum Posts: 402
Member Since:
April 17, 2013
sp_UserOfflineSmall Offline

Hi,

Thank you for the question. Can you explain what is the problem with updating the data every few seconds?

If you use the UaNode-based approach, you will have to update the value to the node object. Alternatively, if your data is already in an existing subsystem, it may not feel very reasonable to replicate it all with UaNodes. In this case, you can implement a custom NodeManager (and other managers), which manages the service requests from the OPC UA clients and provides the requested data.

Without knowing more about your exact system, I would say that the best option is to just keep using the updateValue method and calling it whenever your data changes. For example, OPC UA subscriptions will only work if you provide all the value updates.

March 9, 2017
14:12, EET
Avatar
tzls
Member
Members
Forum Posts: 4
Member Since:
October 20, 2016
sp_UserOfflineSmall Offline

Hi,
Thanks for your reply.I try to explain my question clearly.when a variable in address space represents the value of a sensor in physical world,I wonder what should I do to make the value of the variable changes with the changing of the sensor value.

March 10, 2017
12:19, EET
Avatar
Heikki Tahvanainen
Moderator
Members

Moderators
Forum Posts: 402
Member Since:
April 17, 2013
sp_UserOfflineSmall Offline

Hi,

You need to use the UaVariableNode.updateValue or UaVariableNode.setValue methods. Alternatively, if you are using the generic PlainVariable implementation, you can use the PlainVariable.setCurrentValue method.

March 16, 2017
18:05, EET
Avatar
hbbend
Member
Members
Forum Posts: 9
Member Since:
October 21, 2016
sp_UserOfflineSmall Offline

Hi,

is it Ok if I use read or writeAttribute, instead of UaVariableNode.updateValue or UaVariableNode.setValue methods”
in the OnDataChange method of MonitoredDataItemListener?

Thank’s in advance,
B/R

March 17, 2017
14:52, EET
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1010
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

I assume that you are doing this in the client side. Yes, I is fine. But note that they validate the AccessLevel and WriteMask, if the operation is allowed. If you want to set the value unconditionally, you can use setAttribute().

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

Currently Online:
9 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 135

pramanj: 86

Francesco Zambon: 81

rocket science: 77

Ibrahim: 76

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

TimK: 41

Member Stats:

Guest Posters: 0

Members: 682

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1468

Posts: 6262

Newest Members:

joliecheney96, digitechroshni, LouieWreve, Kickbiche, karrimacvitie5, graciela2073, sagarchau, elviralangwell4, Donnavek

Moderators: Jouni Aro: 1010, Otso Palonen: 32, Tuomas Hiltunen: 5, Pyry: 1, Petri: 0, Bjarne Boström: 983, Heikki Tahvanainen: 402, Jukka Asikainen: 1, moldzh08: 0, Jimmy Ni: 26, Teppo Uimonen: 21, Markus Johansson: 42, Niklas Nurminen: 0, Matti Siponen: 322, Lusetti: 0, Ari-Pekka Soikkeli: 5

Administrators: admin: 1