Amos Professional Manual  Contents  Index

Accessing a Serial Port


Here is a list of the available settings for the Parity parameter:

-1 No parity
0  Even parity
1  Odd parity
2  Space parity
3  Mark parity

This Parity bit may be set using the BSET or BCLR instructions, as follows:

X> P=0 : Bset 0,P: Rem Odd parity
   Bclr 1,P : Rem Normal parity
   Serial Parity 1,P : Rem Set parity using the value in P

SERIAL X
instruction: set handshaking system of serial channel
Serial X Channel number,Xmode

This command is used to enable or disable the XON/XOFF handshaking system, which checks data transmission. A value of -1 (True) will disable the system, whereas any other value will turn it on. The Xmode parameter should be loaded with the correct control characters, which must be specified in the following format:

X> Xmode=XON110000000+XOFF*$1000

Sending and receiving Serial information

SERIAL SEND
instruction: output a string via a serial channel
Serial Send Channel number,string

This is used to send the given string directly to the selected serial channel, without waiting for the data to be transmitted through the actual port. This means that the SERIAL CHECK function must be used to detect when the transmission of data has been completed, and this is explained below.

SERIAL OUT
instruction: output a block of raw data via a serial channel
Serial Out Channel number,address,length

This command is identical to SERIAL SEND, except for the fact that it works with raw data, instead of a string. Specify the channel number as usual, followed by the address in memory of the data to be transmitted, and the length of the data given in the number of bytes to be sent.

SERIAL GET
function: get a byte from a serial device
value=Serial Get(Channel number)

To read a single byte from a serial device, use the SERIAL GET function and specify which channel is to be examined. If no data is available, a value of -1 will be returned.

Back    Next
10.04.03