NI Home > Community > NI Discussion Forums

LabVIEW

Showing results for 
Search instead for 
Do you mean 
Reply
Member
fr33k
Posts: 14
0 Kudos
Accepted Solution

reading timestamp from column in txt-file

hi labview pros

 

i'm working with labview 8.6 for about 1 week and i need some help with reading txt-files.

 

the textfiles i have to read have 2 - 11 columns.

the first column shows the time and the others show different channels from which i measured voltages.

so, there is no problem with reading the voltage-columns, and put it onto the y-axe in the vi's graph but i can't get the time-column on the x-axe.

 

i took the basic "read from text file.vi" and modified it a bit according to my needs.

 

hope you can help me, getting the time column on the x-axe. (maybe with a xy-graph???)

 

the vi and txt-file i have to read are attached...

Member
jack47
Posts: 119
0 Kudos

Re: reading timestamp from column in txt-file

You can right click on the grapg axis and select 'formatting'.  In the pop-uo select absolute or relitive time, add the 'container' and then select what you want to display.

 

xy formating.PNG

Knight of NI
Dennis_Knutson
Posts: 34,094

Re: reading timestamp from column in txt-file

Changing the formatting does nothing. There is nothing in the data that can be used. The x axis would just default to a t0=0 and dt =1.

 

You could create a waveform data type and use the first time value as t0 and the sample rate as dt.

Knight of NI
Dennis_Knutson
Posts: 34,094

Re: reading timestamp from column in txt-file

Here's an example. The formatting of the x axis to relative time will now do something.

Member
fr33k
Posts: 14
0 Kudos

Re: reading timestamp from column in txt-file

[ Edited ]

jack47 wrote:

You can right click on the grapg axis and select 'formatting'.  In the pop-uo select absolute or relitive time, add the 'container' and then select what you want to display.

 

xy formating.PNG


 

lv01.PNG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

i allready tried this option but it brings an incorrect result.

maybe you mentioned that with this option, every value in the graph gets a time of 1 second.

for example, the fourth value is at 01:00:03 (red line).

but in the txt-file the voltagevalues have a space of 4 seconds inbetween. so the third value should have a time of 12 seconds (cause first value starts at 0)

 

but thx for first reply!

Message Edited by fr33k on 09-16-2009 03:21 PM
Member
JohnSki
Posts: 18

Re: reading timestamp from column in txt-file

Hello,

 

Here is what I would do.  I created a second selection table for the x-axis and got it to format correctly for you.  Now you can plot any channel against any other channel - time included.  For this purpose though, I assumed that your x-axis selection would be time.

 

John Niezgoski

Signal.X Technologies

Certified Developer

Member
fr33k
Posts: 14
0 Kudos

Re: reading timestamp from column in txt-file

thx for all your replies!

@dennis knutson: thx for the example-vi. i combined it with my vi and it worked fine. thats exactly what i was looking for!

@johnski: thx also for your solution, i think it also would work but it's a bit going to far for my needs. good work anyway. maybe i can use it in a next vi.


Member
PSB Singapore
Posts: 15
0 Kudos

Re: reading timestamp from column in txt-file

Can you guys save it under 8.5 version. I would like to see it too. That could really help in my project. Thanks!
Member
JohnSki
Posts: 18
0 Kudos

Re: reading timestamp from column in txt-file

Here you go