[3] Authorization to access communication channel
Each communication channels have authorization control mechanism independent
of each other. Application program has to get authorization to use a channel
by calling rs_open() function, before using the serial communication
interface. If the channel is already occupied by CNC control program or any
other task, that channel can neither be opened by rs_open() nor used. It is
allowed for the application program to use two channels at the same time.
Also, two channels can be used simultaneously if one is used by application
program and the other by CNC control program. But , while CNC control program
is using serial interface, generally whole CPU resources are dedicated to the
program, so that the execution of the application program will be stopped.
When a communication channel is opened by rs_open(), the state of the signal
ER becomes ON to announce external device that the channel is ready for
communication. While ER is ON, connecting or detaching the communication cable
should not be done so as not to give damage to the hardware.
When a communication channel is closed by rs_close() function, the channel
is released and becomes free for other tasks, and the signal ER becomes OFF.
[4] Flow control
Two flow control methods are supported: one uses hardware signals (CS,ER)
for handshaking and the other uses DC code for it ( referred to as "hardware
flow ctrl" and " DC code flow ctrl" respectively). Following parameters can
be selected.
Hardware flow ctrl none, bi-directional
DC code flow ctrl none, bi-directional, transmit only,
receive only
Usually one of the following combination is selected.
Hardware flow control DC code flow control
-----------------------+-----------------------+--------------------
Flow control yes yes
Hardware flow ctrl bi-directional none
DC code flow ctrl none bi-directional
(Note) When "none" is selected for hardware flow ctrl, RS signal becomes
always ON.
When "DC code flow ctrl" is selected, data transmission is controlled by the
DC codes as follows.
(1) Transmission handshake
Stop or restart sending data, according to the DC code received from
destination device.
DC1 received : restart sending data is requested
DC3 received : stop sending data is requested
Received DC code is not passed to the application program.