586,773 active members*
9,207 visitors online*
Register for free
Login
IndustryArena Forum > Machine Controllers Software and Solutions > G-Code Programing > Creating A Loop With Different Work Offsets
Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2009
    Posts
    26

    Creating A Loop With Different Work Offsets

    I have a 5-axis Mori Seiki vertical. I'm familiar with how to loop a block of code, but I'm now trying to loop a block of code 5 times while changing the work offset from G54, G55, G56, so on. I'm wanting to do this so that when I alter code at the mill, I don't have to change a ton of copied code OR macro code OR subprogram code. I've searched everywhere and can't seem to find an answer. Does anyone have an idea on how this could be done? Thanks in advance!

  2. #2
    Join Date
    Oct 2012
    Posts
    84

    Re: Creating A Loop With Different Work Offsets

    Would something like this work?



    Startup code to your preference
    G0 G94 G17 G40 ......
    g54
    M98 p2222 (call to sub program, the O number)
    G55
    M98 p2222 (call to sub program, the O number)
    G56
    M98 p2222 (call to sub program, the O number)
    G57
    M98 p2222 (call to sub program, the O number)
    G58
    M98 p2222 (call to sub program, the O number)
    M02

    O2222

    program code

    M99 (return to calling program)

  3. #3
    Join Date
    Jul 2010
    Posts
    118

    Re: Creating A Loop With Different Work Offsets

    Hi,
    main prog:
    #100=54
    M98 P2000 L5
    ..
    .

    O2000(SUB)
    G#100
    #100=#100+1(FOR NEXT REPEAT G5?)
    .
    .
    M99

  4. #4
    Join Date
    Feb 2015
    Posts
    14

    Re: Creating A Loop With Different Work Offsets

    Both of these will work...but if you are trying to loop the block of code as a do while loop instead of calling a subprogram or macro:

    #1=54.
    WHILE[#1LE58.]DO1
    G#1
    whatever machining code you want to do
    #1=#1+1.
    END1

Similar Threads

  1. Help understanding work offsets and extended work offsets
    By tomvoutsas in forum Tormach Personal CNC Mill
    Replies: 1
    Last Post: 09-20-2013, 06:35 AM
  2. 3 Work Offsets?
    By KUWill in forum SolidCAM for SolidWorks and SolidCAM for Inventor
    Replies: 1
    Last Post: 11-07-2012, 08:19 PM
  3. Work Offsets
    By Brad Morris in forum Mechanical Calculations/Engineering Design
    Replies: 0
    Last Post: 02-28-2010, 11:59 PM
  4. work offsets
    By porkchop21 in forum Bridgeport / Hardinge Mills
    Replies: 1
    Last Post: 09-25-2009, 05:39 AM
  5. Work Offsets
    By new2cnc in forum Mastercam
    Replies: 3
    Last Post: 04-30-2005, 04:04 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •