Is there any other method to read current data with the latest timestamp ?

I am using CurrentValues() method to read real time data of pipoints.

I am receiving some Data with old timestamp despite the presence of data with timestamp newer.

Is there any other method to read current data with the latest timestamp ?

Parents
  • I am using OSIsoft.AFSDK version 4.0.0.0,

    Here's the code snippet to fetch the current value of a list of PI points:

     AFListResults<PIPoint, AFValue> values = pointList.CurrentValue();

    I'm directly retrieving values from PI points, without any mapping to AF attributes.

    The issue I'm encountering is that I'm getting a value from a PI point with a timestamp that isn't the most recent.

     

  • All right. I see a couple of potential issues here:

     

    1. The specs for the CurrentValue() function says 'Get the value of the PI Point as the current PI Server time'. Could there be time differences between your computer and the PI Server (PI DA)?
    2. Does the issue happen with all tags you are reading from, or just some? Could this be as simple as the CurrentValue() function reading archive values, and the value you're comparing to is coming from the Snapshot? As you may know, not all values coming from an interface into PI gets stored in the archive, if you have compression enabled.
Reply
  • All right. I see a couple of potential issues here:

     

    1. The specs for the CurrentValue() function says 'Get the value of the PI Point as the current PI Server time'. Could there be time differences between your computer and the PI Server (PI DA)?
    2. Does the issue happen with all tags you are reading from, or just some? Could this be as simple as the CurrentValue() function reading archive values, and the value you're comparing to is coming from the Snapshot? As you may know, not all values coming from an interface into PI gets stored in the archive, if you have compression enabled.
Children
  • Here's the problem at hand: I'm utilizing a sample client to input data via the UpdateValue method, with the timestamp set to the current time. I aim to archive older data, specifically entries older than 5 days, by inserting them with their respective historical timestamps. However, upon inserting data with the sample client and attempting to retrieve the current value using another sample client, I've observed that I'm retrieving old data with outdated timestamps instead of the most recent data. The CurrentValue function should ideally return the latest data with the most recent timestamp, not the recently inserted data with an older timestamp.

  • This seems a bit strange, everything should be collected based on the timestamp of the value - not by the order they were inserted in.

    Can you please try the RecordedValue() instead? It has parameters to specify timestamp and retrieval mode, so you have a bit more control of what you request / get.