Event Handlers / Callbacks

Discussion created by policarpo on Dec 11, 2013
Latest reply on Dec 12, 2013 by Marcos Vainer Loeff

I am quite new to OPC / Osisoft and I am wondering how to avoid polling and how to use real callbacks with the AF SDK. Is that possible?


I've seen the PIDataPipe, but I believe that calling GetUpdateEvents once in a while is not the best thing one can do. I was hoping to find a hook to place a callback and get a notification anytime a value/collection changed. Something like:


PIDataPipe pipe;




pipe.Changed += new EventHandler<…>(…);


Also, using SignUp method for registering a set of PIPoint seems to make it impossible to get notifications if a new point gets created (assuming the new point would match some particular query/nameFilter). So, instead of specifying a fixed set of PIPoint to monitor, hopefully there would be a way to get notifications that are affected by a given query/nameFilter. That is, instead of providing a fixed list of PIPoint to the PIDataPipe, a query/nameFilter would be provided. So, we would get notifications for points that are updated/created or even deleted.


Something like:


pipe.AddSignUp(myServer, "*sinusoid*");


Is this something doable with OsiSoft SDKs? Maybe with some other part of the API?