I am trying to read a binary file and the number of bytes to be read is 320x240x2 (153600). But I must read them as uint16 which should limit it to 65535.
I have tried to do 320*240 as uint16 and the result is 11264. Do you understand why?
How can I do to read this file without being limited and use a byte stream type of uint16 when i read it?
Solved! Go to Solution.
What does the number of bytes to read have to do with the representation of the data in the file? The answer is nothing so you don't have a problem.
I really don't understand what you mean by 'result is 11264'.
320*240 = 76800 = 65536 +11264
Count the bytes in I32, which is what most LabVIEW indexes use. Interpret the values of the data as U16 if that is appropriate for your application. The Read from Binary File function has a datatype input to simplify the conversions. If the data is in the form of arrays, read the detailed help carefully for information about size of the arrays.
I understand now why 11264... i didn't notice it at all. If i don't read the file as uint16 (with the Read from binary File function), all my values change and are wrong.
Count the bytes in I32, which is what most LabVIEW indexes use. Interpret the values of the data as U16 if that is appropriate for your application.
This works perfectly!
Thank you Lynn!