LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with writting and reading binnary results - HELP!!!

Hello to everyone. I am new in LabVIEW (the last two weeks I am dealing with!) and I have the following problem:
In my project, I am trying to collect signals during a manufacturing process through photodiode and microphone, write them in a file and after that to analyse them.  So, I am writting the results in a binnary file (see attachment) and afterwards I use another vi to read and convert them to text file (see attachement).  The problem is that the results I get after reading the binnary file are verrrryyyyy strange: the signal is not continues and there are some extremelly high and small values!! 
 
I guess that the problem is in programming but I can't figure it out.  Attached you will find the two VIs, the first for collecting and writting results and the second for reading results and converting to text file. 
 
If anyone can help, I would appreciate it verrry much. 
 
Thanks in advance. 
astiger
0 Kudos
Message 1 of 16
(3,242 Views)

Hi astiger,

      Please try again to attach the files for us. Smiley Wink

"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
Message 2 of 16
(3,239 Views)
Sorry...
 
Attached the VIs...
 
 
astiger
0 Kudos
Message 3 of 16
(3,222 Views)
In your write file VI, you are writing a waveform datatype.  In the read file VI, you wired a Double precision constant to the data type in the read binary file function.  You basically have a type mismatch.  Try wiring a waveform constant to the Read Binary File.  That constant is used to tell the VI how to interpret the data that is in the binary file.
Message 4 of 16
(3,211 Views)

Dear Raven, thanks for your replay.  I made the same thought but, I could not find out which is the waveform constant for that case.  Do you have any idea on this?

 

Thanks,

astiger
0 Kudos
Message 5 of 16
(3,206 Views)

Go to the VI that writes the file.  Right click on the brown waveform wire and select Create Constant.  Select it and copy it to the clipboard.

Go to the Read File VI and paste.  Then wire up the constant to the Read Binary file function and try that.

Message 6 of 16
(3,194 Views)

Good idea but.... it doesn't work... Unfortunatelly....

astiger
0 Kudos
Message 7 of 16
(3,187 Views)
How doesn't it work?  Is there an error message?
 
Get rid of that Quotient Remainder function in your Read VI.  Just wire a -1 to the Binary read for number of bytes to read.
 
See attached.
Message 8 of 16
(3,177 Views)
Raven,
 
basically following your instructions when tring to read the bin file, I get an error (see attached error.jpg).  But based on your idea I though to modify the VIs in order to read the same type of data (see attached VIs).  Still I have some problems, i.e. that at the end of every set of samples that reads, puts a zero (see attached test.jpg)...
 
Any ideas why this happes and how to fix it???
Thanks,
astiger
Download All
0 Kudos
Message 9 of 16
(3,171 Views)

That's because you still don't have the waveform datatype wired up as a constant in your read VI.  You put it back as double.

Try these attachments.  The type coming out of the read binary file was an array of clusters.  And the cluster was the array of waveforms, so I had to do some gyrations to get the waveforms back out to wire to a waveform graph.

PS.  For your path controls in the Write VI, make sure you set the browse properties to new or existing.  You have it set for existing which means it won't let you create a new file).  Also, Replace or Create with confirmation on the File Open function which you have set as create.  This is conflicting.  The path control won't let you create a new file, but the Open file won't let you do anything but Create a file.  !!!!!Smiley Surprised



Message Edited by Ravens Fan on 02-22-2008 03:59 PM
Message 10 of 16
(3,162 Views)