5
Categories and Use of Basic Application Instructions
DVP-PM Operation Instruction
5-18
API Mnemonic
Operands
Function
01
CALL P
Call Subroutine
Controllers
20PM
10PM
OP Range
Program
Steps
P0 ~ P255
CALL, CALLP: 3 steps
Operands:
S
: The destination pointer P of the call subroutine
Explanations:
1. When the CALL instruction is active it forces the program to run the subroutine associated with the called pointer
2. P cannot be modified by index register V, Z.
3. The subroutine designated by the pointer should be programmed after M102, M2 and SRET instructions.
4. The number of pointer P, when used by CALL, cannot be the same as the number designated by CJ, CJN and
JMP instructions.
5. If only CALL instruction is in use, it can call subroutines of the same pointer number with no limits on the times.
6. CALL instruction is not allowed to be used in subroutines.
API Mnemonic
Function
02
SRET Subroutine
Return
Controllers
20PM
10PM
OP Descriptions
Program
Steps
N/A
No operand. No contact to drive the instruction is required
SRET: 1 steps
Explanations:
SRET indicates the end of subroutine program. When SRET is executed, program execution will automatically return
to the address after CALL instruction in O100 main program.
Program Example 1:
When X0 = ON, the CALL instruction will jump to P2 and run the subroutine. With the execution of the SRET
instruction, it will jump back to address 24 and continue the execution.
X0
X1
CALL
P2
Y1
20
24
Y0
Y0
Call subroutine P2
Subroutine P2
Program example 2:
1.
When the rising-edge contact X20 is triggered, CALL P10 instruction will transfer execution to subroutine P10.
2.
When X11 is ON, execute CALL P11, jump to and run subroutine P11.
3.
When X12 is ON, execute CALL P12, jump to and run subroutine P12.
Содержание DVP-10PM
Страница 1: ......
Страница 45: ...2 Hardware Specifications and Wiring DVP PM Application Manual 2 30 MEMO...
Страница 125: ...3 Functions of Devices in DVP PM DVP PM Application Manual 3 80 MEMO...
Страница 341: ...8 Application Examples DVP PM Application Manual 8 2 Trajectory 3 Trajectory 4...
Страница 427: ...9 Electrical CAM DVP PM Application Manual 9 74...
Страница 437: ...10 Encrypting User Program DVP PM Application Manual 10 10 MEMO...
Страница 458: ...11 G code Application DVP PM Application Manual 11 21 B O100 main program...
Страница 561: ...14 Appendix DVP PM Application Manual 14 4 MEMO...