Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I program Instrument I/O Assistant with a serial device using binary/hexadecimal commands?

I would like to write a serial (RS-232) device driver using the LabVIEW 7 Instrument I/O Assistant. However, the device requires binary/hexadecimal commands which do not seem to be supported by the Instrument I/O Assistant. How can I do this easily?
0 Kudos
Message 1 of 5
(3,708 Views)
Hello Wasy,

You can include escaped characters like "\06" (without quotes) in your command strings in the Instrument IO Assistant and it will send the value 0x06 to the serial port. You can also use VISA read/write to do this directly in LabVIEW. Note that there is currently an issue with sending a NULL character via the Assistant; if you need to send NULL "\00" characters, use VISA directly.

Hope this helps.

Scott B.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 5
(3,708 Views)
Scott,

I tried sending the command "CA 00 01 20 00 DE" by using "\CA \00 \01 \20 \DE" in the Instrument I/O Assistant as per suggestion and it still did not work. (I have verified serial communications with another application).

Melissa
0 Kudos
Message 3 of 5
(3,708 Views)
Melissa,

I'm sorry for the confusion! To use the backslash codes, you must convert to decimal rather than using hex. This seems to be an undocumented feature that I stumbled across earlier using the Instrument IO Assistant. Hope this helps.

Scott B.
Applications Engineer
National Instruments
0 Kudos
Message 4 of 5
(3,708 Views)

Does not seem to work for me with the write command...can anyone help?

 

0 Kudos
Message 5 of 5
(3,157 Views)