Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

minimizing the "between character" serial write delays

I am using the Labview example VI for "one at a time" character writing in order to use RS232 serial communication between Labview 2009 student edition and a Keithley 6430 using a non-NI usb to serial wire.  I can send all VISA commands without problems (configure serial, VISA write, VISA read)  as long as I use a certain delay time between characters being written.  At 9600 baud, I need 120 ms between characters and at the maximum baud rate for the Keithley, 57600 baud, I need to use 11 ms between characters in order for the Keithley 6430 to not give a invalid command header error.  

 

Now using standard SPCI commands, even in their 4 character forms, I quickly get enough lines of commands that it takes 5-10 seconds for the VISA write to finish because of all these delays. No speed problems reading data back though. 

 

My question is this: Is there a way to eliminate the need for the delay time between characters being written, besides increasing the baud rate? Or is this a limitation of serial communication with this device?

 

Thank you very much, 

0 Kudos
Message 1 of 4
(3,734 Views)

kfd182 wrote:

 

I can send all VISA commands without problems (configure serial, VISA write, VISA read)  as long as I use a certain delay time between characters being written


I have never heard of needing to do that with any Keithley instrument. I've certainly never seen it with any Keithley instrument I've ever used. I think something else might be going on here. Are you using the driver for that instrument

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

No I'm not using the driver.  When I unzip that file, all it has is library of VIs for controlling the different function of the Keithley.  My understanding of  "using the driver" is the process of making a new, custom VI that wires together the VI's from the Keithley download as sub VIs.  Maybe my understanding of using drivers is wrong?  

 

All in all, I would be happy just sending simple SPCI commands that I know work directly with VISA write and not having to use a delay between characters.  The reason I am suspecting this delay time to be the problem is that if I go below a certain value (ie below 120 ms at 9600 baud), basic commands such as *IDN? return only error messages (sometimes in labview and sometimes on the Keithley front panel). Labview error messages that I can remember are something about a "framing error" and Keithley error messages "invalid command header".  I got this idea of putting the delays in from a ni.com help page discussing how to make a serial instrument that works in hyperterminal also work in labview.  

 

 

0 Kudos
Message 3 of 4
(3,724 Views)

You have the right idea about using the driver. I just took a look at that driver and, unfortunately, it appears to have been coded to use the GPIB functions rather than VISA. Thus, there's no easy way to use it for serial.

 

Framing errors are almost always related to incorrect serial port settings (such as wrong baud rate, stop bits), or some hardware issue, like a bad cable, or noise on the cable. The description of your problem leads me to suspect that your non-NI USB<-->Serial converter is flaky. Have you tried it with something else?

0 Kudos
Message 4 of 4
(3,706 Views)