08-05-2013 04:24 AM
Hi all,
I struggling with the following:
I read a 64-bit boolean array from a device. This boolean array represents a varying collection of numbers, either signed or unsigned.
I have the composition of the array, i.e. bit 1-15 is a signed 16-bit integer, bit 16-23 is an unsigned 8-bit integer and so on...
So I can divide the boolean array into the corresponding bit-arrays to convert them to numbers. For unsigned numbers I simply use the "boolean array to number" function and that works fine (output is a U32).
Now here's the problem: This does not work for signed integers... the output of the "boolean array to number" function is always an U32, even if I select "sign extension mode"=always from the context menu of the function, so a negative value can never be extracted.
Any suggestions of how to solve this? I've tried typecasting but I can't get it to work.
Regards,
PJ
Solved! Go to Solution.
08-05-2013 04:29 AM - edited 08-05-2013 04:30 AM
08-05-2013 04:29 AM
Just right-click the "Boolean Array To Number" primitive, select Properties. On the Output Configuration tab, set the desired representation.
08-05-2013 04:31 AM
DOH!
Thank you very much!
I overlooked that.
PJ.