asanford

OPC-HDA gaps due to out-of-time-order data collection by OPC-HDA server

Discussion created by asanford on Oct 19, 2010
Latest reply on Jun 23, 2011 by spilon

We are trying to understand how to move data from a third-party OPC-HDA server into PI, via the PI OPC-HDA interface (I know this forum refers to the PI OPC servers, but this seemed like the best forum to post to, even though this post is regarding PI being an OPC client rather than server.) 

 

In some cases, an OPC-HDA server may provide additional historical data on subsequent calls that it did not provide in prior calls, typically because the OPC-HDA server itself acquired the data from other sources out of time order.  For a hypothetical example, on the first call to the OPC-HDA server, the client may ask for data from 1/1/2010 thru 1/10/2010.  The server may provide data for all days in the range except 1/3/2010.  If the client were to ask for data for the same date range in a second call after a short interval, the server may have now acquired data for 1/3/2010, and so it would supply data to the client for all of the requested days.  The trouble is that as I understand things, the PI OPC-HDA interface (when running in normal mode) will only ask for data with a start time equal the timestamp of a point's most recent good point value.  So, in this example, since after the first call the PI server will have good point values thru 1/10/2010, on its next request it will not ask for data older than 1/10/2010.  So, we end up with a persistent gap in the data.

 

Now, you can configure specific start and end times for OPC-HDA interface, but they are only used for "history recovery only" mode (in this mode, the interface reads data for the specified range and then shuts down.)  So, someone would have to detect a gap in the data, then create a new, temporary interface configured for "history recovery only mode" for the specific time range of the gap, run the interface, and then delete the interface, or dynamically edit the existing interface, to the same end.

 

1)      Is there a way (using PI SDK, PI API, or some other SDK) to programmatically create a new interface, edit an existing interface, start & stop an interface, etc.?  This would allow us to automate the fixing of gaps, an avoid getting the PI sysadmin involved with manual configuration changes to interfaces.

 

 

 

2)      An alternative might be to create a new, custom PI interface to suit our needs.  We don’t really want to do this at this point, but we want to understand the options.  Is this something third parties can do?  Is there documentation, SDKs, etc. for this?  Alternatively, we of course could instead push data into PI outside of a formal interface (for example, by acting as an OPC-HDA client, using PI-SDK, etc.), but ultimately we’d be acting as an interface, so we might as well benefit from the advantages of being a “real” interface.

 

 

 

3)      We think the easiest solution would be if the PI OPC-HDA interface had a configuration option where you could optionally specify a “start time offset.”  When specified, each time the interface asks for new data for a point, instead of using a start time=[point’s last good value’s timestamp], it would use start time=[point’s last good value’s timestamp] – [start time offset].   The existing interface does in fact currently support a very similar parameter called “start time adjust”, but this is slightly different, in two ways:

 

a.       It only applies if you are performing reads in groups of multiple points, rather than one by one (that is, it only applies if you specify the “Group Size” parameter.)

 

b.      More importantly, “start time adjust” is relative to the last read time for this group, rather than the point’s last good value’s timestamp.

 

-In any event, it doesn’t seem like such a configuration option exists.  If we didn’t care about (b), then maybe we could work around this problem by setting “Group Size” = 1 (I don’t know if that is supported.)  However, we think (b) matters in our case.

 

 

 

Any ideas or suggestions would be much appreciated!

 

 

 

Thanks!

 

 

 

 

Outcomes