http://cnc-club.ru/wiki/index.php/LinuxCNC_Features
Текущий статус разработки
- Дописать обработки.
 - Отловить баги  
 . 

АгаТандем писал(а): (правда предполагаю, планируется в ближайшем будущем))
Код: Выделить всё
#<_tool_feed> = 100
	(Rectangle sub definition)
	O<multipass> SUB
		#<sub> = #1
		#<depth> = #2
		#<step> = #3
		#<surface> = #4
		#<rappid> = #5
		#<x0> = #6
		#<y0> = #7		
	
		G0 Z#<rappid>
		G0 X#<x0> Y#<y0>
		#<z> = #<surface>
		O<multipass-while> WHILE [#<z> GT #<depth>]
			
			#<z> = [#<z>-#<step>]
			O<multipass-if> IF [#<z> LT #<depth>]
				#<z>=#<depth>
			O<multipass-if> ENDIF 
			F#<_tool_feed>
			G1 Z#<z>	
			(call pass sub with the restof parameters)
			(DEBUG, #<sub>)
			O#<sub> CALL [#8] [#9] [#10] [#11] [#12] [#13] [#14] [#15] [#16] [#17] [#18] [#19]
		
		O<multipass-while> ENDWHILE
	
		G0 Z#<rappid>	
	O<multipass> ENDSUB
(Rectangle sub definition)
#<_spiral-rectangle> = 1000
O#<_spiral-rectangle> sub
	#<cx> = #1
	#<cy> = #2
	#<w>  = #3
	#<h>  = #4
	#<spiral-step> = #5 
	#<a>  = #6
	O<spiral-rectangle-if-0001> IF [#<spiral-step> GT 0.01]
	  	
		#<x1> = [#<cx>-#<w>/2]
		#<x2> = [#<cx>+#<w>/2]
		#<y1> = [#<cy>-#<h>/2]
		#<y2> = [#<cy>+#<h>/2]
		G1 X#<x1> Y#<y1>
		; CW
		O<spiral-rectangle-while> WHILE [1]
		
			G1 X#<x1> Y#<y2>
			#<x1> = [#<x1> + #<spiral-step>]	
			O<spiral-rectangle-if-0002> IF [#<x1> GT #<x2>]
				G1 X[[#<x1>+#<x2>]/2]
				G1 Y[#<y1>]
				O<spiral-rectangle-while> BREAK
			O<spiral-rectangle-if-0002> ENDIF
			G1 X#<x2> Y#<y2>
			#<y2> = [#<y2> - #<spiral-step>]	
			O<spiral-rectangle-if-0003> IF [#<y1> GT #<y2>]
				G0 Y[[#<y1>+#<y2>]/2]
				G0 X[#<x1>]
				O<spiral-rectangle-while> BREAK
			O<spiral-rectangle-if-0003> ENDIF
	
			G1 X#<x2> Y#<y1>
			#<x2> = [#<x2> - #<spiral-step>]	
			O<spiral-rectangle-if-0004> IF [#<x1> GT #<x2>]
				G1 X[[#<x1>+#<x2>]/2]
				G1 Y[#<y1>]
				O<spiral-rectangle-while> BREAK
			O<spiral-rectangle-if-0004> ENDIF
	
			G1 X#<x1> Y#<y1> 
			#<y1> = [#<y1> + #<spiral-step>]	
			O<spiral-rectangle-if-0005> IF [#<y1> GT #<y2>]
				G0 Y[[#<y1>+#<y2>]/2]
				G0 X[#<x2>]
				O<spiral-rectangle-while> BREAK
			O<spiral-rectangle-if-0005> ENDIF
	
		O<spiral-rectangle-while> ENDWHILE
	O<spiral-rectangle-if-0001> ENDIF
O#<_spiral-rectangle> endsub(End definitions)
(Call spiral rectangle sub cX cY w h spiral-step depth depth-step surface rappid)
;					sub				   depth step surf rappid	#x0 #y0 #cx #cy   w    h    [spir-step]
O<multipass> CALL [#<_spiral-rectangle>] [-5.1] [1] [0] [10] 		[5] [2] [1]  [1]  [10] [20] [.1]
  
M02
Код: Выделить всё
			#<sub> = #1
			O#<sub> CALL [#8] [#9] [#10] [#11] [#12] [#13] [#14] [#15] [#16] [#17] [#18] [#19]
Код: Выделить всё
#<_tool_feed> = 100
   (Rectangle sub definition)
   O<multipass> SUB
      (#<sub> = #1)
      #<depth> = #2
      #<step> = #3
      #<surface> = #4
      #<rappid> = #5
      #<x0> = #6
      #<y0> = #7   Код: Выделить всё
O123 sub
	O<200> IF [5 LE 0.01]
		O123 RETURN
	O<200> ENDIF
	O124 WHILE [1]
		O124 BREAK
	O124 ENDWHILE
O123 endsub(End definitions)
M02
наверно логтка в этом есть:Nick писал(а):Или вот еще пример:
Убираем RETURN или WHILE и всеработает. А с ними выдает ошибку...
Код: Выделить всё
O123 sub
   O125 WHILE [1]
      O125 BREAK
   O125 ENDWHILE
   
   O200 IF [5 LE 0.01]
      O123 RETURN
   O200 ENDIF
O123 endsub
M02а откуда код? какой тоNick писал(а):хмммм какие-то странности с Окодами... Может это конечно из-за того, что у меня версия LinuxCNC кривая и стоит на 12.10... В общем ловлю странное поведение при разных о кодах.
Код: Выделить всё
Warning: problem with image subroutines/icons/dz.png 
Warning: Error while parsing set_depth_step.ini...
'icons/dz.png'
Warning: problem with image subroutines/icons/center.png 
Warning: Error while parsing hexagon.ini...
'icons/center.png'
Warning: problem with image subroutines/icons/dz.png 
Warning: Error while parsing set_rappid.ini...
'icons/dz.png'
Warning: problem with image subroutines/icons/diameter.png 
Warning: Error while parsing set_tool.ini...
'icons/diameter.png'
Warning: problem with image subroutines/icons/rect.png 
Warning: Error while parsing array.ini...
'icons/rect.png'
Warning: problem with image subroutines/icons/dz.png 
Warning: Error while parsing set_surface.ini...
'icons/dz.png'
Warning: problem with image subroutines/icons/rect.png 
Warning: Error while parsing rect-center.ini...
'icons/rect.png'
Warning: problem with image subroutines/icons/rect.png 
Warning: Error while parsing group.ini...
'icons/rect.png'
Warning: problem with image subroutines/icons/dz.png 
Warning: Error while parsing set_depth.ini...
'icons/dz.png'
Warning: problem with image subroutines/icons/rect.png 
Warning: Error while parsing rect_center_step.ini...
'icons/rect.png'
Warning: problem with image subroutines/icons/center.png 
Warning: Error while parsing n-gon.ini...
'icons/center.png'
Warning: problem with image subroutines/icons/rect.png 
Warning: Error while parsing rect.ini...
'icons/rect.png'
Warning: problem with image subroutines/icons/rect.png 
Warning: Error while parsing circular-array.ini...
'icons/rect.png'
Warning: Error while parsing gcode.ini...
Datei »subroutines/icons/gcode.png« konnte nicht geöffnet werden: Datei oder Verzeichnis nicht gefunden
Warning: problem with image subroutines/icons/rect.png 
Warning: Error while parsing circle.ini...
'icons/rect.png'