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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Plotting Time Stamp from Txt file in Column to another column

I want to know how to plot 2 columns that i am reading from a text file.

column 1 has a time stamp in HH:MM:SS,  and column 5 has data in which i want to plot the time verus the data.

 

0 Kudos
Message 1 of 9
(3,110 Views)
Read the txt file, convert into 2D-array, then use Index Array to pick out particular column of interest. Lastly, use buid array and waveform chart to plot your data
Andy Chang
National Instruments
LabVIEW Control Design and Simulation
0 Kudos
Message 2 of 9
(3,107 Views)

i have sepearted the columns that i want to get a graph of. The time column and the data column are both in 1d string array.

 so when i use the build array function they become a 2d string array and i am not able to connect this to

a waveform chart.

 

i can convert the data string into a number, but how do i convert Time string (HH:MM:SS) into a number format for plotting time and data read from text file

0 Kudos
Message 3 of 9
(3,100 Views)

Here's a snippet with a HH:MM:SS string converted to Seconds, Time of day, and a Time record.  Which format did you want?

 

Time from str.png


"Should be" isn't "Is" -Jay
Message 4 of 9
(3,092 Views)

I am not able to connect the time to the mattch pattern since the time is in 2d array.

 

10:00:00       0.65

10:05:02       0.65

 

This is what my txt file that i am ready looks like, but with more columns.

I want to take column 1 which is time in an array and column 2 which is also in an array and plot.

0 Kudos
Message 5 of 9
(3,077 Views)

Use the index array function to get a column or a row from a 2d array <Check the help for index array>

 

Oh-  Edit- You will need to put the conversion inside a loop and operate on each time string element

Message Edited by Jeff Bohrer on 03-18-2010 12:12 PM

"Should be" isn't "Is" -Jay
0 Kudos
Message 6 of 9
(3,073 Views)

i was able to get the time from column 1 into an index array, but i do not understand how to create the while loop.

do you have an example.

0 Kudos
Message 7 of 9
(3,064 Views)

 

You are really new to LabVIEW aren't you?

 

Have you tried any of the getting started excercizes yet?

 

Jaxon.png

 

Message Edited by Jeff Bohrer on 03-18-2010 03:30 PM

"Should be" isn't "Is" -Jay
0 Kudos
Message 8 of 9
(3,046 Views)

The Scan from String function will do most of those conversions in a single step.  Here are a couple of examples.  You will still need to read the array of strings in and process in a loop.

 

timestampScan.png

Message Edited by DFGray on 03-19-2010 07:46 AM
0 Kudos
Message 9 of 9
(3,033 Views)