Update value on demand|OPC UA Implementation: Stacks, Tools, and Samples|Forum|OPC Foundation

Avatar
Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
Lost password?
sp_Feed sp_PrintTopic sp_TopicIcon
Update value on demand
Avatar
Peter Franklin
Member
Members
Forum Posts: 24
Member Since:
04/14/2020
sp_UserOfflineSmall Offline
1
09/21/2020 - 18:07
sp_Permalink sp_Print

Hello, I am implementing an OPCUA server based on the .NET Standard reference implementation, and I'm very new to OPCUA.

I want to update a value on demand when a client requests, so that it is ensured to be the latest value from the backend database. I'm trying to determine where is the correct place to do this update of the value? Is there a method that I need to override somewhere or something like that? Is there an example in any of the samples anywhere? I couldn't find an example that worked this way. All of the samples either seem to initialize the value at startup, or simulate it changing all the time, but none of them seem to update it when requested by the client.

Thanks in advance.

Avatar
Randy Armstrong
Admin
Forum Posts: 1564
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
2
09/22/2020 - 10:34
sp_Permalink sp_Print

The simulations run in a separate thread so the update is technically "on demand".

Use the same APIs but call it from your backend notification thread instead of using the timer.

Avatar
Peter Franklin
Member
Members
Forum Posts: 24
Member Since:
04/14/2020
sp_UserOfflineSmall Offline
3
09/22/2020 - 17:07
sp_Permalink sp_Print

Thank you for your reply. I'm not sure if I explained clearly what I'm asking though. I don't want to automatically keep updating the value of every node in the system. What I'd like to do is only update the value when it is requested by a client.

I have a back-end SCADA system that is getting updates frequently and that is where the source data values are stored. There can be hundreds of thousands of different points getting updated. I'm not going to have every single point in the system hooked up to a notification thread unless the client subscribes to it. I think I already understand how to do that.

What I'm asking about is just the simple case of a client browsing to a node and requesting the current value. Is there an event or method override that I'd need to hook into where I'd read from my back-end SCADA system, to set the value before the it is read and returned to the client?

Avatar
Andrew Owen
Member
Members
Forum Posts: 4
Member Since:
06/18/2018
sp_UserOfflineSmall Offline
4
01/22/2021 - 04:07
sp_Permalink sp_Print

I might not be understanding what you mean but if you supply a method to the OnReadValue in your server code you could then, in that method, you get the value from your SCADA backend and return it. The OnReadValue is called as a result of a client read. Since the node is supplied to the method you could come up with a extendable means to determine the address of the data in the SCADA backend and use this method for all SCADA data representing nodes. 

Forum Timezone: America/Phoenix
Most Users Ever Online: 510
Currently Online:
Guest(s) 28
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Forum Stats:
Groups: 2
Forums: 10
Topics: 1435
Posts: 4855