Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial input buffer overflow using VISA 2.01

I'm using VISA 2.01 drivers for serial communications on a WinNT platform. Received data looks fine for the first 1500 characters but then looks like characters are dropped. I'm using viRead() and letting it timeout. I haven't had any problems looking at the data running Hyperterminal (no dropped characters). The PC is a Pentium I, the baud rate is 9600, and there is no flow control. I find it hard to believe the buffer is overflowing at 9600 baud unless the VISA overhead is really high. Thanks in advance.
0 Kudos
Message 1 of 2
(3,369 Views)
Jeff,

I found an article in the Developer Exchange that may be very helpful. It is titled "Serial Communication Starting Point" and the link to it is http://zone.ni.com/devzone/devzoneweb.nsf/Opendoc?openagent&93FD9F2AD3D0641E8625682100067F39.

I think the answer you are looking for is in the Common Problems section. It suggests using the Bytes At Serial Port VI to check the port and see how many bytes are in the buffer and then wire in the number of bytes into the read vi. They also suggest using a sequence structure to ensure that all data will be written completely before it is read.

Some other discussion exchange entries have the following suggestions:

1) Set the serial input end mode attribute to 0. The attribute/property name is either "ASRL End In" or "S
erial End Mode for Reads".
2) Use the "VISA Set I/O Buffer Size" function in the VISA Interface Specific subpalette. This will let you set the receive and/or transmit buffer size.
3) "Most likely you have termination char at your data sequence. So you need to set property of Message based settings->Termination char and Termination char enabled. This hopefully should switch VISA to read the whole data string up to termination char.
If this is not so, do VISA read sequentially in a loop until get the all desired data or reach timeout. See online help for VISA functions and VISA manuals for details."

Those ideas are from http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RNAME=ViewQuestion&HOID=50650000000800000008150000&ECategory=LabVIEW.LabVIEW+General "VISA Serial Read Problem."

Check out the Serial Communication Starting Point article for more in-depth information.

Good luck!
Shannon Rariden
Applications Engineer
National Instruments
0 Kudos
Message 2 of 2
(3,369 Views)