LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Convert number into a 4 digit HEX string

Solved!
Go to solution

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" 🙂

0 Kudos
Message 1 of 3
(3,557 Views)
Solution
Accepted by topic author Stef_vl

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 Smiley Tongue


Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
If you don't hate time zones, you're not a real programmer.

"You are what you don't automate"
Inplaceness is synonymous with insidiousness

Message 2 of 3
(3,553 Views)

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 Smiley Tongue


Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
If you don't hate time zones, you're not a real programmer.

"You are what you don't automate"
Inplaceness is synonymous with insidiousness

0 Kudos
Message 3 of 3
(3,553 Views)