11/25/96
➆
6270 Programming Tips
87
COMEXS1
:
Upon receiving a stop input or stop command, motion will decelerate at the preset
AD
/
ADA
value, program execution will pause, and all commands following the
command currently being executed will remain in the command buffer.
Resuming program execution (only after motion has come to a stop):
Whether stopping as a result of a stop input or Stop (
!S
or
!S1111
)
command, you can resume program execution by issuing an immediate
Continue (
!C
) command or by activating a pause/resume input (a general-
purpose input configured with the
INFNCi-E
command—see
COMEXR
discussion above).
If you are resuming after a stop input or
!S1111
command, the move in
progress will not be saved.
If you are resuming after a
!S
command, you will resume the move in
progress at the point where the
!S
command was received by the processor.
COMEXS2
:
Upon receiving a stop input or stop command, motion will decelerate at the preset
AD
/
ADA
value, and program execution will be terminated, but the
INSELP
value
is retained. This allows external program selection, via inputs defined with the
INFNCi-B
or
INFNCi-iP
commands, to continue.
Program Flow Control
Program flow refers to the order in which commands will be executed, and whether they will
be executed at all. In general, commands are executed in the order in which they are received.
However, certain commands can redirect the order in which commands will be processed.
The
GOTO
command is a branch without a return to a group of commands. The
GOSUB
command is a compact way to execute a group of commands starting with a
DEF
command and
ending with a
END
command, then proceeding with the command following the
GOSUB
.
GOTO
and
GOSUB
require program names or labels as destinations and both can be used either
unconditionally or as part of
IF
,
REPEAT
, or
WHILE
commands. The
L
and
LN
pair is a
convenient way to execute a group of commands a pre-determined number of times without
having to repeat those commands.
The
WAIT
command suspends program flow until the specified condition is met. A variety of
conditions can be waited on, including input patterns, time, move complete, and others.
Unconditional Looping and Branching
Unconditional
Looping
The Loop (
L
) command is an unconditional looping command. You may use this command
to repeat a series of commands. You can nest Loop commands up to 16 levels deep.
Command
Description
> PS
Pauses command execution until the 6250 receives an
Immediate Continue (
!C
) command
MAØ
Sets unit to Incremental mode
A5Ø
Sets acceleration to 50 rps2
V5
Sets velocity to 5 rps
L5
Loops 5 times
D2ØØØ
Sets distance to 2,000 steps
GO1
Executes the move (Go)
T2
Delays 2 seconds after the move
LN
Ends loop
!C
Initiates command execution to resume
(The motor moves a total of 10,000 steps.)