Why does ActiveTwoClient pad with zeroes?

Post Reply
jswag
Posts: 2
Joined: Mon Sep 27, 2010 4:27 am
Location: NZ

Why does ActiveTwoClient pad with zeroes?

Post by jswag » Mon Sep 27, 2010 4:34 am

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

Coen
Site Admin
Posts: 910
Joined: Fri Mar 26, 2004 7:00 pm
Location: Amsterdam, Netherlands
Contact:

Post by Coen » Mon Sep 27, 2010 11:04 am

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)

jswag
Posts: 2
Joined: Mon Sep 27, 2010 4:27 am
Location: NZ

Post by jswag » Tue Sep 28, 2010 2:44 am

Ok, thanks for the help.

Post Reply