DeltaV Reporter > Worksheet function reference for DeltaV Reporter

Single Value function (DvCHValue)

This worksheet function can be used to retrieve a single sample for a tag at a specified time. If used to show headers, time stamps, or status information about the values, this function must be entered as an array formula in a range that has the appropriate number of rows and columns. You can use the Configure Single Value Function dialog in DeltaV Reporter to set up a call to this function.

Syntax

DvCHValue(connection, tag, show_header, columns, time_mode, selection_mode, timestamp)

Example Array Formula

=DvCHValue("localhost","DeltaV=MAIN_WORKSTATION CHS250_1S/SGGN1/OUT.CV",TRUE,"Value;Timestamp","GMT-06:00",0,"10/12/08 12:00:00 PM")

Function Arguments

connection
The node name of the DeltaV Continuous Historian server.
tag
The DeltaV tag for which you want to retrieve data. The tag can be text, such as FIC101.PV, or a cell reference. In the case of a cell reference (such as $A$1), the contents of the referenced cell must contain a valid tag.
show_header
A Boolean (TRUE or FALSE) that indicates whether or not you want the returned data to have a column header row.
columns
A string that defines the columns to be included in the worksheet. Column definitions are separated by semicolons. Each column definition comprises the column name and, optionally, various attributes relating to that specific column. Column attributes are separated by commas. The following columns and attributes are supported:
  • Column name: Timestamp
    • Mode attribute: Local, GMT, or GMT ±hh:mm
  • Column name: Value
    • For Int32, UInt32, and Float data types, the value stored by Excel is a Variant Double.
    • For strings, the value stored by Excel is a Variant String.
    • For enumerations, the value stored by Excel is the state name in a Variant String.
  • Column name: Parameter Status (that is, FfStatus)
    • Mode attribute. Valid modes are:
      • Text – which yields a descriptive string, such as GoodNonCascade NonSpecific NotLimited
      • IsGood – which yields a Boolean: TRUE if the parameter status is good, or FALSE if it is not good (that is, bad or uncertain)
      • Number – which yields the raw value as an integer
  • Column name: Collection Status (that is, DvCHStatus)
    • Mode attribute. Valid modes are:
      • Text – which yields a descriptive string
      • IsGood – which yields a Boolean: TRUE if the collection status is good (that is, 0) or FALSE if it is not good (not zero)
      • Number – which yields the raw value as an integer
time_mode
Indicates how the time stamp argument should be interpreted. The DeltaV Continuous Historian database records all times in GMT; the time_mode argument specifies what conversion, if any, should be applied to the supplied time stamp in order to convert to GMT.
  • Local – the time stamp is treated as being in the time zone of the client PC. Conversion to GMT takes into consideration whether the time stamp falls within daylight saving time.
  • GMT – no conversion is necessary
  • GMT ±hh:mm – the time is adjusted by the specified hh:mm; daylight saving time has no effect.
selection_mode
Indicates how you want to select data in relation to the time(s) specified.
  • If 0 – the sample immediately previous to the requested time stamp is returned.
  • If 1 – the sample immediately after the requested time stamp is returned.
  • If 2 – the value at the supplied time stamp is interpolated.
timestamp
Is a single time stamp for which the DeltaV Continuous Historian database is queried. Specify time stamp as text or a cell reference.
Note

If you specify the time stamp argument as a cell reference, the cell must contain a valid date and time in standard Excel format, not exceeding millisecond precision—for example, "10/12/2008 21:06:40.676".