
169
Part 4 Commands
1.8 Program Control
GOTO (Jump)
Command, declaration
Extension condition
(LD, A, O, AB, OB)
Input condition
(I/O, flag)
Command,
declaration
Operand 1
Operand 2
Output
(Output, flag)
Optional Optional GOTO Tag
number
Prohibited CP
[Function] Jump to the position of the tag number specified in operand 1.
(Note 1)
A GOTO command is valid only within the same program.
(Note 2)
Do not create a program containing an indefinite loop of continuous movement commands
(refer to Chapter 4 in Part 4) using the TAG-GOTO syntax. It will result in an accumulation
of coordinate conversion errors.
[Example 1]
TAG
1
Set a tag.
:
:
:
GOTO
1
Jump to tag 1.
Using a GOTO command to branch out of or into any of the syntaxes listed below is prohibited.
Since the maximum number of nests is defined for each conditional branching command or subroutine call,
a nest will be infinitely repeated if an ED
is not passed, and a nest overflow error will generate. In the
case of palletizing setting, an error will generate if the second BGPA is declared after the first BGPA
declaration without passing an EDPA.
(1) IF
or IS
and EDIF syntax
(2) DW
and EDDO syntax
(3) SLCT and EDSL syntax
(4) BGSR and EDSR syntax
(5) BGPA and EDPA syntax
TAG (Declare tag)
Command, declaration
Extension condition
(LD, A, O, AB, OB)
Input condition
(I/O, flag)
Command,
declaration
Operand 1
Operand 2
Output
(Output, flag)
Prohibited Prohibited TAG Tag
number
Prohibited CP
[Function]
Set the tag number specified in operand 1.
[Example 1] Refer to the section on GOTO command.
170
Part 4 Commands
EXSR (Execute subroutine)
Command, declaration
Extension condition
(LD, A, O, AB, OB)
Input condition
(I/O, flag)
Command,
declaration
Operand 1
Operand 2
Output
(Output, flag)
Optional Optional EXSR
Subroutine
number
Prohibited CP
[Function] Execute the subroutine specified in operand 1.
A maximum of 15 nested subroutine calls are supported.
(Note)
This command is valid only for subroutines within the same program.
[Example 1]
EXSR
1
Execute subroutine 1.
:
:
EXIT
BGSR
1
Start subroutine 1.
:
:
:
EDSR
End subroutine 1.
[Example 2]
LET
1
10
Assign 10 to variable 1.
EXSR
*1
Execute the content of variable 1 (subroutine 10).
BGSR (Start subroutine)
Command, declaration
Extension condition
(LD, A, O, AB, OB)
Input condition
(I/O, flag)
Command,
declaration
Operand 1
Operand 2
Output
(Output, flag)
Prohibited Prohibited BGSR
Subroutine
number
Prohibited CP
[Function]
Declare the start of the subroutine specified in operand 1.
[Example 1] Refer to the section on EXSR command.
(Note)
Using a GOTO command to branch out of or into a BGSR-EDSR syntax is prohibited.
173
Summary of Contents for X-SEL PX
Page 1: ...Operation ManualSeventh Edition X SEL Controller PX QX Type Tenth Edition ...
Page 2: ......
Page 8: ......
Page 14: ......
Page 410: ...383 Appendix 386 ...
Page 452: ...425 Appendix 5 428 ...
Page 559: ......