LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I have an error while reading Binary file

 
0 Kudos
Message 1 of 8
(4,114 Views)

And we have problems reading the body of your question. 🙂

What's the error? How are you reading the binary file? What's in the binary file? Do you know the datatype and byte order?

Could you attach a small sample file and the code you are using?

0 Kudos
Message 2 of 8
(4,108 Views)
 Sorry some server problem was there so the text is missing
 
      The VI is below i am writing data in DBL format
Download All
0 Kudos
Message 3 of 8
(4,102 Views)
Hi AutoTec,
there is no error, if you look into the created file, you will see that  for every empty string in the array there will be stored one size information, i.e. zero as a 32-bit value. The first four bytes is the length information of your first string (stored in little endian format) followed by the six bytes of the actual string.
If you want to store only the strings, wire the 2D- array to a "concatenate string" node (only one input), this converts it to a single string with all empty strings removed. If you want to keep the empty strings and the dimensional size of the array in a human readable manner, use the "array to spreadsheet string" VI.
Hope this helps,
greets, Dave

Message Edited by daveTW on 07-04-2007 12:13 PM

Greets, Dave
0 Kudos
Message 4 of 8
(4,093 Views)
       sorry i have attached the correct files where i am getting error while reading the binary file i have attached both Write Binary and Read binary file with Error  message pls do clarify
0 Kudos
Message 5 of 8
(4,084 Views)
So could this be a cross posting to this? Maybe you find the answer there.
greets, Dave
Greets, Dave
0 Kudos
Message 6 of 8
(4,079 Views)
 This is the attached VI i am using to write the binary data and the same i am reading
0 Kudos
Message 7 of 8
(4,078 Views)

All you need is to look at the online help for "read from binary file" . Specifically:

"If count calls for an array of elements and the specified data type is an array, the function automatically returns a cluster of arrays or cluster array because LabVIEW does not allow arrays of arrays."

Could that be it?

Basically, you are writing multiple 2D arrays, each with size information, at each iteration of the loop. You can't just read it as one single 2D array later and expect it to interpret the binary data correctly.

0 Kudos
Message 8 of 8
(4,066 Views)