04-18-2012 03:38 AM
Hello,
I would like to know if it's possible to convert a number into a 4 digit HEX string.
Now I convert the number into an array with "build array", and that array I convert with a "byte array to string"
So that when I type in number 30, the string will show 1E (HEX, 2 digits).
But when I type in a number bigger than 255, it keeps showing FF (255)
If I make the "build array" bigger, and add an element, the string shows a 4 digit Hex number.
Now I would like to know how I can show that one number, bigger than 255 in the string with 4 digits.
So I actually need to split the number into 2 arrays before building the array, isn't it?
I hope you understand my purpose?
So when I type in "1235", I want a String that indicates "04E5" and not "FF" 🙂
Solved! Go to Solution.
04-18-2012 05:16 AM
The function you want to use is Number to Hexidecimal String. Set the width to 4
http://zone.ni.com/reference/en-XX/help/371361H-01/glang/number_to_hex_string/
By the way, 0x04E5 is decimal 1,253
04-18-2012 05:16 AM
The function you want to use is Number to Hexidecimal String. Set the width to 4
http://zone.ni.com/reference/en-XX/help/371361H-01/glang/number_to_hex_string/
By the way, 0x04E5 is decimal 1,253