![Avatar](https://opcfoundation.org/wp-content/uploads/sp-resources/forum-avatars/defaults/userdefault.png)
08/18/2016
![sp_UserOfflineSmall](https://opcfoundation.org/wp-content/sp-resources/forum-themes/reboot/images/darkpack/sp_UserOfflineSmall.png)
I has a problem about Event Handler.
My SDK version is C#.
I can use "InformatiobNodes.OnCallMethod = new GenericMethodCalledEventHandler(OnInformatiobNodesEvent)" to get When the user clicks on the call event. And I can use this to update the node data.
But when the opc ua client publishing the nodes without use call event, how can i get the puhlish event every 100ms to update the node data?(if the ua client set 100ms publishing Interval).
My current practice is to use an thread and infinite loop to update the node data, but this is a waste of CPU performance.
- while
- {
- InformatiobNodes.Value = GetRandomValue();
- InformatiobNodes.ClearChangeMasks(SystemContext, false);
- Thread.Sleep(100);
- }
Can i use Event Handler or other methods to update the publishing nodes data every 100ms?
![Avatar](https://opcfoundation.org/wp-content/uploads/sp-resources/forum-avatars/defaults/moderatordefault.png)
Moderators-Specifications
Moderators-Companion
Moderators-Implementation
Moderators-Certification
Moderators-COM
02/24/2014
![sp_UserOfflineSmall](https://opcfoundation.org/wp-content/sp-resources/forum-themes/reboot/images/darkpack/sp_UserOfflineSmall.png)
This might be better posted to GitHub if you are looking for support related to code.
I'm also wondering what you are actually looking for? Publish interval is how often a server sends data if something has changed (i.e. if anything has passed the client provided filter). If nothing changes no data is published. Periodically a keep-alive will be sent, but again no data if nothing has changed. The server has a sampling rate (again requested by the client, but can be updated by the server) at which it checks the underlining system for value/status changes, but again if nothing changes nothing is reported. Typically the server has a thread that either process exception changes from an underlining system or poll the underlining system for any data that changes - if anything is reported or found to change, it updates the value/status and marks a change. The server code that handles client communication will detect the change and report it back on the next publishing interval.
Paul Hunkar - DSInteroperability
1 Guest(s)