Serial Port Functions SECTION 6 Functions and Methods
115
6-18-3 CloseCOMPort
Description
Closes the designated serial communications port on the PC. The port must
have been configured and opened before it can be closed.
Syntax
ReturnState = CloseCOMPort(PortNumber)
Remarks
Typical Example:
bState = CloseCOMPort(1)
6-18-4 OpenCOMPort
Description
Opens the designated serial communications port on the PC for transmitting or
receiving data. The port must have been configured before it can be opened.
Syntax
ReturnState = OpenCOMPort(PortNumber)
Remarks
Typical Example:
bState = OpenCOMPort(1)
6-18-5 SetupCOMPort
Description
Configures the designated serial communications port on the PC for
transmitting or receiving data.
Syntax
ReturnState = SetupCOMPort(PortNumber,
ConfigurationString, HandShaking, TerminationChar,
ControlCharFlag, TermMode)
Remarks
Argument Type Description
ReturnState bool True if successful else false.
PortNumber Integer The number of the port previously configured
using the function SetupCOMPort and opened
with OpenCOMPort.
Argument Type Description
ReturnState bool True if successful else false.
PortNumber Integer The number of the port previously configured
using the function SetupCOMPort.
Argument Type Description
ReturnState bool True if successful else false.
PortNumber Integer A string indicating the desired Baud rate,
Parity, number of data bits and stop bits.