I'm reaching out for some assistance with my data storage issue. Currently, my data is stored on change. However, for warranty purposes, we need to provide 1s data. I've been using the queryTagHistory function and have been able to obtain 1s data when setting noInterpolation=False as the default. However, the data obtained isn't completely accurate. When there is a high spike, it appears to be smoothed out and almost non-existent due to the interpolation/linear curve being applied. Furthermore, it seems that the interpolation curve is applied to the entire result, and as a result, timestamps with actual values in our SQL database aren't accurately represented in the result.
Can anyone offer any suggestions on getting accurate 1s data without sacrificing the integrity of the information?
I'm looking for
time | tag1 | tag2
1 | 5.56 | 1.45
3 | | 2.45
4 | 5.78 |
to be returned like this...
time | tag1 | tag2
1 | 5.56 | 1.45
2 | 5.56 | 1.45
3 | 5.56 | 2.45
4 | 5.78 | 2.45
5 | 5.78 | 2.45
This is somewhat happening when I run a query with the following parameters:
queryArgs = {
'paths': [
"tag1",
"tag2",
],
'startDate': startDate,
'endDate': endDate,
'columnNames': ['val1', 'val2'],
'ignoreBadQuality': True,
'noInterpolation': True
}
03/02/23 21:00:00 | None | 5.34240007401
03/02/23 21:00:03 | None | 5.3968000412
03/02/23 21:00:03 | 5.21120023727 | 5.3968000412
03/02/23 21:00:06 | 5.34240007401 | 5.3968000412
03/02/23 21:17:10 | 5.35520029068 | 5.3968000412
03/02/23 21:24:55 | 5.35520029068 | 5.41440010071
03/02/23 21:27:49 | 5.35520029068 | 5.41440010071
03/02/23 21:27:52 | 5.3968000412 | 5.41440010071
03/02/23 23:21:02 | 5.3968000412 | 5.3968000412
03/02/23 23:22:14 | 5.37919998169 | 5.3968000412
03/02/23 23:39:27 | 5.22399997711 | 5.3968000412
03/03/23 00:35:58 | 5.22399997711 | 4.76479959488
You can clearly see the repeated values that aren't present if I were to query each tag separately.
However, If I add 'intervalSeconds':1 the values somehow change
03/02/23 21:00:00 | 5.21120023727 | 5.34261457325
03/02/23 21:00:03 | 5.21171160309 | 5.39030669383
03/02/23 21:00:06 | 5.32654295381 | 5.39683135847
03/02/23 21:17:10 | 5.35520029067 | 5.40891686344
03/02/23 21:24:55 | 5.35520029068 | 5.41439901068
03/02/23 21:27:49 | 5.36048611886 | 5.4139595526
03/02/23 21:27:52 | 5.39668543442 | 5.41395197469
03/02/23 23:21:02 | 5.37938561217 | 5.39679585964
03/02/23 23:22:14 | 5.37919995031 | 5.38671227781
03/02/23 23:39:27 | 5.22397880613 | 5.24150392561
I may be losing my mind.