G Mode Functions
Chapter 8
GPIB-232CT User Manual
8-20
© National Instruments Corp.
xon - Change Serial Port XON/XOFF Protocol
Type:
Serial Port Configuration function
Syntax:
x
on [booltx][,boolrx]
<CR>
Purpose:
You
use
xon
at the beginning of your program when your
serial device uses the XOFF/XOFF protocol.
xon
allows the
GPIB-232CT to communicate over the serial port using the
same protocol as your serial device.
Remarks:
The
argument
booltx
specifies whether to enable the
XON/XOFF protocol when sending data out on the serial port.
When
booltx
is enabled, the GPIB-232CT monitors its
serial receive buffer for XON/XOFF characters as it sends
data over the serial port. If it receives the XOFF character
(decimal 19 or <CTRL>s), it immediately stops sending data.
When it receives the XON character (decimal 17 or
<CTRL>q), it begins sending data again.
The argument
boolrx
specifies whether to enable the
XON/XOFF protocol when receiving data over the serial port.
When
boolrx
is enabled, as the GPIB-232CT receives data
over the serial port, it sends XOFF over the serial port (if its
serial port recive buffer is almost full). This tells the sender to
stop sending data. When the GPIB-232CT has room to safely
receive more bytes, the GPIB-232CT sends XON over the
serial port. This tells the sender to begin sending data again.
Use XON/XOFF if your serial device does not recognize the
hardware handshake protocol, and you are transferring large
amounts of data at high speeds. Without it, you are in danger
of overflowing the serial port receive buffers of the
GPIB-232CT and the serial device. Refer to your serial
device's documentation to see if it uses a hardware handshake.
Why would you want to enable the protocol in one case and
not the other? Some serial devices use XON/XOFF protocol
when transmitting data but not when receiving. In this case,
you might configure the GPIB-232CT using the second
example.