Chapter 7
G Mode Functions — spset
©
National Instruments Corporation
7-9
spset
Change Serial Port Parameters
Type
Serial port function
Syntax
spset [baud] [parity] [databits] [stopbits]
<CR>
Purpose
You can use
spset
at the beginning of your program to set the GPIB-232/485CT-A serial port
characteristics (baud rate, parity, data bits, and stop bits) to match those required by your
serial device.
Remarks
The argument
baud
is a numeric string specifying the baud rate (300, 600, 1200, 2400, 4800,
9600, 19200, 38400). The argument
parity
is a character specifying the parity (
e
for even,
o
for odd,
n
for none). The argument
databits
is a character specifying the number of data
bits (7 or 8). The argument
stopbits
is a character specifying the number of stop bits
(1 or 2). If you call
spset
without an argument, the GPIB-232/485CT-A returns its current
serial port configuration.
Until you call
spset
, the following characteristics are in effect: 9600 is the baud rate, parity
is disabled, 8 is the number of data bits, and 1 is the number of stop bits.
If you must reconfigure the GPIB-232/485CT-A serial port, wait until communication with
the serial port is not taking place.
The assignment made by
spset
remains in effect until you call
spset
again, call
onl
, or you
turn off the GPIB-232/485CT-A.
Example 1
'Set up the serial port of GPIB-232/485CT-A to
'keep its current baud rate, current parity,
'and to use 7 data bits and 2 stop bits.
WRT$="spset 7 2"+CHR$(13)
CALL IBWRT(GPIB232%,WRT$)