# LabVIEW

cancel
Showing results for
Did you mean:

Solved!
Go to solution

## Why a multiplication of 2 uint16 is limited to 11264 ?

Hi,

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?

Thanks!

Message 1 of 4
(1,407 Views)

## Re: Why a multiplication of 2 uint16 is limited to 11264 ?

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'.

Message Edited by Dennis Knutson on 06-19-2009 08:40 AM
Message 2 of 4
(1,404 Views)
Solution
Accepted by topic author christophe69000

## Re: Why a multiplication of 2 uint16 is limited to 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.

Lynn

Message 3 of 4
(1,398 Views)

## Re: Why a multiplication of 2 uint16 is limited to 11264 ?

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!

Message 4 of 4
(1,388 Views)