From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial - Visa Write doesn't work, Visa Interactive Instrument I/O Asst Do?

I'm trying to communicate with a Laser (to have it fire) through the serial port. The laser code "SH 1\r" works from the Visa Interactive tool as well as from the Instrument I/O Assistant, but not from Labview when I'm using VISAWrite. Any ideas as to what I'm doing wrong? (I've checked to ensure that the baud rate, stop bits, etc... are all OK with the serial port). My only question is perhaps I have to give the command in a different format with VISAWrite than I do with the Visa Interactive (eg give "SH 1\r" with Interactive but "SH 1" with VISAWrite?). Does VISAWrite require the carriage return?


Thanks for any help, Russ
0 Kudos
Message 1 of 3
(3,044 Views)
When you use VISA Write, in order to append the carriage return, the string control or constant should have \Codes Display turned on. If you don't and type something\r, then it will transmit the \ character and then the r character when you really want to transmit a control character. Other ways to do it is concatanate your command string with the carriage return constant on the string pallete or to modify the VISA Configure Serial Port to add the Serial End Mode for Writes>TermChar and specify the termination character
Message 2 of 3
(3,044 Views)
Dennis - THANK YOU! One of those beginner mistakes (that's my excuse, anyways). Would have never found this one though...

Russ
0 Kudos
Message 3 of 3
(3,044 Views)