NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How can i convert a decimal value to it's binary representation in TestStand?

How can i convert a decimal value to it's binary representation in TestStand. Let's say we have a variable that has a value of 14. What can i make to change this number to it's binary representation? (1110). Is There something like a Typecast that i can use?
0 Kudos
Message 1 of 2
(5,848 Views)
What do you need to do with it? If you want a numeric variable to display with a binary format, select Properties>>Numeric Format>>Type>>Binary (uncheck Show Radix Prefix). If you want to get the binary representation of a number in a string, assign it in an expression like locals.string = Str(locals.num, "%b"). If you want to pass the actually binary bits to a dll parameter, that is what TestStand does already.

Note that when you enter a number in a variable value or an expression, you can use a radix prefix. For example you could type 10, 0xA, or 0b1010.
Message 2 of 2
(5,848 Views)