FX Series Positioning Controllers
Program format 5
5-48
5.10.3
FNC02 (CALL): Subroutine call, FNC03 (RET): Subroutine return
5.10.4
FNC04 (JMP): Unconditional jump
FNC 02
CALL
Applicable models
Series name
16-bit operation
3 steps : CALL
Remarks
Applicable
devices
and basic
format
FNC 02
CALL
S·
S·
Pointers used for CALL instructions should
not be used for JUMP instructions.
FX
2N
-10GM
FX
2N
-20GM
Drive
input
Subroutine call/Subroutine return
Call
destination
FNC 03
RET
1 steps : RET
No applicable devices
Do not nest more than 15 levels of CALL
instructions from subroutines called by a
CALL instruction.
FNC 03
RET
The subroutine
program whose
No. is equivalent
to is executed.
S
·
The program from the label
to the RET instruction is
regarded as a subroutine
program.
: Pointers P0 to P127 (in the 10GM)
P0 to P255 (in the 20GM)
FNC 02
CALL
P 100
P 100
X02
N300
m02
END
FNC 03
RET
Progam
end
Subroutine
program
➁
➀
When FNC 02 (CALL) instruction is driven, program execution
jumps to the line marked with label P100 (Operation
➁
).
The subroutine program that starts at P100 is executed, then
program execution returns to the former line No. N300 by FNC
03 (RET) instruction (Operation
➀
).
The program from label (P) after m02 (m102 for a subtask) to
FNC 03 instruction is regarded as a subroutine program.
·
·
·
FNC 04
JMP
Applicable models
Series name
16-bit operation
1 steps
Remarks
Applicable
devices
and basic
format
FNC 04
JUMP
S·
S·
Pointers used for CALL instructions should not
be used for JUMP instructions.
FX
2N
-10GM
FX
2N
-20GM
JUMP
Drive
input
Unconditional jump
JMP
Jump
destination
Program execution jumps to the label specified by
without regard to condition.
S·
: Pointers P0 to P127 (in the 10GM)
P0 to P255 (in the 20GM)
•
When FNC 04 (JMP) instruction is driven, program execution jumps
unconditionally to the line marked with label P40.
FNC 04
JMP
P 40
P 40
N400
N410
Label
If this instruction is skipped by another JUMP instruction, this
instruction is not executed.
·
·
Summary of Contents for FX2N-10GM
Page 1: ...HARDWARE PROGRAMMING MANUAL FX2N 10GM FX2N 20GM ...
Page 4: ...FX Series Positioning Controllers ii ...
Page 6: ...FX Series Positioning Controllers iv ...
Page 46: ...FX Series Positioning Controllers Introduction 1 1 34 MEMO ...
Page 76: ...FX Series Positioning Controllers Wiring 3 3 24 MEMO ...
Page 222: ...FX Series Positioning Controllers Operation Maintenance and Inspection 8 8 18 MEMO ...
Page 256: ...FX Series Positioning Controllers Program Examples 9 9 34 MEMO ...