LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Strange behavior when reading binary file

Solved!
Go to solution

I am trying to read a binary data as flattened. The file was saved as labview class that contained Array of waveforms and some other data. When I read the file with Read from binary file vi with class attached to data type, data is correct. But when I read data as flattened something strange happened (see attached image). The top two graphs shows correct data and the bottom two graphs shows partially correct data. When writing a code to read flattened data I followed instruction on http://zone.ni.com/reference/en-XX/help/371361H-01/lvconcepts/how_labview_stores_data_in_memory/ and http://zone.ni.com/reference/en-XX/help/371361H-01/lvconcepts/flattened_data/.

The most strange think is that there is discrepancy around 1,4 s (marked with red), but samples before and after match.

I have no idea what am I doing wrong.

I have LV2011.

Application is also attached.

 

 

 

Error.png

 

Code.png

0 Kudos
Message 1 of 4
(2,324 Views)
Solution
Accepted by topic author andrej

Assuming that you your decoding of the binary data is correct (i.e. that you have the data structure of the serialized class figured out) the problem is probably that you are not reading it as binary data, you are reading it as text using the read text file function....Change the file read fucntion to the binary one.

Message 2 of 4
(2,311 Views)

Thank you very much!

0 Kudos
Message 3 of 4
(2,307 Views)

Good catch! You have very accurate eyes Smiley Very Happy


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 4 of 4
(2,303 Views)