LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

missing help section for "Boolean array to number"

While Playing around with this, I noticed that "Boolean array to number" has a right-click option for the sign extension mode.

 

For some reason these options are not explained or described anywhere in the help. In fact, some of the statements in the help depend on the sign extension mode setting and are thus probably not always correct. I would say this is a decumentation problem and should be fixed.

 

(reported here).

0 Kudos
Message 1 of 6
(3,416 Views)

Hi Altenbach,

 

Thanks for bringing this up. CAR 402163 is targeted toward fixing this in the LabVIEW help.

 

Best Regards,

 

Nathan Burke

Product Support Engineer | LabVIEW R&D

Message 2 of 6
(3,320 Views)

I know I can help make sure your problem, but it is an issue I do not understand why I'm following this topic.

 

good work.

 

 

 

 

 

 

 

Technology and the internet is my hobby Love nicom. tv
0 Kudos
Message 3 of 6
(3,237 Views)

I was searching for help for this "Sign Extension Mode" option and stumbled upon this post. I still couldn't find any help document regarding this, and I will mention what I understood regarding this. Before that, I need to mention about the output representation option in "boolean array to number" function.

 

Its not easy to set the output data type for the "boolean array to number" function (by default it is U32) - We currently need to go to properties dialog box for this(as below).

Data Type for Boolean to Array.png

 

It would be good to have it directly in the right click menu, like we have for numeric terminals.

 

Numeric Data Representation.png

 

As I didn't find any help document for the "Sign Extension Mode", here goes what I understood(for others who might stumble on this topic)

 

Sign Extension Modes:

Sign Extension Modes.png

Never - There is no sign bit in the boolean input array. All elements of the boolean array refer to the digits of the number, including the last element of the boolean array(which is the MSB bit).

If Output Is Signed(default) - The usage of MSB bit for sign, will depend on the output representation(currently in the "Properties" window of the boolean array to number" function). If the representation is unsigned(like U32), there is no sign bit. If the output representation is signed(like I32), the MSB is a sign bit.

Always - The MSB(last element in boolean array) always represents the sign bit, with the rest of the elements in the boolean array representing the digits of the number.

 

 

------
Using LabVIEW since 2012. Certified LabVIEW & TestStand Architect
Message 4 of 6
(3,025 Views)

@Karthik_Abiram wrote:
Never - There is no sign bit in the boolean input array. All elements of the boolean array refer to the digits of the number, including the last element of the boolean array(which is the MSB bit).

If Output Is Signed(default) - The usage of MSB bit for sign, will depend on the output representation(currently in the "Properties" window of the boolean array to number" function). If the representation is unsigned(like U32), there is no sign bit. If the output representation is signed(like I32), the MSB is a sign bit.

Always - The MSB(last element in boolean array) always represents the sign bit, with the rest of the elements in the boolean array representing the digits of the number.


This explanation is incomplete. The sign extension mode indicates what happens in the upper bits of the output integer when the input boolean array contains fewer values than there are bits in the output. Integers are represented using the 2's complement system; there is no "sign bit." When the value is signed, the most significant bit does indicate the sign of the value, but flipping that bit does not result in the negation of the original value. Please read about the 2's complement system. I wrote an explanation the sign extension modes here:

http://forums.ni.com/t5/BreakPoint/LabVIEW-Minutiae-that-may-bite-you-someday/m-p/2367608#M22707

Message 5 of 6
(2,977 Views)

Thanks Nathand, I didn't know that.

------
Using LabVIEW since 2012. Certified LabVIEW & TestStand Architect
0 Kudos
Message 6 of 6
(2,949 Views)