Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

number of characters & serial Port read.vi

I am reading from a control system by am application that I am building, I am using the serial port for that, the problem is when I read using COM1 it doesn't matter if I put a huge nummber of characteres to read, it reads continuosly because this .vi is in a infinite bucle but if I use COM2 and if it recieves less bytes than I espicify in "bytes to read" it doesn't work untill it recieves more bytes. Why this difference? and How can I fix this?
0 Kudos
Message 1 of 2
(3,037 Views)
I've never experienced the difference in behaviour of the serial ports you describe, but to fix the byte-problem try using the "Bytes at serial port.vi" (under Functions> Intrument I/O> I/O compatibility> Serial compatibility) prior to the "Serial port Read.vi" and wire the output (amount of bytes) to the requested "bytes to read" terminal of the Serial Port read.vi. In that way, the amount of data read by the serial port should always match the amount of data actually present in the buffer. Hopefully that will help.
Message 2 of 2
(3,037 Views)