Instrument Control (GPIB, Serial, VISA, IVI)

キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

Serial Port Read Problems

I am getting conflicting results from the VISA read driver for an RS232 COM port.
The device that I am monitoring is 38400 Baud , 8 data bits , Odd Parity .
 
The COM port settings are also set accordingly.
 
I first read the number of bytes available , then use this number as the number of bytes to read.
The output field for bytes read, in the VISA read driver , usually matches the input field for number of
bytes to retrieve. However , often the VISA driver reads less bytes then what is requested.
 
For example :  The number of bytes available = 75 ->  I request to read 75 ->  The VISA reads only 8 bytes.  
 
Also, once I noticed that the VISA read driver actually read more bytes then requested:
 
The number of bytes available = 146 ->  I request to read 146 ->  The VISA reads 152 bytes!
 
I am runnning LV 7.0 on a Win 2K system.
 
Any ideas on what could cause this discrepancy? Could  FIFO overload in the UART be causing this?
 
 
   
0 件の賞賛
メッセージ1/3
3,534件の閲覧回数
I don't think I've ever seen VISA read more bytes than requested but if you're using the default VISA Configure Serial Port, that could account for reading a lesser count. The default setting is that the termination character is enabled. Wtih it enabled, VISA Read will terminate when the number of bytes is read OR the termination character is detected. The default termination character is 0xA or the linefeed character. If this character is in the receive string, you will terminate the read. Try turning Enable Termination Character to false.
メッセージ2/3
3,529件の閲覧回数
What version of the VISA driver are you using?
Logan S.
0 件の賞賛
メッセージ3/3
3,516件の閲覧回数