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

I have to send hexadecimal commands to a sony evi-d100 cam. The command must be a hex string. But the cam accept only commands which are displayed in hex.

This works great with constant strings. But for my project I need to transmitt also variable strings. I can convert these variable values to a hex string but thy arent shown correctly in a hex display. e.g. I have the value 100 (decimal) convert it into hex is 64. But the value shown in the string hex display is always 3634. And this isnt accepted by my cam it should be 64 .

But why does it works with string constants?

 

Thanks for help

 

Mark

 

 

0 Kudos
Message 1 of 16
(4,071 Views)
Do you mean you will input decimal and you want a hex output?
0 Kudos
Message 2 of 16
(4,062 Views)
yes I have a decimal input and ouput must be a hex string with must be in a hex display.
0 Kudos
Message 3 of 16
(4,052 Views)

Hello Mark, there is no big difference between constant strings and string controls. If it works with constants, it must also work with controls.

You wrote: "The command must be a hex string". As I understand it, the correct command string shown in Normal Display should look as the correct hex value (ex: "64").

If you later change the display to Hex Display, you will see the hex representation of the "6" character (36) and of the "4" character (34). Hence what you saw in the control. If the camera doesn't accept it, probably the correct command string is NOT a hex string (in the way I understood it).

Hope this helps.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 4 of 16
(4,047 Views)

Another question.

 

 

In your constant strings - the ones that do work - have you selected them to be in NORMAL display mode or HEX display mode.  By that I am meaning to right click on the constant, and say whether normal or hex has the tick.

 

Rod.

 

0 Kudos
Message 5 of 16
(4,031 Views)
hex.PNG
0 Kudos
Message 6 of 16
(4,012 Views)

Ohh yes you are right, the correct command string is not a hex string, but a string with hex display. The input is a numeric variable .The numeric variable must be converted to hex and then the value shown in a string with hex display. If I take a string constant as input it works great. If I take the numeric variable e.g. 30; 30 should be shown in the strin with hex display, but there is 3330.

In the attachement is an example of my problem.

 

0 Kudos
Message 7 of 16
(4,008 Views)
the constant strings are in hex display mode.
0 Kudos
Message 8 of 16
(4,006 Views)

 

example.jpg

 

 

0 Kudos
Message 9 of 16
(4,003 Views)

sorry I mixed something up. The output for the cam command is not a hex string but a normal string with hex display mode.

 

Thanks for help.

 

Mark

0 Kudos
Message 10 of 16
(3,999 Views)