-Shenzhen Guanhong Automation Co.,Ltd.-
SZGH-CNC1000MDb Series
- 91 -
“G00 Z0”, if #200 isn’t equal to 1, system don’t execute operation of “GOTO 20” ,and will
execute next segments , “G00 X0”,and then execute “G00 Z0”.
2) IF (Conditional express) THEN <A Expression>
<B operational segment>
If condition is met, system execute A expression , and then execute B operational segment ; if
condition is not meet, execute the next segment , B operation.
Example: #101=0
N1 IF(#100 EQ 1) THEN #101=1
N2 IF(#101 EQ 1) GOTO 4
N3 G00 X100
N4 G00 Z100
Explanation: If #100 is equal to 1, system will execute “#100=1”, and then judge #101 is equal to
1 , jump to N4 & “execute G00 Z100” ; if #100 isn’t equal to 1, system will judge #101 also isn’t
equal to 1 directly , and execute “G00 X100” & “G00 Z100”.
NOTE: 1.<A expression> normally is assignment statement.
2. <A expression> after THEN must exist, otherwise system will hint grammatical errors.
Prolongation:
3) IF(conditional express)
<A operational command>
ELSE
<B operational command>
ENDIF
4) IF(conditional express)
<A operational command>
ELIF
<B operational command>
ENDIF
3.30.3.6 Loop Command
Format: (Conditions Initialization)
WHILE (conditional expression) DO n
<A operational segments>
[Alter condition of loop]
END n
<B operational segments>
When conditions are met during WHILE cycle command, execute the operational segments
between DO n and END n . Otherwise,when condition isn't met, jump to the program line after
END n ,also execute B operational segments.
We can nest for loops by placing one loop within another.
Note: 1.There must have operational codes that are for change condition at operational segments ,which is
between Do n & END n. Otherwise system will enter endless loop.
2.Nesting of macro program loop statements of SZGH CNC system is 3 pcs of loops at most . Also n
only could be 1 , 2 , 3 .
3.n of “DO n” & “END n” must keep same.
Содержание 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...