-Shenzhen Guanhong Automation Co.,Ltd.-
SZGH-CNC1000MDb Series
- 90 -
A8 B1
A9 B10
G67
M30
Macro Program: 6000
N1 #2=#0+#1
N2 IF (#2 EQ 10) GOTO 4
N3 G00 X#2
N4 G00 Z#1
N5 M99
; Return
3.30.3 Macro Program Instruction
3.30.3.1 Input Instruction: WAT
Waiting for the input port X valid or invalid instruction
Format: WAT+ (-) X(Y/M)**+(-)X**+(-)X**+(-)X**+(-)X**
Attention: "+" to means wait for the input is effective;
"-" means wait for the input is invalid;
CNC only can detect only one Y or M , X is without limit.
"X" means the input port X00-X55; see the I/O diagnosis;
3.30.3.2 Output Instruction: OUT
Set the output port Y is valid or invalid instruction
Format: OUT +(-)Y
Attention: "+" means the output is effective;
"-" means the output is invalid;
"Y" means the output port Y00-Y31; see the I/O diagnosis;
3.30.3.3 Assignment Instruction: =
Explanation: used for assignment of a variable
Eg.: #251=890.34
#450=#123
And also it could be mathematical expression , example.: #440=#234+#470
3.30.3.4 Unconditional Jump: GOTO n
“GOTO n” is the command that for jump to the program line that is specified by sequence
number (N**) unconditionally. n is the sequence number.
E.g.: GOTO 5 ; // Jump to N5 program line.
Note: when specified program line , n , is beyond sequence number of N1-N99999, cnc system will hint
error.
n , program line,could be macro variable (#**)
E.g.: GOTO #100
3.30.3.5 Conditional Jump
1) IF (Conditional express) GOTO n
If condition is met, execute GOTO n ,jump to N** program line; if the condition isn't met,
execute the next segment.
Example: N1 IF(#200 EQ 1) GOTO 20
N10 G00 X0
N20 G00 Z0
Explanation: If #200 is equal to 1, system will execute GOTO 20 , jump to N20 , and execute
Содержание 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...