/getLiveData timestamps
I am reading live data of tags that are in the same group and have a sample time of 1 sec in the OPC collector. When I read the live data I get some .5 second intervals (which seems odd since the OPC collector should be collecting at most a 1 second interval) and the timestamps of reading multiple tags from the same group are sometimes different. Is there a way to have the timestamps align?
{'statusCode': 'Good', 'errors': [], 'data': {'Tag1': [['2025-06-10T16:39:27.0000000-04:00', 13039.0], ['2025-06-10T16:39:28.0000000-04:00', 13042.0]], 'Tag2': [['2025-06-10T16:39:27.0000000-04:00', 1.97539], ['2025-06-10T16:39:27.5000000-04:00', 1.96624]]}, 'continuation': None}
{'statusCode': 'Good', 'errors': [], 'data': {'Tag1': [['2025-06-10T16:39:29.0000000-04:00', 13049.0], ['2025-06-10T16:39:30.0000000-04:00', 13052.0], ['2025-06-10T16:39:31.0000000-04:00', 13055.0], ['2025-06-10T16:39:32.0000000-04:00', 13062.0], ['2025-06-10T16:39:33.0000000-04:00', 13065.0]], 'Tag2': [['2025-06-10T16:39:29.0000000-04:00', 1.96786], ['2025-06-10T16:39:29.5000000-04:00', 1.96], ['2025-06-10T16:39:31.0000000-04:00', 1.9797], ['2025-06-10T16:39:32.0000000-04:00', 1.96354], ['2025-06-10T16:39:33.0000000-04:00', 1.97341]]}, 'continuation': None}
In the above you will notice Tag1 timestamps seem to be every 1 sec, where Tag2 sometimes has a 0.5 sec interval and at other times a 1 sec interval.
When doing external analysis of the data it would be helpful to have both timestamps align if possible.
Any help would be appreciated
3 replies
-
Hi ,
The OPC Collector will normalize timestamps to the nearest half-Sample Interval. So, if you're sample interval is set to 00:00:01 (which I think is the default value), it is expected that you could get half-second timestamps.
https://helpcenter.canarylabs.com/t/m1yf8x6/opc-collector-tile-version-25#group-settings-tag-based
The /getLiveData call will only return raw data so there is no way to normalize the timestamps through it. If you use /getTagData2, you could normalize timestamps if you pass in an aggregate and aggregate interval, but it's not the same type of function if all you're looking to do is get the last update(s) since the previous call.