Current Value Sampling Mode

Current Value Sampling Mode retrieves the data sample value with newest timestamp of any quality that was received by the archiver. This is not the same as retrieving the newest raw sample stored in the archive, since archive compression sometimes discards raw samples sent by the collector during the compression process.

Current Value Sampling retrieves a single sample containing the current value of the tag, not a series of historical samples. The sample has a timestamp, value, and quality.

Timestamp

Returns the time stamp on the sample sent to the archiver. The time stamp is not necessarily the current time. If collector compression is enabled and the deadband on the collector has not been exceeded for some time, the time stamp may be much earlier than the current time.

If data is sent to the archiver out of order, the current value is always the newest timestamp, even when the most recent value received is older than previous samples.

Example: Retrieving the current value of out of order data

  1. Import this file that contains out of order data for a tag
    * Example of Out Of Order data
    * [Tags] Tagname,DataType,HiEngineeringUnits,LoEngineeringUnits
    OUTOFORDERTAG,SingleFloat,60,0
    [Data] 
    Tagname,TimeStamp,Value,DataQuality 
    OUTOFORDERTAG,29-Mar-2002 14:50:00.000,50.0,Good 
    OUTOFORDERTAG,29-Mar-2002 14:20:00.000,20.0,Good 
    OUTOFORDERTAG,29-Mar-2002 14:30:00.000,30.0,Good 
    OUTOFORDERTAG,29-Mar-2002 14:10:00.000,10.0,Good
  2. Retrieve the data using current value sampling, using the following query:
    select timestamp, tagname, value, quality from ihrawdata where samplingmode = CURRENTVALUE and 
    tagname = OUTOFORDERTAG

The time stamp of the current value should be the newest timestamp with the value and quality that was sent to the archiver, as shown here:

TimestampTagnameValueQuality
29-Mar-200214:50:00.000OUTOFORDERTAG50.00 GoodNonSpecific
  • Value: Simply the value sent by the collector. The value is not interpolated to the current time or modified by the archiver during retrieval. The data type of the value will be the same data type as the tag's raw data.
  • Data Quality: Returns the quality of the data sent by the collector. The current value can be of a bad data quality and will be flagged if the collector sends a sample with a bad data quality to the archiver. When the collector shuts down cleanly, it sends a bad data quality marker at shutdown time for all its tags. If the collector simply loses its connection to the archiver or crashes, the current value's quality will not automatically change to bad.

Example: Retrieving the current value of a tag

The following sequence of steps displays the behavior of Current Value sampling mode. After each step, retrieve the tag current value using this query:

select timestamp, tagname, value, quality from ihrawdata where samplingmode = CURRENTVALUE and 
 tagname = IFIX.RAMP.F_CV
  1. Configure the tag IFIX.RAMP.F_CV in an iFIX collector running on different PC than archiver. Configure it to have a one-second collection interval. The Current Value should be within one second of the value shown in a data link.
  2. Stop the iFIX collector. The end-of-collection marker is sent to the data, so the Current Value quality should be marked as bad and its value set to zero.
  3. Restart the iFIX collector. The Current Value quality should be marked as good and it should have a valid value.
  4. Put the block off scan in the PDB. The Current Value quality should be marked as bad. (Put the block back on scan when you've verified this.)
  5. Pull the network cable from the iFIX collector running on another machine. The current value remains unchanged as the value was good at the time the cable was pulled. To ensure that the Current Value is accurate, you would have to use the Heartbeat Address of the iFIX collector to verify that the collector is running.
  6. Enable collector compression for the point and ensure that the tag's value does not change. The time stamp of the current value will stay the same until the collector reports a change.

Anticipated Usage

The current value can be used in any operator display. You should also display the data quality of the current value. You may choose to use the Heartbeat address of the collector so that you can confirm that the collector is running and that the current value is therefore up to date.

If the collector was shut down gracefully, then the current value would correctly display a bad data quality (and a value of 0). If the collector crashed or was disconnected from the server, then the current value will be the last value sent before the crash or disconnect.