From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

SystemLink Forum

cancel
Showing results for 
Search instead for 
Did you mean: 

Time precision for Export to CSV

Solved!
Go to solution

Is there a way to export a higher precision timestamp when using the Export to CSV function on a tag's history?




Certified LabVIEW Architect
Unless otherwise stated, all code snippets and examples provided
by me are "as is", and are free to use and modify without attribution.
0 Kudos
Message 1 of 3
(2,502 Views)
Solution
Accepted by topic author MichaelBalzer

The export to CSV does not support higher precision timestamps at the moment. However, you can get that data using a HTTP call to the tag service. If you don't specify that you want it in the CSV format, it will provide the data in a JSON string. In the body of the response, there will be a 'values' field that will contain each value and value information (like timestamp). You would just have to parse that JSON string to get the information you need. If you wanted it in the CSV format, you could then write the file to CSV in a VI. I've attached a VI that you can use to make this query. 

 

I do want to mention that if you're looking for higher precision than seconds, you should be sure to provide a timestamp when writing to the tag. The Write Tag VI has an input for that.

-----------------------------------------------
Brandon Grey
Certified LabVIEW Architect

Message 2 of 3
(2,483 Views)

Thanks very much for the example VI.




Certified LabVIEW Architect
Unless otherwise stated, all code snippets and examples provided
by me are "as is", and are free to use and modify without attribution.
0 Kudos
Message 3 of 3
(2,472 Views)