LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with hex conversion

Hello community,

 

I am using a infrared thermometer which is connected through the serial control. To change the emissivity I have to send a special command, e.g. emissivity 0,95 needs the command (HEX) 84 03 B6. 0h84 is the command and 0h03B6 is the emmissivity 0,95 * 1000 in hex.

 

When I use a string control which is set show hex everything works fine.

 

Now I want to programmatically change the emissivity. For that I have to join the command 0h84 and the new value.

The problem is, that I get a string which contains the right hex values, but I have to convert this string into hex string - I mean the same values as if I set a strin control to show hex.

 

Does anyone have an idea?

 

Thanks a lot and best regards.

Michael

0 Kudos
Message 1 of 4
(2,806 Views)

Hi Michael,

 

It sounds like you just need to cast the binary data to a string to send it.  We can do this with the flatten to string function.  Please find an example attached, is this what you were after?

 

Regards,

James Mc
========
Ask me about Rust & NI Hardware
My writings are at https://www.wiresmithtech.com/devs/
0 Kudos
Message 2 of 4
(2,797 Views)

Hi Michael,

 

It sounds like you just need to cast the binary data to a string to send it.  We can do this with the flatten to string function.  Please find an example attached, is this what you were after?

 

Regards,

James Mc
========
Ask me about Rust & NI Hardware
My writings are at https://www.wiresmithtech.com/devs/
Download All
0 Kudos
Message 3 of 4
(2,796 Views)

here we go

 

tohex.png

 

Kudo wellcome 😉

 

EDIT: not fast enough... 🙂

 

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 4 of 4
(2,795 Views)