LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read binary incorrectly

Solved!
Go to solution

Hi,

 

I made a vi to read a tiff file as binary.

But I found that the total bytes read by my vi alwas lacks 15 bytes.

I have checked the total bytes with other binary editor (e.g. hex fiend and 0xOD).

 

Does anyone know why this issue happens?

I attached my vi and the tiff image I tried to read.

Download All
0 Kudos
Message 1 of 3
(2,912 Views)
Solution
Accepted by topic author Xiang00

Xiang00 a écrit :

Hi,

 

I made a vi to read a tiff file as binary.

But I found that the total bytes read by my vi alwas lacks 15 bytes.

I have checked the total bytes with other binary editor (e.g. hex fiend and 0xOD).

 

Does anyone know why this issue happens?

I attached my vi and the tiff image I tried to read.


You have a tiff file you shouldn't read it as a text file to count the number of bytes. You are probably losing bytes in the conversion to ASCII). Use Get File Size.vi (from File I/O - Advanced File Functions palette) to get the total number of bytes or use Read From Binary File.vi (set the count input to -1 to read all bytes) and connect a U8 constant to the data type input to count the number of bytes as in the vi you posted (using array size).

 

Ben64

Message 2 of 3
(2,888 Views)

>Ben64

Thank you very much for your prompt reply. What you suggested solved my problem.

0 Kudos
Message 3 of 3
(2,876 Views)