LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

can't synchronize the rs232 transmit/receive buffers

Using the most primative LabView serial interface, I have no trouble synchronizing the rs232 communication buffers in my application. A simple dummy read at the start of my I/O routine flushes the read buffer and writes and reads proceed in an orderly, logical fashion.
 
However, when I try the VISA "primitives", the situation isn't nearly as nice. Synchronization between successive writes and reads is lost and flushing the read buffer appear problematic. The serial ports are com1 and com2 of a standard (Dell) PC and the operating system is Windows 2000.
 
I suspect the problems is the operating system making decisions about how to buffer the I/O ports.
 
Is it possible to use the VISA primitives reliably?
 
DE
dehrenberg@multiplexInc.com
0 Kudos
Message 1 of 4
(2,991 Views)

just a guess: VISA read terminates via termination character, so your buffer isn't empty. You can disable this function or read the buffer until bytes at port is zero.

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 2 of 4
(2,984 Views)

Henrik, I always combine the VISA read operation with a byte count from the interface, i.e. ask how many bytes are available, then read them.

This still will not get the interface synchronized. The situation inproves if I ask and them read the input buffer repeatedly before starting the "real" I/O operation, but I can still lose synchronization.

DE

dehrenberg@multiplexInc.com

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

have you checked if your read termination setup?

To make shure the buffer is empty with VISA read I use this structure with an additional shiftregister for the values.

 

But there is also the VISA flush buffer.vi that will do it.

If you can provide more information on the data stream you want to sync to I might give you some hints how to solve this task.

 

Message Edited by Henrik Volkers on 07-20-2006 10:16 AM

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 4 of 4
(2,964 Views)