Page 1 of 1

Why does ActiveTwoClient pad with zeroes?

Posted: Mon Sep 27, 2010 4:34 am
by jswag
Hi,
I am not very familiar with Labview but from what I can determine the ActiveTwoClient tcp example pads the incoming numbers with zeroes at the least significant end. Why does it do this? Presumably it is creating a 32bit integer but by padding on that end isn't it creating a number that is 2^8 times greater than the number read from the socket? On the other hand if it padded on the most significant end it would cause problems with the negative numbers.

Could somebody explain what is going on?
Thanks

Posted: Mon Sep 27, 2010 11:04 am
by Coen
Your assumptions are correct: the extra zero byte is added to convert the 24-bit data to 32-bit integers; by adding a least significant byte, the MSB and sign remains the same. During scaling, you indeed need to include an extra factor of 256 (new LSB = 1/32 * 1/256 microVolt)

Best regards, Coen (BioSemi)

Posted: Tue Sep 28, 2010 2:44 am
by jswag
Ok, thanks for the help.