LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

write waveform to binary file

Solved!
Go to solution

Hello!!

 

I am trying to store a waveform in a binary file.  I am using a "write to binary file" labview example as a guide.  My waveform is a simulated waveform from the labview express menu "simulated waveform".  Well, if I put a graph indicator, I can to see the waveform.  But when I plot a binary file, the waveform look very bad.  Please, see the attachment.  I am using the Nyquist theorem, which say that the sampling rate must to be 4 times the frecuency.

Please, if anybody knows about, post it.

 

Thanks 

 

 

0 Kudos
Message 1 of 4
(4,255 Views)
Solution
Accepted by topic author nomade42k
Your problem is related to different endian format. That will say how the byte order in the number are organized. Do this. In the toolbar select help, and enable context help. Then place your mouse over the "Binary File Function" and select detailed help in the help window. Look for byte order


Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
Message 2 of 4
(4,248 Views)
What does mean active veteran????, Thank you so much for your help.
0 Kudos
Message 3 of 4
(4,236 Views)

You're exporting in little-endian binary format (which is fine, it's MATLAB's native format in Windows) but reading as big-endian (the 'b' modifier in the fopen command string). Delete the 'b' or change it to 'l' (lower case letter L).

 

Also, when I tried recreating your VI I found that there appears to be a header of 8 bytes even if prepend array size is set to false. If you can't get rid of it, read in a dummy variable of 8 bytes (or 4 doubles) and read the next sequence of data.

Download All
0 Kudos
Message 4 of 4
(4,214 Views)