03-20-2006 03:35 AM
03-20-2006 04:17 AM
Would it help to employ hardware handshaking (RTS/CTS) to control the flow of the RS-232 communication, or is this something that you are already doing? It is a fairly common technique for controlling large data transfers whilst only using relatively small port buffers. Does the Keithley Multimeter support this handshaking?
JR
03-20-2006 04:23 AM
03-20-2006 10:40 AM
CTS / RTS works better than Xon / Xoff, you need the extra wires in your serial cable though. With Xon / Xoff, you're using characters in the data stream and if you're sending non-ASCII sooner or later you'll get burned by seeing your data stream grind to a halt because an Xoff char was detected. Plus, the Xon / Xoff "skids" to a stop because the chars have to be assimilated and recognized by software. With CTS / RTS, the data stream starts / stops at the UART level. Heck, for all I know, modern UARTS are able to do Xon / Xoff in hardware but I suspect they don't.
The Keithly may well have an IEEE-488 (GPIB) interface included.
GPIB inherently is able to handle this problem by manipulating the three wire handshake that tranfers each byte. The "not ready for data holdoff" works just fine to throttle back an incoming data stream.
You have to spend the extra $ for a GPIB controller, and there are limits on data rates and cable lengths, cabling costs, etc., but that bus is designed for instrument control and it's tried and true. It's how NI got into business in the first place.
Lately I see more and more people trying to implement with serial control only - and it has a bunch of limitations, and you often wind up spending a bunch of money for extra serial ports - why not buy a GPIB controller? I've seen incredible wastes of time trying to get funky USB / rs-232 dongles to work, com port cards that break when hyper-threading is enabled, etc.
03-21-2006 01:42 PM
Are you calling OpenComConfig() to access the serial port and configure the input buffer? What size are you trying to set the buffer too? 4096 is actually the smallest queue size that windows NT/2000 will normally allow and if you did not specify a queue size, or let it default to the 512 that CVI trys to use, that is what you would get. Depending on the serial driver installed on your system it should at least allow around 32K. If you need more than you can get with the default CVI serial buffer and windows serial driver just attach a callback to the serial port. In the callback remove the data and place it into a thread safe queue. They work very well at very large data sizes.
03-21-2006 02:26 PM
03-22-2006 12:55 AM