586,069 active members*
3,341 visitors online*
Register for free
Login
Results 1 to 10 of 10
  1. #1
    Join Date
    Sep 2009
    Posts
    6

    Looping Program

    Hello
    Just got a Okuma 4020. No manuals Yet and need to get a program
    going in the A.M. Only have mazaks and our looping program looks like
    this.

    (3/16" ENDMILL USED)

    G00G91G28Z0.0

    G28A0.0

    T01T01M6

    S1500M3

    G00G90G54X.1922Y.822

    G00Z2.0M8

    M98H10L6 (LOOPS FROM N10 6 TIMES)

    N10G00Z.5

    G01Z0.0F15.0



    PATH HERE




    G00Z2.0

    X.1922Y.822

    A-60.0 (ROTATES 60 DEGREES )

    G92A0.0 (RESETS A AXIS TO ZERO)

    M99P20 (N20 AFTER SIX ROTATIONS)

    N20G91G28Z.0

    G28Y.0

    M2

    %



    I've added a few notes and taken out the toolpath to show
    what I need to do.

    Will an Okuma do this and how ?

    Thanks for any help you can give

    Libbey

  2. #2
    Join Date
    Feb 2009
    Posts
    6028
    Only loop I've done on an okuma is a goto statement.

    They can be used with a counter, such as v1.

    N10 v1=1
    N20 program


    N100 v1=v1+1
    If [v1 lt (number of parts)] goto n20

    This is going by memory, been a few years.

  3. #3
    Join Date
    Sep 2009
    Posts
    6
    I think this may work. I also need to index a rotary table and cut this
    pattern 12 times 30 degrees apart around the od of the part. Can I also
    have a counter say

    V2=0 (starting angle)


    v2=v2+30. (amount to index)
    If [v2 gt (360)] goto n20

    n20

    If this will work, will the machine respond to

    G0BV2

    Thanks for the reply

  4. #4
    Join Date
    Feb 2009
    Posts
    6028
    Might need a b=v2, but you have the idea.

  5. #5
    Join Date
    Aug 2011
    Posts
    2517
    I do that a lot in my programs.

    the correct syntax is....

    G0 B[V2]

    here's another way to repeat things....
    V1=30 (ANGLE INCREMENT)
    V2=360/V1 (NUMBER OF DIVISIONS IN ONE ROTATION I.E. 360/30=12)
    V3=0 (COUNTER OF TOTAL DIVISIONS)
    N5000
    IF[ V3 GE V2] GOTO N6000
    G00 B[V3*[360/V2]]

    (YOUR WORK PROGRAM CODE GOES HERE)

    V3=V3+1
    GOTO N5000
    N6000

  6. #6
    Join Date
    Oct 2010
    Posts
    103
    Quote Originally Posted by fordav11 View Post

    the correct syntax is....
    Good luck with that

    Quote Originally Posted by libbey View Post
    I think this may work. I also need to index a rotary table and cut this
    pattern 12 times 30 degrees apart around the od of the part. Can I also
    have a counter say

    V2=0 (starting angle)


    v2=v2+30. (amount to index)
    If [v2 gt (360)] goto n20

    n20

    If this will work, will the machine respond to

    G0BV2

    Thanks for the reply
    As said, you will want B=V2 as Okuma likes to have variables used that way

    V2=0 (starting angle)


    N10 v2=v2+30. (amount to index)

    (I assume programming here?)

    If [V2 GT 360] N20 (in a conditional, just block name is needed, not "goto". and no parenthesis around the 360 or it will not be read
    GOTO N10 (don't forget to return to calculation when condition is not met)

    n20

    --------------

    You could also put your increment calcutation and program in a sub.

    OMAIN

    .......

    V2=0

    CALL OSUB Q12 (will repeat sub Q # times)

    .......
    M2
    OSUB
    V2=V2+30
    Go B=V2
    .....
    ....
    RTS

    Or could also be done with MODIN

    ....
    .....
    MODIN OSUB
    B30
    B60
    B90
    B120
    etc...
    .....
    MODOUT

    --------------

    certainly is a few ways to tackle it

  7. #7
    Join Date
    Aug 2011
    Posts
    2517
    Pretty funny dude. you should have been a comedian instead of a drop-kick button-pusher with 62 posts.
    At least on OSP7000 an example like G00 C[V1] works fine. I have written hundreds of programs using it like that.
    I seriously don't care either way. Take the advice or ignore it. Oh, and your name is spot on too.

  8. #8
    Join Date
    Oct 2010
    Posts
    103
    Quote Originally Posted by fordav11 View Post
    Pretty funny dude. you should have been a comedian instead of a drop-kick button-pusher with 62 posts.
    At least on OSP7000 an example like G00 C[V1] works fine. I have written hundreds of programs using it like that.
    I seriously don't care either way. Take the advice or ignore it. Oh, and your name is spot on too.
    Do you care to come here and speak that??// teehee

    Wasn't trying to itch under your bra. Actually, was refering more to the extra calculations you had done, which would actually give more flexibility for quick changes. I have a OSP700, so I guess you do have 2 up on me, 2 axes of available control anyway. But, unless you have extended memory, then you know about limited storage. Yes B[V2] would work but B=V2 uses one less character. So EXCUSE me for thinking along the lines of storage conservation. Besides, I have edited and re-edited many macros just to get them down in size. No spaces, no extras. I think too that the manual also shows as x=vc2 which now reminds me is all thinking wrong? you guys using user variable cause that's VC2 not V2? Well, on mine anyway. I think I have used an okuma control where it wa "V", but been a good while or I'm completely mistaken.

    anyway about it, there are people that have never heard of this site and would make the both of us look like blind kids on a playground. 62 posts means nothing, neither does 1010 posts.

    So... if you think you are big enough to drop kick me.... I openly invite you. I've never had anyone EVER think they could do that before. Not in 99 years. This could be good as I could probably use that/... However, I doubt you are capable. But this could be awesome.... I'll bring the camera

    in the end, no intention to get under anyone's skin... just saying. Also, can you really use "V2" or would that need to be "VC2" ? All my "V"s would need to be changed to "VC"s , so yes I did make a big error anyway.




    must be monday, huh?

  9. #9
    Join Date
    Feb 2009
    Posts
    6028
    Think it just depends on if you want to use system variables or local variables. Could even assign your own such as "rotate" or whatever.

  10. #10
    Join Date
    Oct 2010
    Posts
    103
    Quote Originally Posted by underthetire View Post
    Think it just depends on if you want to use system variables or local variables. Could even assign your own such as "rotate" or whatever.
    Yes, you can use much whatever you want, I think limited to 5 character string, but must not start with G, M, N, O and I think V (or shouldn't anyway for practical reason) or any of the standard mnemonic codes, as for local variables and those are good ONLY in that program or part of program. They will not pass into subs or macros or back into the main program. I use a lot of them in macros as sort of acronyms for the moves being calculated. But the user variables are constant through mains into subs and back to mains and in and out of auto mode. And VC1-VC32 are stored at power off, but others are lost, at least on my OSP-700M and I assume similar.

Similar Threads

  1. looping
    By dinglekiller in forum G-Code Programing
    Replies: 10
    Last Post: 02-01-2012, 05:47 AM
  2. M98 Looping
    By camtd in forum Parametric Programing
    Replies: 20
    Last Post: 08-15-2011, 02:43 PM
  3. Looping command?
    By rigo430 in forum Haas Lathes
    Replies: 1
    Last Post: 04-11-2010, 11:35 PM
  4. Program Looping
    By Bohemund in forum CamSoft Products
    Replies: 7
    Last Post: 05-26-2007, 05:08 PM
  5. Sub Looping
    By murphyspost in forum Daewoo/Doosan
    Replies: 8
    Last Post: 12-27-2006, 05:28 PM

Posting Permissions

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