cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

how is tag history stored/displayed?

Solved!
Go to solution
Highlighted

how is tag history stored/displayed?

Im trying to understand a behavior I'm seeing. I have a tag for which I've enabled history. When I open the tag page, I can clearly see exactly at what time I opened the screen because suddenly the tag history gets a lot more dense:

tag hist.PNG

is this just a question of how its displayed (prior data is decimated?). I tried exporting the data to a CSV and it looks like all the data is there, but its just not viewable. Is there a way to view all of it?

 

Also some related points of feedback if you havent heard these yet:

-Timestamp in the graph if you hover over a bullet is displayed as 6.37e+10 which is...not helpful

-Exporting to CSV cuts off subsecond data. This probably won't be a big deal with more tags since I'll slow it down, but not being able to see the dT between two samples using the web tool is unfortunate.

0 Kudos
Message 1 of 6
(273 Views)
Solution
Accepted by topic author smithed
07-02-2018 10:16 AM

Re: how is tag history stored/displayed?

When the tag history view loads it retrieves a 1000 decimated values over the history of your tag to allow it to load quickly and for you to see a preview of what has happened in the past.

 

Once it loads the historical data, it then subscribes to any tag updates, and we show everything else that comes.  We figured it didn't make sense to toss out data that didn't match your original decimation, which is why it looks a bit different.

 

In the future, we hope to hook into the zoom events to allow the web UI to update the decimated data for a given range as you zoom it to see higher resolution information.  However, the tag historian service never returns more than 1 sample per second bucket for a given tag when returning decimated data, so we recommend publishing data 1Hz or slower.

 

We do have an API for retrieving all of the data over a given range, however our web UI doesn't plan to leverage it since we lose the ability to limit the request size.  Your can of course use it in any customer user interfaces you create.

Message 2 of 6
(235 Views)

Re: how is tag history stored/displayed?

Hi,


How can this tag history be displayed in a dashboard? And then add newly received values after the initial history data, just like the tag viewer does? Just found the property on the chart indicator Smiley Wink

 

Can you point me to the API that allows me to retrieve tag history data?

 

Thanks.

Regards,
André (CLA, CLED)
0 Kudos
Message 3 of 6
(91 Views)

Re: how is tag history stored/displayed?

 

Sorry it took so long to respond to this. The only API we have available to retrieve tag history is the HTTP API. 

I've included the API documentation you'll need below:

 

POST - http://<SERVER_NAME>/nitaghistorian/v1/tags/query-history

Body: 

{
"paths": [<TAG_PATH>]",
"startTime" : "<START_DATE>",
"endTime": "<END_DATE>"
}

You'll want to make sure that your 'startTime' and 'endTime' are ISO 8601 date strings. If it's easier for you, I can provide a LabVIEW VI that performs the call as well. Let me know if you prefer that.

-----------------------------------------------
Brandon Grey | AST & SystemLink PSE
Certified LabVIEW Architect

Message 4 of 6
(63 Views)

Re: how is tag history stored/displayed?

An example VI is always welcome.

Regards,
André (CLA, CLED)
0 Kudos
Message 5 of 6
(53 Views)

Re: how is tag history stored/displayed?

Attached. You'll need to change the server information, username, and password. 

-----------------------------------------------
Brandon Grey | AST & SystemLink PSE
Certified LabVIEW Architect

0 Kudos
Message 6 of 6
(50 Views)