User Tools

Site Tools


mycnc:subroutines

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
mycnc:subroutines [2020/03/06 14:42] ivanmycnc:subroutines [2020/12/10 09:09] (current) ivan
Line 1: Line 1:
 ======Subroutines in myCNC====== ======Subroutines in myCNC======
 +
 +{{youtube>h69QymaY6PE?large}}
  
 Subroutines in myCNC are done in a manner similar to other industrial CNC systems.  Subroutines in myCNC are done in a manner similar to other industrial CNC systems. 
Line 6: Line 8:
  
 <code> <code>
-g90 g0 z10  F500+G90 G0 Z10  F500
 #100=[10] #100=[10]
 #101=[10] #101=[10]
-G0 x#100 y#101 +G0 X#100 Y#101 
-m98 P101 L5 +M98 P101 L5 
-m2 +M2 
-o100 +O100 
-g0 x#100y#101 +G0 X#100Y#101 
-g1z0 +G1Z0 
-g2 x#100 y#101 i10+G2 X#100 Y#101 I10
 #100=[#100+40] #100=[#100+40]
-g0 z10 +G0 Z10 
-m99 +M99 
-o101+O101
 M98 P100 L5 M98 P100 L5
 #100=[10] #100=[10]
Line 25: Line 27:
 M99</code> M99</code>
  
 +The resultant program will look the following way:
 +{{:mycnc:forum-mar2020-020-vis-subroutine.png}}
 +
 +Subroutines are called using the following syntax:
 +
 +<code>M98 P[SUBROUTINE NUMBER] L[NUMBER OF REPETITIONS]</code>
 +
 +As can be seen in the code above, this takes the form of 
 +
 +<code>M98 P100 L5</code>
 +
 +The M99 code is used inside the subroutine that is being called to indicate the end of that subroutine. 
  
mycnc/subroutines.txt · Last modified: 2020/12/10 09:09 by ivan

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki