LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

read file

Hello,
 
I have a vi that do the acquisition of thermocouples and various sensors. The vi acquire the signals of every sensors and store them in a file. When the acquisition is over, I would like to read this file and process the data (for example, I need to add an offset to the thermocouple). After having finish with the processing of the data, I would like to save this new file under a different name, so that at the end, I have two files, one with raw data and the other one with processed data.
 
There is something I don't understand with the "read file" sub vi and the refnum. My 2nd file is empty.
 
Any hints? Cheers 
 
Marc
 
 
0 Kudos
Message 1 of 4
(3,113 Views)

Hello

Sorry I sent the wrong file, here's the correct one, but that doesn't work... 😉

 

Marc

0 Kudos
Message 2 of 4
(3,113 Views)
In the second frame, you close the file that you were writing to. In the second fram, you try to read without opening it again. Have you probed the output of the read in this frame to see if you are getting any data? You should really get rid of all those local variables and sequence structures. It would make the code easier to read, debug, and maintain. You should also have automatic error dialogs turned on since you haven't wired up all of the error in/error out connections. Of course, if you did wire them all up, you might actually get an error message that you could use to determine the problem.
0 Kudos
Message 3 of 4
(3,102 Views)

Hi buvman,

I had trouble reading your code and really did not understand what was happening right off the bat.  Since i had invested alot of time figuring out the code, i rewrote/simplified it.  It is not intended to be used, but to looked at as an alternative design pattern for that acquire and log VI.  The traditional "old school" task VI's were the most difficult for me get a grip on. Fairly complicated.  By the way, you do not have to read and rewrite the file to apply scaling.  If you required two files (Raw and scaled) then write them both at same time.

 

Also i think there was an error on the read VI because a zero constant was used.  But then again i never use binary files.

Chris

Message 4 of 4
(3,092 Views)