LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

convert variable values to hex and show them in a hex display

Solved!
Go to solution
you mean to say array to spread sheet doesnt solve your problem?
0 Kudos
Message 11 of 16
(1,217 Views)

 


The output for the cam command is not a hex string but a normal string with hex display mode

 

 

I am not getting what you want. Can you simply type what is the input you are going to give and what is your expected output?

0 Kudos
Message 12 of 16
(1,215 Views)
the input is numeric control, output is string indicator in hex display mode.
0 Kudos
Message 13 of 16
(1,211 Views)
Did you see message no:6 what modification do you want?
0 Kudos
Message 14 of 16
(1,205 Views)
Solution
Accepted by m4rk

OK, so what I see is that to get the device to see the number 100, you need to send it a string which appears as "64" if you are showing the string in hex display mode.  Can I also assume that the number you send must be less than 128?

 

If so, you should convert your integer to U8 (or change the control to be of representation U8, then pass it to a "type cast" with the top input of type cast being a string (an empty string is fine)

 

The output of type cast is a string one byte long, which for an input value of 100 will show as 64 on a string indicator which is set to hex display mode. The byte in the string is the binary representation of 100, which is "64" in hex, or "d" in ASCII (string in normal mode) This is the string to pass to your device in the same way that you pass the constant string.

 

Remember that setting the display mode of a string does not change what the stored value (the 1's and 0's) is. It only changes how the value is presented on screen for your viewing. You could set the display mode to password and the screen image will be a line of stars. That doesn't mean that the value has chnged, but simply that you have told LabVIEW to show you the value in a different way.

 

Rod.

 

PS. Sorry, can't post files/images

 

Message 15 of 16
(1,201 Views)

Thanks Rod it works.

the number is less 128 but it works with I16.

I know that changing the display mode doesnt alters the stored value, but if the display mode is something else than hex my cam wont do anything.

For another command I need to get the value from a numeric control in a string indicator with hex display mode (same thing like before just without hex convertion)

 

thanks for help

 

Mark

0 Kudos
Message 16 of 16
(1,177 Views)