LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sending Binary data using ASCII

Hello All,

 

 

I'm trying to control serial-interface instrument using NI-VISA with a set of ASCII codes, but the instrument reads/sends binary data only. What should I do so that the ASCII codes I send are converted into binary commands for the instrument to read, and that the data I receive is converted back into ASCII?

 

Thanks in advance

 

M

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

Hi M,

 

first you should define the words "binary commands/data". Then you should know: ASCII is binary too...

 

You may work with an U8 array. You can easily convert strings to U8 arrays and vice-versa!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(2,572 Views)

sorry, I meant to write bytes

0 Kudos
Message 3 of 4
(2,541 Views)
ASCII is bytes. You are still very unclear. As already mentioned, you can create a U8 array. Discussed in hundreds of other threads are other options; Typecast, String control/constant set for hex display, etc.
0 Kudos
Message 4 of 4
(2,538 Views)