LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I need help having my program read in finite amounts of data at a time

Solved!
Go to solution

I've attached my diagram. The problem(s) I am having are as follows

 

I need to read the data from a .txt (alternately .lvm) file 250 entries at a time. The problem with the construction I have now is that the dynamic to array buffer kind of destroys the point of segmenting the data because it reads it in all at once. In addition, I need a way of reading and writing this data so that I am not using the express VI's.  Pretend my data file is say C:\data.txt and it is a single column of values approx. 5m entries long.

 

Further, I have set up the while loop to stop after everything has been processed, I need to set it up such that the while loop stops when all the data have been read in.

 

Thanks for the help.

0 Kudos
Message 1 of 12
(3,559 Views)

Sorry, to clarify: I'm also looking for a way to read in a long column of data from a .txt file without using the "Read from Measurement File" express VI

0 Kudos
Message 2 of 12
(3,555 Views)

Search the examples for file input and output. There is a read lines from file function that should do what you need. Search the forums for some examples also.

0 Kudos
Message 3 of 12
(3,550 Views)

That vi gives me a string, what I am looking for is a way to import this data directly as a 1D array.

 

Thanks.

0 Kudos
Message 4 of 12
(3,547 Views)

Since you have a text file (.lvm file), you can't read the file in direct binary form because the data simply isn't stored that way. The numbers are stored as ASCII characters, which means you have to read them as ASCII characters and then convert them to numbers.

0 Kudos
Message 5 of 12
(3,544 Views)
So how exactly is that done? My numbers are in a column, not tab or comma delimited Thanks
0 Kudos
Message 6 of 12
(3,540 Views)

Attach your data file and we'll take a look. There are numerous functions to convert strings into numbers of various formats.

Message 7 of 12
(3,532 Views)

Does your file have more than one column? How are rows and columns separated in your file?  You need to specify more than just that the data is in a column in a text file.

 

Lynn

Message 8 of 12
(3,519 Views)

Sorry, I meant to specify that there is only one column. I have attached a similar data file. My file has the same structure, but has about 2m entries.

 

 

0 Kudos
Message 9 of 12
(3,506 Views)

Use the Number of Rows and Offset inputs and the Mark after Read output to get a segment of your array.  Put it into a loop until finished or until maximum amount of data you can handle at one time is in memory.

 

Lynn

Message 10 of 12
(3,494 Views)