
B–61803E–1/10
6. FUNCTIONS OF THE MACRO
EXECUTOR
PROGRAMMING
75
Example) Device and transmission control of channel 2
(DC2/DC4 automatic control)
Baud rate = 4800 b/s, Stop bit = 2, Even parity, ISO code output
G330 P22 B10 S22 C2 ;
IF [#8539 NE 0] GOTO 900 ;
Open processing end
N900 error processing :
(2) Circuit closing (G331)
G331 ;
The circuit, which is currently open, is closed.
There is no end code for the circuit closing processing.
It always ends normally.
(3) 1 byte reading (G335)
G335 Pp ; p : Reading variable number
Data 1 byte received through circuit is read into the variable area
specified.
The received data is stored in the reception buffer (128 bytes)
temporarily and is read one byte at a time by this control code.
When there is no reception data, end code 255 is sent.
If the reception buffer is nearly overflowing due to delay of reading
processing for the reception data, either of the following processing
is carried out according to the opening specification of control
method.
(a) In the case of user macro control
When overflow of the reception buffer is detected, the
transmission stop is requested to the target by the turning OFF of
control signal ”RS”.
Then, when there is an empty reception buffer area by reading,
the signal (RS) is turned ON, thus requesting the target device
to continue transmission.
(b) In the case of reading control (DC1/DC3 automatic control)
When overflow of the reception buffer is detected, the ”DC3”
code is output automatically, thus requesting the target device to
stop transmission.
Then, when there is an empty reception buffer area by reading,
the DC1” code is output, thus requesting the target device to
continue transmission.
(c) In the case of transmission control (DC2/DC4 automatic control)
When the circuit is opened in the transmission control mode, no
control of 1 byte reading is carried out (end code = 8).
Example)
N100 G335 P100;
IF [#8539 EQ 255] GOTO100;
IF [#8539 NE 0] GOTO900;
Reading processing ended
(#100: Received data)
N900 error processing