Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Historian

Returning multiple records with MaxRowCount

  • Last UpdatedSep 11, 2023
  • 2 minute read

A ProcessValues request with Startbound or Endbound retrieval modes can return multiple records by including the parameter MaxRowCount,

The following GET request specifies a MaxRowCount of 3 and the Startbound retrieval mode:

https://online.wonderware.com/apis/Historian/v2/ProcessValues?$filter=FQN eq 'MountainWaterTreatment.CartridgeFilterOutlet.TemperatureC' and DateTime le 2021-09-03T18:44:09.352247Z&RetrievalMode=Startbound&MaxRowCount=3

As shown in the example below, the above query will return the records for [“00:08”, “10”], [“00:06”, “7”] and [“00:04”, “4”].

Timeline showing return multiple request timestamp.

The following GET request specifies a MaxRowCount of 2 and the Endbound retrieval mode:

https://online.wonderware.com/apis/Historian/v2/ProcessValues?$filter=FQN eq 'MountainWaterTreatment.CartridgeFilterOutlet.TemperatureC' and DateTime ge 2021-09-03T18:44:09.352247Z&RetrievalMode=Endbound&MaxRowCount=2

As shown in the example below, the above query will return the records for ["00:08", "10"] and ["00:12", "-1"].

Query showing timestamp of returned records.

Notes on using MaxRowCount with Startbound and Endbound

  • In scenarios involving versioned-original records, requests using MaxRowCount will include versioned-original records up to the amount of records specified with the parameter. For example:

    Timeline showing retrieved values.

    In the above data set, specifying a MaxRowCount of 3 and a EndDateTime of 00:07 in a ProcessValues call using Startbound retrieval will return the values recorded at 00:06: 7, 8, and 2.

    If MaxRowCount is set to 2, any two of those three values will be returned.

  • In scenarios involving versioned-original and versioned-latest records, requests using MaxRowCount will prioritize versioned-latest records by default. In the following example, using Startbound with a MaxRowCount of 3, the values of 4, 7, and 8 will be returned:

    Timeline showing query for specific values.

    The query can be adjusted to specify that only original records be returned. From the following example query, the values returned will be 9, 7, and 8.

TitleResults for “How to create a CRG?”Also Available in