Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Reading and Writing Files

Reading and Writing Files

Reading and Writing Files

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.

RE: Reading and Writing Files

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.

RE: Reading and Writing Files

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?

RE: Reading and Writing Files

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)?

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login


Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close