Command
Description
Range
Min.
Max.
P
R
O
G
R
A
M
C
O
N
T
R
O
L
M40
* SUBROUTINE CALL
Call the subroutine program which begins at the designated step in a
file. Subroutine call must be ended by "M42" (return from subroutine).
When the program meets the command "M42", it returns to the main
program from the subroutine by "M40". The step to return is the next
step of "M40".
Successive subroutine calls are possible for 3 times, if over then the
motion stops and error message ("SUB-CALL OVER 3 ") is displayed.
0
95
[Example]
Main program
Subroutine program
File Step Code
Data
Description
00
03
G00
+10000
Move +100.00 mm
00
04
M40
+20
Subroutine call from step "20"
00
05
G00
+10000
Move +100.00 mm
00
06
M40
+20
Subroutine call from step "20"
00
07
M30
Program end
File Step Code
Data
Description
00
20
M60
+1
Output-1 on
00
21
G04
+100
Wait for 1sec
00
22
M61
+1
Output-1 off
00
23
M42
Return to main program
M42
* RETURN FROM SUBROUTINE
It returns to the main program from the subroutine by "M40". The step
to return is the next step of "M40". If the program meets the command
"M42" without declaration of "M40", then the motion stops and error
message ("SUB-RETURN ERROR") is displayed.
NO
NO
M50
* JUMP
Jump to the designated step in a file and continues to execute the
program.
0
95
M56
* JUMP BY BCD
Jump to the designated step in a file if the designated BCD value is
equal to the external BCD input, or jump to the next step if the
designated BCD value is not equal to the external BCD input.
External BCD input is determined by input-13,12,11,10.
The BCD input is useful when you want to branch the program by
external inputs (PLC, switches, etc.).
[Usage]
(00 ~ 15)X100 + (00 ~ 99)
Upper 2 figures
Lower 2 figures
BCD input
Jump step
0
1595
[Example]
File Step Code
Data
Description
00
03
G00
+10000
Move +100.00 mm
00
04
M56
+1007
If input-13,12,11,10 = on,off,on,off (BCD=10) then
jump to step "7", if not equal jump to next step
00
05
M30
Program end
00
06
M99
No operation
00
07
M60
+1
Output-1 on
00
08
M30
Program end
Summary of Contents for Tango-B series
Page 68: ......
Page 111: ...APPENDIX ...