Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reading and Writing Files

Status
Not open for further replies.

AFloriani

Industrial
Jun 16, 2005
14
Another one: (LabView 7.1)

I'm trying to write a file containing 3 lines with 3 numeric data.
I've tried using the Express Write LVM File, and it creates the file allright (without headers and with time column). But when I try to read from it, it returns an error saying that The File has invalid data. The file LabView wrote himself!
Then I'm tried not using the Express VI and make the write function with other VIs (opening the file, writing/reading it and closing) but it doesn't work as well.

I simply want to read and write a binary file containig 3 numeric values. This should be simple. Please help, I know beginners make a lot of "stupid" questions, but we have to learn somehow.

Thanks in advance.
 
Replies continue below

Recommended for you

How are you trying to read the LVM file? It is in ascii text format, not binary.

Wheels within wheels / In a spiral array
A pattern so grand / And complex
Time after time / We lose sight of the way
Our causes can't see / Their effects.

 
I've configured de Write LVM File Express VI with the following settings:

- Save to one file
- Overwrite file
- No headers
- Empty time column
- Delimiter: TAB

And put an array created with the Build Array VI in the signals input.

---------------------------------------------------------
For reading it, I've configured the Read LVM File Express VI with the following settings:

- Retrieve segments of original size
- Relative to start of measure
- Read generic text files
- Delimiter: TAB
- Start row of numeric data: 1
- First column is time channel
- Decimal point: dot

And using an Index Array VI to read each element to a different variable using 3 constants (0, 1, 2) as it only stores 3 values.

With this configuration I solved the invalid data problem. But now it gives me another error:

"LabView: End of file encountered
---
NI-488: Invalid argument or arguments"

Any ideas?
 
The End of File error occurs after I take the first read, what means the Express VI is not restarting from Begin of File (BOF) on the next read but from the position it left the file on the first time.

How do I do to "Reset" the Read LVM File Express VI to start reading from BOF every time it is executed (as it does not have a Reset input)?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor