User Tools

Site Tools


gcode:other:othr-if_then_else

IF..THEN..ELSE

Examples

#<trueval> = 1
IF [#<trueval>] THEN (print,trueval=true) ELSE (print,trueval=false)  
IF [LNOT[#<trueval>]] THEN (print,trueval=false) ELSE (print,trueval=true)  
 
#<falseval> = 0
IF [#<falseval>] THEN (print,falseval=true) ELSE (print,falseval=false)
IF [LNOT[#<falseval>]] THEN (print,falseval=false) ELSE (print,falseval=true)

#<z> = 0
N1000
  G00 X0 Y0 Z#<z>
  G01 X20 Y0
  G01 X20 Y20
  G01 X0 Y20
  G01 X0 Y0
  #<z> = [#<z>+1]
  IF [#<z> GT 30] THEN GOTO 2000
  IF [#<z> GT 10] THEN #<z> = [#<z>+1]
  IF [#<z> GT 20] THEN #<z> = [#<z>+2]
  GOTO 1000
N2000
M2 
gcode/other/othr-if_then_else.txt · Last modified: 2024/04/04 10:36 by andrej

Page Tools