Chapter 5
S Mode Functions
© National Instruments Corp.
5-63
GPIB-232CT User Manual
xon - Change Serial Port XON/XOFF Protocol
Type:
Serial Port function
Syntax:
x
on [booltx][,boolrx]
<CR>
Purpose:
You
use
xon
at the beginning of your program to configure
the GPIB-232CT to communicate over the serial port using
the same XON/XOFF 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.
If the argument
booltx
is a 1, 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 will immediately stop sending
data. When it receives the XON character (decimal 17 or
<CTRL>q), it begins sending data again.
If you want to send a data string that may contain a <CTRL>s
or <CTRL>q, you must disable
booltx
.
The argument
boolrx
specifies whether to enable the
XON/XOFF protocol when receiving data over the serial port.
If the argument
boolrx
is a 1, and the GPIB-232CT is
receiving data over the serial port, it sends XOFF over the
serial port (if its serial receive buffer is almost full). This tells
the sender to stop sending data. When the GPIB-232CT serial
port receive buffer 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.
You should use XON/XOFF when your computer or terminal
does not recognize the hardware handshake protocol, and you
are transferring very large amounts of data (greater than the
serial port buffer size). Without it, you could be in danger of
overflowing either the GPIB-232CT or your computer's
internal buffer.
When would you want to enable the protocol in one case and
not the other? Some computers use XON/XOFF protocol
when transmitting data but not when receiving data. In this