LAG

Parameters

OrderNameTypeDesc
1amapA map containing parameters for GETHISTORY
2bConstA number of seconds to 'bump' the requested range

Returns

Places an updated version of the map on the stack

Description

This function is used to adjust the times in the parameters to a GETHISTORY command by the given number of seconds.

Positive amounts will move the start/end/range of the query back, while negative amounts will move the results forward in time.

This function is normally used when you are using user-selected time-frames and want to adjust for a time lag between assets.

This function is often used along-side UNLAG, which moves the time-stamps in the history of a set of points.

Example

We want to query 15 minutes of data. But we don't want to include the last two minutes. We can do this by pushing our start and end times back by 120 seconds.

'Wind Turbine #1' ASSET 'Power' PROPERTY {“range”: “15 minutes”} 120 LAG GETHISTORY

If you're trying to synchronise multiple channels of data from different sources, you might want to use UNLAG to adjust the timestamps returned by GETHISTORY.

See Also