
397
Appendix
14. How to Use Subroutines
Description
When the same processes are performed several times in one program, a group of these steps that are
isolated from others and called together as a set is called a “Subroutine.” Subroutines are used to reduce
program steps and make the program less convoluted. Up to 99 subroutines can be used in one program.
Subroutine calls can be nested by up to 15 times.
How to Use
The following commands are used to declare/call subroutines:
EXSR Call subroutine
BGSR Declare start of subroutine (declaration of start a group of steps)
EDSR Declare end of subroutine (declaration of start of a group of steps)
Example of Use
Note
Using a GOTO command to jump out of a subroutine to TAG outside the subroutine is prohibited.
Subroutine
The same tasks are
consolidated into one location.
398
Appendix
15. Pausing of Operation
Description
Use a declarative command HOLD to pause the moving axis via an external input.
How to Use
You can interrupt and pause the movement of the axis (= cause the axis to decorate to a stop) by
declaring a HOLD command in the program. While HOLD is input, all movement commands issued in the
same program are paused (all moving axes decelerate to a stop).
Example of Use
HOLD 20
Declare that if general-purpose input 20 turns ON, a pause process will be performed.
Application
In addition to an input port, you can also specify a global flag in operand 1 of the HOLD command. It is
also possible to implement a pause from other program using a global flag.
When operand 2 is used, you can select a desired pattern of input signal as well as a stopping pattern.
0 = Contact a (Deceleration to a stop)
Same as when operand 2 is not specified
1 = Contact b (Deceleration to a stop)
2 = Contact b (Deceleration to a stop, followed by servo OFF
Drive power is not turned off)
Note
If the axis was paused during home return, when the operation is resumed the home return sequence will
be performed from the beginning.
Input port 20 ON
Input port 20 OFF
Axis stops
Remaining
operation
Time
Spee
d
SVOF input: 20 = Contact b
400
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: ......