Welcome, Guest. Please login or register.
Did you miss your activation email?
May 27, 2012, 09:28:58 AM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Mach Discussion
| |-+  VB and the development of wizards
| | |-+  macros, Is this the way to do it?
Pages: 1   Go Down
Print
Author Topic: macros, Is this the way to do it?  (Read 491 times)
0 Members and 2 Guests are viewing this topic.
5ms
Active Member

Offline Offline

Posts: 3


View Profile
« on: December 24, 2010, 02:22:26 PM »

Is this the way to do it?


test.nc
G01 X2 Y0 M101
G01 X9 M101
G01 X14 M101
G01 X15 Y5 M101
G01 X0  Y4 M101
G01 X1 M101
..............   So on..........

M101.m1s
While IsMoving()
  Sleep 10
Wend

   Code “G1 A2.5”
   Code “G1 A0”
   Code “G1 A1.7”
' 101 is dun

5ms
Logged
moorea21
Active Member

Offline Offline

Posts: 88


View Profile
« Reply #1 on: December 24, 2010, 03:52:02 PM »

I guess so...! See a reply to my post about macro's not being executed in written order, though.
Logged
rrc1962
Active Member

Offline Offline

Posts: 434


View Profile
« Reply #2 on: December 24, 2010, 04:00:19 PM »

You could use a subroutine right in your G-code.  I don't do it enough to write one from memory, but it's not difficult.  
Logged
moorea21
Active Member

Offline Offline

Posts: 88


View Profile
« Reply #3 on: December 24, 2010, 04:07:13 PM »

Not heard of a gcode subroutine; would that allow, for instance, 2 commands for an axis on the same line?
Logged
5ms
Active Member

Offline Offline

Posts: 3


View Profile
« Reply #4 on: December 24, 2010, 05:35:38 PM »

You could use a subroutine right in your G-code.  I don't do it enough to write one from memory, but it's not difficult. 

something like:

test.nc
Sub run101()
While IsMoving()
  Sleep 10
Wend

   Code “G1 A2.5”
   Code “G1 A0”
   Code “G1 A1.7”
end sub

G01 X2 Y0 run101
G01 X9 run101
G01 X14 run101
G01 X15 Y5 run101
G01 X0  Y4 run101
G01 X1 run101

Logged
Dan13
Active Member

Offline Offline

Posts: 759


View Profile WWW
« Reply #5 on: December 25, 2010, 01:18:12 AM »

You can use a subroutine right in the G code, like this:

test.nc
G01 X2 Y0
M98 P101
G01 X9
M98 P101
G01 X14
M98 P101
G01 X15 Y5
M98 P101
G01 X0  Y4
M98 P101
G01 X1
M98 P101
M30

O101
G1 A2.5
G1 A0
G1 A1.7
M99

Read the manual for more details.

Dan
Logged
5ms
Active Member

Offline Offline

Posts: 3


View Profile
« Reply #6 on: December 25, 2010, 05:25:46 AM »

moorea21, rrc1962 and Dan

Thank you for your replys and your time
Logged
Pages: 1   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!