|
|
Rank: Member Groups: Member
Joined: 8/26/2009 Posts: 10 Location: Canada
|
I have a C#.Net service that connects to a PI server and subscribes to the EventPipes of several tags.
My event handler is being fired even though the value on the server has not changed. (Ex. If the current value is 1 and I write 1 to the server, my event will be triggered.) Is there a way to have the event pipe fire only when the value has changed?
Regards, Joel.
|
|
|
|
|
OSIsoft vCampus is a subscription-based, online offering that consists of providing everything people need to develop applications on the PI System. We invite you to take a "tour" of the OSIsoft Virtual Campus - also feel free to consult the FAQ or contact OSIsoft vCampus for more details.
|
|
|
Rank: Advanced Member Groups: Member
Joined: 12/3/2009 Posts: 71 Location: Germany/Pennsylvania
|
Joel,
I suppose you’re listening to all events (snapshot and archive) using PIData.EventPipe. In this case it is correct that you receive all events for a tag.
If you want the see the events with "new" values, let the server do the compression and use IPIData2.ArchiveEventPipe instead.
This should solve your problem, if your tag is configured properly.
Remember this solution is not perfect, it depends on the compressing settings of your tag (especially compmax attribute)
Michael
|
|
|
Rank: Member Groups: Member
Joined: 8/26/2009 Posts: 10 Location: Canada
|
Hi Michael,
Thanks for the info. Much appreciated.
Regards, Joel.
|
|
|
Rank: Administration
 Groups: Administration
Joined: 6/20/2008 Posts: 612 Location: Cheshire, United Kingdom.
|
Just note that even though your event pipe fires but there appears to be no new value, it is not always the case. You will likely be getting a value but with a newer timestamp (or an out of order event), which is perfectly reasonable. Principal Consultant Real-Time Data Management @ Wipro Technologies
|
|
|
Rank: Member Groups: Member
Joined: 8/26/2009 Posts: 10 Location: Canada
|
Thanks for the update. I am not well versed in PI but I am learning! :-)
The effect I am looking for is: notification only when the value has actually changed. What we have, as far as I understand, is a PI node that is pulling info out of PLCs every second therefore, my event is firing every second even though the data in the PLC has not changed.
I have altered my code so that it keeps track of the last value received for a data point. Each time I receive the event, I check with the collection to see if the value has changed.
This is not an optimal solution as the event is still raised once per second for each data point I am monitoring.
Regards, Joel.
|
|
|
Rank: Advanced Member Groups: Member
Joined: 12/3/2009 Posts: 71 Location: Germany/Pennsylvania
|
Yes, therefore I wrote "the solution is not perfect".
You can reduce the amount of events send to the snapshot subsystem by changing the exception-reporting specifications, if applicable. (check ExcMax and ExcDev attributes)
Michael
|
|
|
Rank: Member Groups: Member
Joined: 8/26/2009 Posts: 10 Location: Canada
|
Hi Michael,
When I said the solution was not optimal...I meant my solution of checking the previous value in a collection, not yours. No offence was meant.
I am looking into the Exception Deviation value as we speak so that the values do not come in every second but rather say every 10 minutes.
I tried using the Archive Event but the values are not pushed into the archive fast enough for my needs; there is too much of a delay between the value being written to the snapshot and then to the archive.
I will try with the regular Event Pipe, the Exception Deviation and my solution of checking the previously received value. Hopefully this combination will provide me with the best possible results.
Thanks for the help.
Regards, Joel.
|
|
|
Rank: Advanced Member Groups: Member
Joined: 12/3/2009 Posts: 71 Location: Germany/Pennsylvania
|
Joel,
don't worry. There was no misunderstanding.
I suggested to use ArchiveEventPipe because of two reasons: 1) You receive events every minute. But if most of the events are never send to archive and you need the information in real-time you can't use the ArchiveEventPipe . 2) When to treat a value as a changed one? (in case of a digital or string tag it's easy, but if you have numbers...). In such a case you have to introduce a suppressing mechanism, which is already there.
What pointtype (numeric or digital) you have to monitor and how ExcMax and ExcDev are set?
Michael
|
|
|
|
Guest
|