LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

hexcode on serial

I have a problem with serial communication. I want to put hexcode directly onto the comport (RS232C), but VISA just converts my input to ASCII code. So instead of writing 0Ah (10 decimal) it writes the ASCII equivalent to 0 and A = 30 41. Is there a way to force it to send the original hexcode of 0A directly onto the comport?

/Mike
0 Kudos
Message 1 of 7
(3,785 Views)

@Mike_SWE wrote:
Is there a way to force it to send the original hexcode of 0A directly onto the comport?


Right click on your string control (or string constant on the block diagram).
Change from 'Normal' display to 'Hex' display.
Now when you type in 0A, it will be one byte (0Ah).

Message Edited by Donald on 05-18-2005 09:57 AM

=====================================================
Fading out. " ... J. Arthur Rank on gong."
0 Kudos
Message 2 of 7
(3,774 Views)
Use the CR and LF constants in the string function palette to send line terminators.
If you have other control characters, you may also use the Byte Array to String function.

Paolo
Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 3 of 7
(3,770 Views)
Thank you, the hexcode entered directly into the string control worked fine. But when I have hex strings concatenated into one string and then into the string control it converts it to ascii hexcode. I need it to keep the hexvalues. Please see attached program code (LV 7.1.1).

I am grateful for som pointers on how to solve this situation.

/Mike
0 Kudos
Message 4 of 7
(3,749 Views)
You are formatting your numbers to hex format. Instead, you need to typecast your numbers to a string.
0 Kudos
Message 5 of 7
(3,743 Views)
Message 6 of 7
(3,736 Views)
THX guys, you learn something new every day 🙂
0 Kudos
Message 7 of 7
(3,727 Views)