LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Comunicating by hex

Hi!

 

I am trying to read information from a PCB by using RS232 and a DB9 port. The PCB recieves data packages of 5 bytes and I have five different comandos (1 byte each) to send.

The comandos need to be in Hex code, how do I do to send these? do I need to send the comands together and how do I do that?

I have tried a couple of variations but nothing works.. 

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

Have you done a search for hex and serial? There must be hundreds of posts on this subject.

 

The quick answer is that you have several ways. You can use a U8 array and the Byte Array to String, you can use a single U* and typecast it to a string, you can use a string set for Hex Display (right click and select).

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

Hi!

 

Thanks but I'm just wondering if it is ok to send the different comandos all at the same time together in one string with Hex display, or do I need to send five different VISA write comandos?

0 Kudos
Message 3 of 4
(2,354 Views)

That depends on the instrument. The VISA Write does not care. If you have to have separator between the commands (i.e. a CR or LF) then add that.

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