
B–62073E–2/03
4.CONVERSATIONAL MACRO FUNCTION
109
(5) Canceling data–receive wait (G335/G336)
In the conventional RS–232–C control by the conversational macro
function, the system remains in a wait state in the G335 block
(one–byte read function) until data is received from the external
device.
When data is not received within the time specified in the associated
parameter (8540), the wait state is canceled and completion code
#8539 is set to 200. Note that by setting the associated parameter
(8507#1), the cancel keys on the MDI/CRT panel can also be used to
cancel the wait state.
This function is also used to cancel the wait state during data
transmission (control code G336).
i) Example
O9000;
N1 G330 P101 B10 S12 C0; Line open
N2 IF [#8539 NE 0] GOTO 10;
N3 G335 P500; One byte read
N4 IF [#8539 NE 0] GOTO 11;
N5 G331; Line close
:
N11 G331;
G243 X0 Y1 (DATA INPUT ERROR);
:
During execution of the N3 block, if data is not received
within the specified time, the N3 block is terminated, the
program proceeds to the N4 block, then jumps to error
processing. At the same time, completion code #8539 is set
to 200.
By setting the associated parameter, the wait state at the N3
block can also be canceled using the cancel keys on the
MDI/CRT panel.
Note
When the parameter is set so that the MDI/CRT panel
cancel key is effective, the key can also be used to cancel
the data receive operation during line data reading by the
auxiliary macro function.
(6) Macro variable data input (G337)
G337 Pp ;
p : Number of the first variable where a macro variable is to be set
(omissible)
Input macro variable data is read via a RS–232–C line opened in the
read control mode, then is set in a specified variable.
The following tape format is used for macro variable data:
LF N––––P–––– LF P–––– LF %
Reader part
Input start
Variable number
Variable data
Tape end
%
All information present before the first LF on tape is ignored. Valid
information starts with the first LF and ends with a tape end code
(EOR).