Serial Port Functions SECTION 6 Functions and Methods
114
6-18 Serial Port Functions
6-18-1 InputCOMPort
Description
Sets the serial communications port for receiving ASCII text messages. Any
message received is placed in the text point. The boolean flag is set true to
indicate that a message has been received. It is up to the user to reset this
flag between receiving messages in order to indicate that a new message is
present. This function need only be called once to receive multiple messages
every time the termination character is recieved.
Syntax
ReturnState = InputCOMPort(PortNumber, Message,
MessagePresent, MaxLength)
Remarks
Typical Example:
bState = InputCOMPort(1, Msg, bTransmission)
6-18-2 OutputCOMPort
Description
Sends an ASCII text message out through the designated serial
communications port.
Syntax
ReturnState = OutputCOMPort(PortNumber, Message)
Remarks
Typical Example:
bState = OutputCOMPort(1, Msg)
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.
message Text Text point to hold ASCII text message received
through the port.
MessagePresent Bool Boolean point indicating that a message has
been received.
MaxLength Integer Optional. Maximum length of transmission
before input is terminated. Used where fixed
length packets are received without termination
characters.
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.
message Text Text point to hold ASCII text message to send
through the port.