dxy6406 Posted April 7, 2005 Report Share Posted April 7, 2005 Hello all, I am using a sub VI that produces a byte array. I use "Byte Array to String" and display this value using a string indicator. I also want to take the 1-byte hex number and display its numeric value. For example, 0xFF would produce 255. I tried type casting and using "Hexadecimal String to Number" but it does not seem to be working. Any help would be appreciated. Quote Link to comment
Rolf Kalbermatter Posted April 7, 2005 Report Share Posted April 7, 2005 Hello all, I am using a sub VI that produces a byte array. I use "Byte Array to String" and display this value using a string indicator. I also want to take the 1-byte hex number and display its numeric value. For example, 0xFF would produce 255. I tried type casting and using "Hexadecimal String to Number" but it does not seem to be working. Any help would be appreciated. 4475[/snapback] Well, display of a number in a miriad of formats is that, display only. The number itself does not change in memory at all. So what can you do? 1) Instead of displaying the byte array as a string array, configured to show hex format, you could directly display the byte array, click on the numeric in the array control and select "Visible Items->Radix" from the pop-up menu. Then click on the d that appears and select the numeric format you want to see. This will change how you see the number in the control but will do nothing to the numeric value itself. 2) Wire the byte array into a for loop with autoindexing enabled and use the apropriate To String formating function, either the Format into String with %d, or %x as formating specifier or one of the String Conversion functions such as Numbre To Decimal/Hexadecimal/Octal String. Rolf Kalbermatter Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.