SERIAL

SERIAL N

CREATES A SYSTEM OBJECT SERIAL AND ALLOCATES IT NUMBER N AS REFERENCE

  • Type: Command
  • Parameter: 1
  • Group: System Objects Creation

ACTION

The command SERIAL N creates a system object SERIAL, and allocates it a number N. The number N will be used to designate the SERIAL.

The created SERIAL can then be used through the appropriated commands.

A SERIAL is a mean for the user to handle a serial link.

A SERIAL can generate the event : ON_RECEIVE.

SYNTAX: SERIAL N

  • N = system object number (integer or real). Must be greater than 0 and less than or equal to the allowed maximum number of system objects.

USE

  • A SERIAL is used to manage a serial link.

ERROR

  • If number N is not a correct expression.
  • If number N is greater than 10.
  • If number N is less than or equal to 0.
  • If number N is already used for a system object number.

EXAMPLE

label received

rem create object for serial link

serial 1

rem configuration of serial link

serial_port 1,3

serial_baudrate 1,1200

serial_databits 1,8

serial_stopbits 1,1

serial_parity 1,0

serial_open 1

rem if data received

on_receive 2,received

rem transmission

serial_write 1,"A"

end

received:

print serial_read$(1)

return

SEE ALSO

SERIAL_PORT

SERIAL_BAUDRATE

SERIAL_STOPBITS

SERIAL_DATABITS

SERIAL_PARITY

SERIAL_OPEN

SERIAL_CLOSE

SERIAL_WRITE

ON_RECEIVE

SERIAL_PORT_EXISTS()

SERIAL_READ$()