LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

offline present data from text file

hi,
 
How can i present data from a text file with several columns separated using tab delimiter  into a graph or a chart. I like to have the date and time on the x-as.
 
thanks,
Gerrit
0 Kudos
Message 1 of 13
(3,948 Views)
Hi Gerrit,

you should note your LV version as there are some small changes in text file handling in LV8+ compared to earlier versions...

But the process is still the same:
- read in the text file as simple string
- strip the header lines (remarks...) and the row with all column names (search the string for "date", search the next CR/NL, split string)
- use the "spreadsheet string to array" function to vonvert the remaining string to a 2D array of strings
- take the first 2 columns and convert them to a timestamp: use "scan from string" with format "%d-%d-%d" for date and "%d:%d:%d" for time, wire the results to a "date time rec" cluster, convert the cluster with "Date/Time to seconds" to a timestamp
- convert the remaining 2D array to numbers ("Frac/Exp string to number")
- use a XY-graph to plot the data (see context help for how-to-do)

Message Edited by GerdW on 09-26-2007 10:08 AM

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 13
(3,940 Views)
using lv 8.2
0 Kudos
Message 3 of 13
(3,934 Views)

Gerdw,

I tried to build the program but i have problems to build the cluster. Can you show me how to do it?

Gerrit

 

0 Kudos
Message 4 of 13
(3,927 Views)
Hi Gerrit,

you can do it like this:

Create the cluster constant by right-click on input of "date/time to seconds" and "create -> constant" to get a proper one!

Message Edited by GerdW on 09-26-2007 01:14 PM

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Download All
0 Kudos
Message 5 of 13
(3,922 Views)

Gerdw,

 

The time date cluster works fine although i have a problem to filter the correct time data from the string and the measured values. (the line end with cr/lf)

 

gerrit

0 Kudos
Message 6 of 13
(3,910 Views)
Hi Gerrit,

see attachment. It works for me and your given textfile...
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 13
(3,904 Views)
Gerdw,
 
Just one problem, how set i the time stamp on the x-axis.
 
Gerrit
0 Kudos
Message 8 of 13
(3,894 Views)
Hi Lente,

see attachment.

I took an XY-graph and set the x-axis to show "absolute time" (right-click on graph -> x-axis formatting).
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 13
(3,885 Views)

GerdW,

Do you have a better solution for the attachment?

Gerrit

 

 

0 Kudos
Message 10 of 13
(3,853 Views)