Reference Manual - Table of Contents Serial Ports Command Summary:
SerialOpen port#, baudrate, parity, databits, stopbits
SerialClose port#
SerWrite port# , text$
SerSet port#, baudrate, parity, databits, stopbitsFunction Summary:
var = SerialCheck( port# )
var = SerialAvail ( port# )
var$ = SerRead ( port# )
SerOpen port#, baudrate, parity, databits, stopbits
This command opens a serial port for usage and sets the data transmission parameters. You should you this command before accessing data with a serial port.
port# - This a numeric value that specifies
which serial port to use.
1 = Modem Port
2 = Printer Port
baudrate - This is a numeric value that specifies one of the following options to specify data transmission rate:
300, 600, 1200, 1800, 2400, 3600, 4800, 7200, 9600, 19200, or 57600
parity - This is a numeric value that specifies one of the following option to specify data parity:
0 = No Parity
1 = Odd Parity
2 = Even Parity
databits - This is a numeric value that specifies one of the following options to specify the number of databits:
5, 6, 7, or 8
stopbits - This is a numeric value that specifies one of the following options to specify the number of stopbits:
1= 1 Stopbit, 2= 2 StopBits, 3= 1.5 Stopbits
SerClose port#
This command closes a serial port.
port# - This a numeric value that specifies
which serial port to use.
1 = Modem Port
2 = Printer Port
SerWrite port# , text$
This command writes the characters in a string out to the specified serial port.
port# - This a numeric value that specifies
which serial port to use.
1 = Modem Port
2 = Printer Port
text$ - This a string of one or more characters to be written to the specified serial port.
SerSet port#, baudrate, parity, databits, stopbits
This command sets the transmission parameters for the specified serial port.
port# - This a numeric value that specifies
which serial port to use.
1 = Modem Port
2 = Printer Port
baudrate - This is a numeric value that specifies one of the following options to specify data transmission rate:
300, 600, 1200, 1800, 2400, 3600, 4800, 7200, 9600, 19200, or 57600
parity - This is a numeric value that specifies one of the following option to specify data parity:
0 = No Parity
1 = Odd Parity
2 = Even Parity
databits - This is a numeric value that specifies one of the following options to specify the number of databits:
5, 6, 7, or 8
stopbits - This is a numeric value that specifies one of the following options to specify the number of stopbits:
1= 1 Stopbit, 2= 2 StopBits, 3= 1.5 Stopbits
var = SerCheck( port# )
This function returns a numeric value indicating if a serial port is available to open. A return value of 0 means the port is not available, a return value of 1 means the port is available to use.
port# - This a numeric value that specifies
which serial port to use.
1 = Modem Port
2 = Printer Port
var = SerAvail( port# )
This function returns a numeric value representing the number of characters (or bytes) that are available to be read from specified serial port. Use the SerRead function to read data from the serial port.
port# - This a numeric value that specifies
which serial port to use.
1 = Modem Port
2 = Printer Port
var$ = SerRead( port#, numOfChars )
This function returns a string containing data read from an open serial port.
port# - This a numeric value that specifies
which serial port to use.
1 = Modem Port
2 = Printer Port
numOfChars - This a numeric value that specifies the number of characters to be read from a serial port. If there this value is greater than the number of characters actually available from the serial port then all data from the port will be read. If this parameter is set to 0 (zero) then all characters avaiable will be read.