AnsweredAssumed Answered

PI-UFL Write multiple events at same timestamp - but only once

Question asked by VCampus-METCO on Apr 14, 2015
Latest reply on Apr 17, 2015 by VCampus-METCO

Hello,

 

We need to interface our Asset Management System (AMS) with PI. OPC DA is available, but not recommended for such a connection - this is meant only for internal AMS tools.

So we have been asked to use the published web-services.

One of the pieces of information that will be required in PI is the health of a piece of equipment. I have successfully queried AMS for a list of active alerts using powershell and I was going to use PI-UFL to write this to PI.

 

In the example above you can see that for asset PBSIM3 we have 3 events at the same timestamp. I would like to store all 3 events.

I can set location5 on the PI Tag to 2, which will add the 3 events at the same time, and I guess that I would also have to set the /AM settings in UFL to ARCAPPEND.

 

This will work fine the first time the powershell runs and generates the XML response. But next time it runs chances are the same events will still be in the list and I only want to add NEW events, not the same 3 again.

 

Is it possible to somehow check to see if an event exists first and to not write if this is the case? The /RBO switch is available but I don't think this will work with the multiple entries at the same timestamp.

 

The alternative might be to implement the feature used in RDBMS interface whereby I keep track of the latest timestamp in the XML file and to only process events that are newer. It would be possible to write this to a tag in PI, but again I don't think that it is possible to read the current value of a tag in the UFL INI file to be able to get at this time.

 

Has anyone come across this problem before?

 

Simon

Outcomes