Specifications

CONFIG Commands - 5
CONFIG COM$
Tasking Statement
SYNTAX: CONFIG COM$ n,terminator,length,XON,echo
PURPOSE: To configure a communication port to interrupt when the programmed conditions are met.
REMARKS: The CONFIG COM$ statement is used in conjunction with the ON COM$ statement so that the
foreground program is interrupted when either a specific message length has been received or a
specified termination character has been received.
n = legal serial port number.
The terminator is equal to the termination character of the incoming string. This is normally a
carriage return (13) but it may be any character from 1 to 127. If you specify 0, CAMBASIC will
not test for a terminator.
In some cases there is no termination character. The length of the message is always the same. In
this case the length parameter should be set to the message length. The range is 1 to 127 characters.
If you specify “0”, CAMBASIC will not check for length.
The XON parameter enables or disables XON/XOFF protocol checking by the serial port. Setting this
parameter to ”1” enables the protocol, and setting it to “0” disables the protocol.
The echo parameter determines when the incoming characters are to be echoed. When a “1” is
specified, the characters are echoed. Characters are not echoed when the parameter is “0”.
See the Multitasking Chapters for more information.
RELATED: ON COM$, COM$
EXAMPLE: 10 CONFIG COM$ 2,13,0,0,0
This example configures COM2 so that the terminator is a carriage return. There is no length
checking, XON/XOFF protocol and no character echo.
ERROR: <Data negative> – for n,terminator,length,XON,echo
<Data out of range> –if n is not 1, 2 or 3; terminator or length > 127;
XON or echo > 1