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

AVEVA™ Historian

RoundTrip retrieval - query examples

  • Last UpdatedFeb 06, 2025
  • 1 minute read

To use the RoundTrip retrieval mode, set the following parameter in your query:

wwRetrievalMode = ‘RoundTrip’

The following queries compare the results between ValueState retrieval and RoundTrip retrieval.

This first ValueState retrieval query returns the average amount of time that the 'Reactor1OutletValve' tag is in "on" state and the average amount of time it is in the "off" state for a single cycle. Any state changes that occur across the cycle boundaries are not included.

SELECT DateTime, vValue, StateTime

FROM History

WHERE TagName IN ('Reactor1OutletValve')

AND DateTime >= '2009-09-16 12:35:00'

AND DateTime <= '2009-09-16 12:55:00'

AND wwRetrievalMode = 'ValueState'

AND wwStateCalc = 'AvgContained'

AND wwCycleCount = 1

The results are:

DateTime

vValue

StateTime

2009-09-16 12:35:00.0000000

0

215878

2009-09-16 12:35:00.0000000

1

61729

2009-09-16 12:55:00.0000000

1

62827.5

2009-09-16 12:55:00.0000000

0

212856

The first two rows are for the "phantom" cycle leading up to the query start time and have a timestamp of the query start time.

The second two rows show the average amount of time for each state and have a timestamp of the query end time (the default).

Compare these results to same basic query that instead uses RoundTrip retrieval:

SELECT DateTime, vValue, StateTime

FROM History

WHERE TagName IN ('Reactor1OutletValve')

AND DateTime >= '2009-09-16 12:35:00'

AND DateTime <= '2009-09-16 12:55:00'

AND wwRetrievalMode = 'RoundTrip'

AND wwStateCalc = 'AvgContained'

AND wwCycleCount = 1

The results are:

DateTime

vValue

StateTime

2009-09-16 12:35:00.0000000

1

277607

2009-09-16 12:35:00.0000000

0

278580

2009-09-16 12:55:00.0000000

0

275683.5

2009-09-16 12:55:00.0000000

1

273845

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