-Shenzhen Guanhong Automation Co.,Ltd.-
SZGH-CNC1000MDb Series
- 112 -
4.2 Subprogram Configuration
There are two program types, main program and subprogram. Normally, the CNC operates
according to the main program. However, when a command calling a subprogram is encountered in
the main program, control is passed to the subprogram. When a command specifying a return to the
main program is encountered in a subprogram, control is returned to the main program.
Fig4.2.1 Main program and subprogram
If a program contains a fixed sequence or frequently repeated pattern, such a sequence or
pattern can be stored as a subprogram in memory to simplify the program.
A subprogram can be called from the main program.
A called subprogram can also call another subprogram.
4.2.1 Calling of Subprogram (M98)
This code is used to call a subprogram.The code and strobe signals are not sent.
M98 P_ L_ ;
P_: specify address & name of subprogram. Eg.: Psub/1390; sub is a folder.
Subprogram can be hidden files that don’t display in program district,First character of these
program must be a "HIDEFILE".
Example: "HIDEFILE01", the subprogram in the program area is not displayed, user can use
these type commands to call subprogram.
M98 PHIDEFILE01
or
M98 P*01
If user want to call subprogram in USB-disk, Format is “ P[ _“ or “ P]_”.
Example:
M98 P[A1234
; Call A1234 subprogram in USB-disk;
L_: number of times the subprogram is called repeatedly.When no repetition data is specified,
the subprogram is called just once.
M98 instruction can be omitted.
Format: PP_
.
Example:
PP[FFDE ;
call “FFDE” subprogram in USB-disk;
Note: 1. There must has a blank before “L_” in this system;
2. Subprogram must be an independent program.
4.2.2 End of Subprogram (M99)
This code indicates the end of a subprogram.M99 execution returns control to the main
program.No code or strobe signal is sent.
1) M99 in main program is same to M02;
2) M99 with P in main program is same to M97 ;
Содержание SZGH-CNC1000MDb Series
Страница 220: ...Shenzhen Guanhong Automation Co Ltd SZGH CNC1000MDb Series 207 Appendix I Wiring Diagram of CN3 Plug...
Страница 221: ...Shenzhen Guanhong Automation Co Ltd SZGH CNC1000MDb Series 208 Appendix II Wiring Diagram of CN10 Plug...
Страница 222: ...Shenzhen Guanhong Automation Co Ltd SZGH CNC1000MDb Series 209 Appendix III Wiring Diagram of CN4 Plug...