More On Events

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

Moderator: uasdknet

Post Reply
nwhelchel
Sr. Member
Sr. Member
Posts: 14
Joined: 16 Oct 2012, 16:33

More On Events

Post by nwhelchel »

Hello,

I'm implementing event handling in a UA Server. I've been following the Server Getting Started example and it seems, in general, straight forward. However, for the way I want to generate them I've come up against a stumbling block. Let me explain.

From the client I call a method node with arguments that defines a NodeId, a comparator value, and a target value to compare against. Essentially, I want the server to take this information, use it to monitor the variable node and compare it against the supplied target value. When it meets the comparison criteria, I want to generate an event (or events) to indicate the condition was reached.

I started down the road of creating some data structures and a thread to read the node value and execute the comparison routine, however I am uncertain how to instigate this read request (given a NodeId) on the "server" side. The Read() I overloaded for handling basic client read requests is the simpler one (of context, nodehandle, indexRange, and dataEncoding) and frankly I don't understand how to get these values, and I have a suspicion I don't want to be calling this method directly anyway.

Am I headed down the right path, or is there a simpler or a better 'best practices' way to monitor node values on the server side so I can send events when the values meet my criteria - like some sort of server side monitoring method if you will? These are values I don't want to monitor on the client side, but I want to generate events when appropriate.

Any help leading me down the right road would be tremendously helpful.

Regards,
Nathan

nwhelchel
Sr. Member
Sr. Member
Posts: 14
Joined: 16 Oct 2012, 16:33

Re: More On Events

Post by nwhelchel »

Never mind - suffering from tunnel vision and brain fade - amazing what a little sleep will do. I don't have to use any server mechanism to read the data, the nodes contain user data which allows me to instigate a read from the device, so I can simply call GetNodeUserData(nodeId), get the value directly, and send the event if appropriate.

Nathan

Post Reply