Q.
How can RS-232C ports be used?
A.

Decimal BASIC inherits the settings for COM-ports from those on the Control Panel of Windows.

Decimal BASIC Ver. 7.0.3 or later allows an OPEN statement to include communication parameters.
The format is as follows.
OPEN #1:NAME "COM1:9600,n,8,1,x"
OPEN #1:NAME "COM1:9600,n,8,1,p"
The meaning of each parameter, which is separated by a comma, is as follows.

first Baud rate
second   Parity, n(none), e(even), or o(odd)
third Data bit length, 7 or 8
fourth Stop bit length, 1, 1.5, or 2
fifth Flow control, x (xon/xoff)or p (hardware handshake)

Receiving is done with a buffer.
You can check the byte length of data received in the buffer using
ASK #n CHARACTER PENDING n

Virtual COM-ports, which are not RS-232C devices, can also be used.
Port numbers greater than 10 are available too.

You must agree the line-end code with the opposite. It can be done as follows.
SET #n ENDOFLINE CHR$(13)

 
Back