LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem converting number to hexadecimal string

Solved!
Go to solution

Hi there,

 

for a serial communication I need to send code-bytes in a hexadecimal ascii string. When I use constants and send them via VISA to COM port it works fine, but if I use number converters it doesn't. Can anybody show me what I'm doing wrong?

 

deepearth

 

--------------------------------

Windows XP SP3, LV 8.5.1

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

Hi deepearth,

i think the attached image shows what you need. If you change your indicator to "Hex display" then it should show what you wanna send as hex, not in normal display.

 

Hope it helps.

Mike

Message 2 of 4
(2,629 Views)
Solution
Accepted by topic author deepearth

Since your string indicator is set to hex display, it seems you want a hexadecimal string, one byte/number.

 

(You are currently use a hexadecimally formatted string, consisting exclusively of the ASCII characters "0..F" at 2 characters/byte. This is not what you want!).

 

 

Here's another solution using typecast:

Message Edited by altenbach on 02-02-2009 12:44 AM
Message 3 of 4
(2,621 Views)

Hello altenbach,

 

thank you for your answer. This version works fine.

 

regards deepearth

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