Hello Guest it is July 23, 2019, 10:18:02 AM

Author Topic: Repeating a program with an increasing variable  (Read 2534 times)

0 Members and 1 Guest are viewing this topic.

Repeating a program with an increasing variable
« on: October 15, 2008, 04:44:12 AM »
Is there a way within Mach 3 to execute a small cnc program, advance the A axis and run the same program again 23 more times incrementing the index of the A axis?  Basically, loop through a program bumping the A index a few degrees each time?  I scanned the G code list looking for a 'relative' position code but didn't see anything.  By relative I mean, advance the axis by x degrees from where it currently sets and not specify an absolute location.

Thanks in advance....

Offline RICH

*
  • *
  •  7,342 7,342
    • View Profile
Re: Repeating a program with an increasing variable
« Reply #1 on: October 15, 2008, 06:40:46 AM »
WILL1234,
Yes there is. You can use a wizard or write a  small progam.
Work calls so need to go. do a search "rotary table" lots of good info in there.
probably annother will respond before i get home and if not i'll get back tonight.
rich
Re: Repeating a program with an increasing variable
« Reply #2 on: October 15, 2008, 07:02:15 PM »
Thanks for pointing me in the right direction.  I'll search on your suggestion and hopefully find everything.

Offline RICH

*
  • *
  •  7,342 7,342
    • View Profile
Re: Repeating a program with an increasing variable
« Reply #3 on: October 15, 2008, 07:53:43 PM »
will1234,
Here is small program that should do what you asked. Gcode is not my thing but can dangerous at times. ;)
RICH


G91                 ( INCREMENTAL MODE )
M98 P1000 L23 ( CALL SUBROUTINE L REPEAT MOVE 23 TIMES )
M30                 ( PROGRAM END AND REWIND )
O1000             ( THE SUBPROGRAM )
G00 A5            ( TABLE WILL MOVE IN 5 DEGREE INCREMENTS )
G04 P1.0         ( A DWELL OF 1 SECOND BETWEEN MOVES )
M99                ( RETURN FROM SUBROUTINE REPEAT )