LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Writing data to file then reading using express VIs

Hello,
 
I'm attempting to do something relatively simple: writing strain gauge data to a measurement file (.lvm) and then reading and charting the written file.
 
However I have been getting the following error message when I try to do this:
 
"Error 100 occurred at Read From Measurement File -> StrainGaugeExample 1.vi
Possible reason(s):
LabVIEW:  File contains erroneous data. Normally for user data files."
 
Software specs are Labview 8.2 using w/ Daqmx 8.5. Hardware specs are compact-DaQ-9172 and NI 9237 strain gauge modules 
 
I have been acquiring strain data without using DaQ Assistant. Instead I am using code built around the NI example using shunt calibration at ftp://ftp.ni.com/pub/devzone/epd/4011.zip. I have however tried to do the same thing (write to file and read/chart the same file) using DaQ Assistant and have been successful. However use of the DaQ assistant is not an option for my application.
 
Another thing I have noticed is that the .lvm files have multiple headings. When I try to write to measurement file using the "one header only" or "no headers" options instead of the "one header per segment" option, there is no error. However the files don't appear to be being read and no data is charted.
 
An example of an unreadable measurement file and an example of the VI I am using to write and read the data is attached. (the .lvm file has been changed to a .txt file since it appears you cant attach .lvm files)
 
I would really appreciate if anyone had any idea why this was happening Smiley Happy
 
Cheers,
Thurston
Download All
0 Kudos
Message 1 of 5
(3,526 Views)
It seems that the Express Read VI only reads the first section of data.  The problem with your attached file is that there is no data in your first section, thus you get an empty graph.
 
The question I have for you about your application is why does it want to create several sections of data?  And why are some of those sections lacking data.
Message 2 of 5
(3,517 Views)
Thanks for replying Ravens.
 
That is exactly the question I'm looking for an answer to: Why does the VI write to multiple sections to the .lvm file. What would make a "DaQmx read" VI send a 1D waveform in multiple sections to a "Write to Measurment FIle" VI.
 
Thurston
 
0 Kudos
Message 3 of 5
(3,484 Views)
Hi Thurston,

In your Write to Measurement File Express VI, try configuring it to write with "No headers" under Segment Headers.  Then in your Read from Measurement File, configure it to "read generic text files".

Message Edited by JamesR on 10-23-2007 03:39 PM

Regards,

James R.
National Instruments
0 Kudos
Message 4 of 5
(3,464 Views)
Thanks for the suggestion James but no luck. I figure that the issue must be due to my dodgy daqmx VI usage further up the track so I gave up and used storage VIs instead which appear to work fine, so I guess there is no more problem Smiley Wink
 
Thurston
0 Kudos
Message 5 of 5
(3,405 Views)