LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

read specific data from numeric text file

Hi,

 

In the project i am working on, i get acceleration data using a sensor connected to the computerb in the USB port. The sensor logs the data online in a txt file as attached. There are 5 columns: time, acceleration about the x, y and z axis and the net acceleration.

 

I want to access this data using my Labview vi to use for detection purpose. I also want to separate these data to get the specific data which is the 'net acceleration' which is the last column in the file..

How do i access it in real time?

or can i time the vi in some way to get the data in the file every 3 seconds or so?

 

Please advice,

 

ruser

 

 

 

0 Kudos
Message 1 of 4
(2,755 Views)
Hi ruser,
If you want to access the last column of your text file, you can use ' Read from spreadsheet file.vi  ' with ',' as delimeter. Post your vi so that we can help you to get values in realtime before saving as txt.
---
Silver_Shaper | CLD
0 Kudos
Message 2 of 4
(2,751 Views)
Spoiler
 

Hi,

 

Thanks for the tip; i will try that;

 

For the accessing data problem:

 

I am trying to build a new vi to access the text file in real time...  the sensor board automatically logs the data to the text file in real time...and i want to access the data using the vi.; similar to the way one accesses the data using a Read from DAQmx  block.; The text file i sent is the one which is logged ...

 

so, i think i have to figure out a way to either access the text file in real time while it is being recorded; or get the data directly from the USB port... using the vi;;....

 

regards,

 

ruser

0 Kudos
Message 3 of 4
(2,723 Views)

Hi Ruser,

 

You can read data from a text file without too much trouble.

 

I am concerned about how your other driver writes the text file.  Does it write the file as the acquisition is happening, or does it buffer the data and then write the file when the acquisition is complete?  If the driver does write to the file as the acquistiion is happening, does it also save the data?  If it does not save the data in real time, you will not be able to read from the file in real time.

 

For your other question, you should be able to write your own drivers, but that is going to be a significant undertaking on your part.

 

Ryan

Applications Engineer
National Instruments
0 Kudos
Message 4 of 4
(2,699 Views)