I setup a history for some coordinate tags with following setting:
Deadband Style: Discrete
Sample mode: On change
Min Time between Sample: 5 secs
The tag will receive from GPS device every 3 to 4 sec and tags are constantly changing, so every 5 sec they are logged in the database.
But when I show it in a table the result show that every 5 seconds historian take two sample at exact same time. (even in milsec) I wonder why there two samples taken instead of one?
I use ignition v8.0.12
The way these numbers repeat, I’m guessing that latitude and longitude don’t update at quite the same time.
After I get the data I put them to related tag one after each other with system.tag.write().
By the way it doesn’t make sense to record two sample every 5 sec. What is wrong with my setting here?
What do you get if you retrieve each one separately? If each separate tag gives a single point, then it’s in the way you’re combining it.
That doesn’t really equate to simultaneous. If this happens at the edge of your sample size, I can see a race condition going on.
Consider using system.tag.storeTagHistory() if you really need to keep the timestamps the same.
If I read them separately same will happen twice log each 5 sec.
I try to change to analog mode and every thing work ok. This is prove that my method is right.
But for thing like coordinate I need to treat them as discrete and analog doesn’t suit here.
Have you tried your min times to something lower than your tag updates?
Yes the same pattern happen again because for example is I set min time to 1 and I update my tag at 4 sec, there is no change in each 4 sec interval so nothing record until 4 sec pass
You are right about it except on thing.
Even I set two tag value with same time stamp when I use as Store mode in table history query, because there are two data available there are two row.
I wish ignition detect it and simply combine the result into single row if timestamp is equal.