LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to read time from file onto X axis

I've read multiple posts on time stamping the X axis, but none have satisfactorily answered how to read a file that has a date/time and place it on the X axis in correspondence to the data points.  The data/time is not the current time, but the time from previous data collection. I am going nuts trying figure out how to do this, it seems like it should be simple, yet there is no apparent way to do this. Anybody know how this can be done?

0 Kudos
Message 1 of 13
(4,988 Views)

Are you using a graph, chart or x-y graph? It makes a difference. Is your time stamp a string or floating point number? Can you post an example file?

0 Kudos
Message 2 of 13
(4,982 Views)

Thank you for the response. I will use whatever works, but usually I use a graph.  Here is the file, all I want to do is put the time (first column) on the X-axis and the second column (my variable) on the Y-Axis. 

0 Kudos
Message 3 of 13
(4,970 Views)

You have to convert time stamps to a double time value (Seconds since ???) and your data to numbers (String to number) Doubles . A graph /chart has a T0 (Initial time ) Delta T (Time between samples) It looks like your Delta T is 1 second. 

 

There may be a tool to convert text or delimited files to a tdms file format. TDMS is the National Instruments best method to save and view chart data. You should use some of the on line examples to see example code and use.

0 Kudos
Message 4 of 13
(4,950 Views)

Something like that...

All your points have 1 second spacing, so I recommend waveform. twice less data in memory.

File is pretty large, it is better to read one line at a time, but data conversion is below.

 

time graphs.png

Message 5 of 13
(4,931 Views)
I would suggest a waveform as well but if your sampling changes, you should calculate the dt from the file as well.
0 Kudos
Message 6 of 13
(4,912 Views)

wow you guys this gets deep quick... I thought it would be much simpler. Not sure what many of those functions even are on that template. 

0 Kudos
Message 7 of 13
(4,897 Views)
There's nothing there except Index Array and Scan From String. The image is a snippet so all that you have to do is save the file and then drag it to a block diagram. Instant VI that you can run and use with Context Help turned on.
0 Kudos
Message 8 of 13
(4,874 Views)

Oh I was unaware that the snipit could be used actively on the VI.  It doesn't appear to be able to be saved in labview, it just saves as an image. Also, I am running Labview 8.5, so maybe that is part of the reason I can never view nor use the sample templates on these threads.

0 Kudos
Message 9 of 13
(4,854 Views)

yes, 8.5 does not support snippets.

this can help (did not try it though)

https://lavag.org/files/file/118-getsnippet/

 

original snippet as vi is in attachment

0 Kudos
Message 10 of 13
(4,824 Views)