G71: Conditional Jump; G72: Subroutine Jump - Omron CS1W-MC221 - 02-2008 Operation Manual

Motion control units
Table of Contents

Advertisement

G-language Commands

7-3-24 G71: CONDITIONAL JUMP

Format
Operands
Description
Programming Example

7-3-25 G72: SUBROUTINE JUMP

Format
Operands
Description
424
If A1000=1 on the 20th execution in loop A, the program would jump to block
N100. The remaining value of 80 jumps in the number of loops would be
cleared and the number of loops would be set to the new value of 50 for block
N100.
Jumps to the specified block when the condition is met.
G71_<jump destination block number>/<condition equation>
The following table shows the possible settings for the operands.
Operand
Destination block number
Condition
First term
equation
Operator
Second term
This command jumps to the specified block when the given condition is met.
The "!" operator is the inequality operator (not equal to). The first and second
terms will be compared as real numbers, even if registers are specified.
The following example shows repeating until A1000 = 10.
:
N008
G91
N009
G63
N010
G00
N011
G60
N012
G71
:
In this programming example, 0 is substituted for A1000 in block N009 and
then incremented by 1 in block N011 after the positioning operation in block
N010. At N012, the program jumps back to N010 and repeats blocks N010 to
N012 while A1000 10. The program proceeds when A1000=10.
Calls the specified subroutine.
G72_<subroutine number>
The following table shows the possible settings for the operands.
Operand
Subroutine number
This command calls and executes the specified subroutine. Subroutines can
be nested five times. An error will occur if a sixth subroutine is called.
If the position data number is specified for the subroutine number, the subrou-
tine stored in the position data will be called and executed (indirect calling).
A no program error will result if the position data does not satisfy the following
condition.
500
Position data
Possible settings
N000 to N999
A0000 to A1999
E00 to E31
=, <, >, or !
A0000 to A1999
E00 to E31
39,999,999
:
A1000=0
X500
A1000=A1000+1
N010/A1000 ! 10
:
Possible settings
P500 to P999
A0000 to A1999
999
Section 7-3

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cs1w-mc221Cs1w-mc221-v1Cs1w-mc421Cs1w-mc421-v1

Table of Contents