585,692 active members*
4,056 visitors online*
Register for free
Login
IndustryArena Forum > MetalWorking Machines > Okuma > Fanuc lathe guy trying to learn Okuma-Please help me
Results 1 to 9 of 9
  1. #1
    Join Date
    Jun 2006
    Posts
    17

    Fanuc lathe guy trying to learn Okuma-Please help me

    We just bought a brand new Okuma Genos, 2-axis lathe. Control has Usertask2. I am trying to do a few things.

    First, I cant figure out how to emulate a While/Do loop.
    Ex
    WHILE[#107LT#105] DO1
    ....
    .....
    ......
    #107=[#107+1]
    END1

    Second, How do I perform a Z-axis incremental workshift like this:

    run 1st part

    #5222=[#5222-#120] (#5222 is Fanuc system variable for G54 Z-axis workshift amount)

    run 2nd part....

    #5222={#5222-#120]

    run 3rd part..

    #5222=0.0(reset workshift back to zero before next barpull)

    I have read the manual and it is hard to understand.
    I have also found very little info on the web regarding Usertask2 examples.


    Thanks

    Scott

  2. #2
    Join Date
    Jun 2015
    Posts
    4154

    Re: Fanuc lathe guy trying to learn Okuma-Please help me

    Hy,

    Here is an example for REPEAT-UNTIL, instead of WHILE-DO ... ok 4 u ?

    V1=100 ( cycles )
    V2=0 ..( increment )

    NHERE
    V2=V2+1
    ( do something )
    IF [ V2 LT V1 ] NHERE ( or ) (
    IF [ V2 LT V1 ] GOTO NHERE )

    LT - lower than <
    LE - lower than or equal <=
    EQ - equal =
    NE - not equal <>
    GT - greater than >
    GE - greater than or equal >=

    Z-axis incremental ... please explain a bit more what d u wish

    i got it

    V1=9999.888 ( length to machine afferent to one cycle / program / part )

    ( program goes here )
    VSZOZ=
    VSZOZ-V1
    ( program goes here )
    VSZOZ=VSZOZ-V1
    ( program goes here )


  3. #3
    Join Date
    Jun 2015
    Posts
    4154

    Re: Fanuc lathe guy trying to learn Okuma-Please help me

    now, let's make a cocktail with those two :

    V1=100 ( cycles )
    V2=0 ..( increment )
    V3=9999.888 ( length to machine afferent to one cycle / program / part )

    NHERE
    V2=V2+1
    ( program goes here )
    VSZOZ=VSZOZ-V3
    IF [ V2 LT V1 ] NHERE

    let's avoid Z_origin changing on last part

    NHERE
    V2=V2+1
    ( program goes here )
    IF [ V2 EQ V1 ] NSKIP
    VSZOZ=VSZOZ-V3
    IF [ V2 LT V1 ] NHERE
    NSKIP

    let's restore initial Z_origin at programs end

    NHERE
    V2=V2+1
    ( program goes here )
    IF [ V2 EQ V1 ] NSKIP
    VSZOZ=VSZOZ-V3
    IF [ V2 LT V1 ] NHERE
    NSKIP
    VSZOZ=345.896fd4gfd654h56gf4 ( u got it ? )

    let's say you wish to cut 10 parts ... so, you will declare V1=10
    let's say you won the lotery, you reset the machine during 5th part, go get happy, and come back to continue ... just declare V2=5-1 instead of 0
    if you are too happy, don't forget on next run to restore V2=0


    kindly !

  4. #4
    Join Date
    Jun 2015
    Posts
    4154

    Re: Fanuc lathe guy trying to learn Okuma-Please help me

    final touch :

    V1=100 ( cycles )
    V2=0 ..( increment )
    V3=9999.888 ( length to machine afferent to one cycle / program / part )

    NHERE
    V2=V2+1
    CALL OPROG
    IF [ V2 EQ V1 ] NSKIP
    VSZOZ=VSZOZ-V3
    IF [ V2 LT V1 ] NHERE
    NSKIP
    VSZOZ=... ( constant value )

    OPROG
    ( program goes here )
    RTS

  5. #5
    Join Date
    Jun 2006
    Posts
    17

    Re: Fanuc lathe guy trying to learn Okuma-Please help me

    Thank you very much, deadlykitten . Will try this morning and post results

  6. #6
    Join Date
    Jun 2015
    Posts
    4154

    Re: Fanuc lathe guy trying to learn Okuma-Please help me

    you ain't got Easter ?

  7. #7
    Join Date
    Jun 2015
    Posts
    4154

    Re: Fanuc lathe guy trying to learn Okuma-Please help me

    also photos are welcome

  8. #8
    Join Date
    Jun 2006
    Posts
    17

    Re: Fanuc lathe guy trying to learn Okuma-Please help me

    Thank you so much deadlykitten, your suggestions worked great-machine is up and running.
    Had to change VSZOZ to VZSHZ (a workshift, usually at zero).Everything else worked like a charm.

    Fanuc Program:

    %
    O3984
    (DELRIN RING)
    (243AL)
    (P/N SAGE18.6-RI)
    (REV--)
    (4/03/2013)
    (CYCLE-2-14 5PCS)
    (STOCK DIA-.875)


    (**NOTES**)
    (1.SET ALL VARS. BELOW)

    (2.SET STOCK OUT .500 USING STOP-LOC-)
    (-FOR EVERY NEW BAR)

    (3.JOG BARPULLER AND GRAB STOCK)
    (SET BARPULLER X0Z0 HERE)


    (4.MANUALLY SET #550 TO 0.0)
    (5.MANUALLY SET #555 TO 0.0)


    (6.RUN BARPULLER OP.)
    (FACEOFF .01)
    (SET TOOLS)

    (KEEP CHIP CNVYR. OFF)
    (***************)

    (**TOOL LIST**)
    (T0707)(ISCAR .625 DRILL INSERT)
    (ORDER#IDM 0625 GRADE IC908)
    (T0303)(MITSUB INT. PROFILE BAR)
    (T0505)(PICCO R06.7-20 IC228)
    (T0202)(ISCAR 35DEG FR. TURN .004R IC20)
    (T0404)(.031 MAXBAR CUTOFF)
    (T0606)(BARPULLER)



    (COMMON VARIABLES)
    #100=0(LOOP-KEEP AT ZERO)
    #101=5(PARTS PER CYCLE)
    #102=.096(PART OAL)
    #103=.030(CUTOFF WIDTH)
    #104=.003(FACEOFF AMT)
    #105=.043(ID CFER TOOL-FACE TO POINT)
    #106=30.0(BARLENGTH-INCHES)


    (***DO NOT EDIT BELOW THIS LINE***)
    #107=[#102+#103+#104](CYCLE WIDTH)
    #108=[#106-3.0]
    #109=ROUND[#108/[#107*#101]](FEEDS/BAR)
    #110=[#107*#101](BARPULLER FEEDOUT)


    N100(BARPULL)
    M72(CHUCK CLOSE)
    T0606
    G54
    #5222=0.0(W.SHIFT SAFETY)
    G0X3.0Z.5
    Z0.0
    G98G1X0.0F100.0
    M71(CHUCK OPEN)
    G04U1.0
    G1W[#110+.005]F100.0
    M72(CHUCK CLOSE)
    G4U.5
    G1X3.0F100.0
    G99
    G0G28U0W0
    M01

    N200(INITIAL FACEOFF)
    T0202(ISCAR 35 DEG .004R FT IC20)
    #5222=0.0(W.SHIFT SAFETY)
    G54
    G50S3500
    G96S500M3
    G0X.9Z.5
    Z.002
    G1X.5F.0015
    G0U.05W.012
    G0Z.1
    G0G28U0W0
    M01


    N300(*DRILL THRU*)
    T0707(.614 INSERT DRILL)
    #5222=0.0(W.SHIFT SAFETY)
    G54
    G97S1800M3
    G0X0Z.25
    Z.05
    G1
    Z-1.0F.009
    G0Z.25
    G28U0W0
    M01

    N400(*BORE*)
    T0303(CCGT 2-0-SM GROIC907)
    #5222=0.0(W.SHIFT SAFETY)
    G54
    G50S4000
    G96S500M3
    G0X.719Z.1
    Z.05
    M6
    G1
    G74R.005
    G74X.719Z-.730Q500R-.005F.005
    G0X.739
    G04U1.0
    M7
    G1Z-.73F.002
    X.710
    Z-.830
    U-.02W.01
    G0Z.5
    M6
    G04U1.0
    M7
    G28U0W0
    M01



    N500(*INTERNAL CHAMFERS*)
    T0505(PICCO R06.7-20 IC228)
    #5222=0.0(W.SHIFT SAFETY)
    G54
    G50S4000
    G96S500M3
    G0X.7Z.5
    Z-[#105]
    WHILE[#100LT#101]DO1
    (FRONT CHAMFER)
    G1X.749F.001
    G0X.7
    W-[#107]
    #100=#100+1
    END1
    #100=0.0
    G0X.65
    Z.5


    (BACK CHAMFER)
    X.7Z-[#105]
    W-[#102]
    WHILE[#100LT#101]DO2
    G1X.752F.001
    G0X.7
    W-[#107]
    #100=#100+1
    END2
    #100=0.0
    M6
    G0X.65
    Z.5
    M7
    G28U0W0
    M01


    N600(FACE TURN + CUTOFF*)
    #5222=0.0(W.SHIFT SAFETY)
    WHILE[#100LT#101]DO3
    T0202(ISCAR 35DEG FR. TURN .004R IC20)
    G54
    G50S3000
    G96S600M3
    G0X.675Z.1
    M6
    Z.02
    G1Z0.0F.001
    M7
    X.7843
    X.809Z-.0123
    Z-.0302
    X.796Z-.0367
    Z-.054
    G2X.818Z-.065R.011
    G1X.8483
    X.859Z-.0703
    Z-.0987
    X.8436Z-.1064
    G0X.9
    Z2.5


    (CUTOFF)
    T0404(MAXBAR .031 CUTOFF)
    G0X.950Z.5
    M6
    Z-[#107]
    M7
    G1X.660F.0015
    G0W.01
    G0X.950
    G0Z2.5
    #5222=[#5222-#107](WORKSHIFT)
    #100=#100+1
    END3
    #5222=0.0(RESET W.OFFSET)
    #100=0.0
    G0G28U0W0


    M05
    #550=#550+#101(PART COUNT)
    #555=#555+1(FEED COUNT)
    IF[#555EQ#109]GOTO1000
    GOTO1500
    N1000
    M71(COLLET OPEN)
    #555=0.0(RESET FEED COUNT)
    #3000=100(CHANGE BAR-HIT RESET)
    N1500
    /M99
    M30
    %



    Converted for Okuma:


    (REC DELRIN RING)
    (243AL)
    (P/N SAGE18.6-RI)
    (REV--)
    (4/03/2013)
    (CYCLE-2-14 5PCS)
    (STOCK DIA-.875)


    (**NOTES**)
    (1.SET ALL VARS. BELOW)

    (2.SET STOCK OUT .500 USING STOP-LOC-)
    (-FOR EVERY NEW BAR)

    (3.JOG BARPULLER AND GRAB STOCK)
    (SET BARPULLER X0Z0 HERE)


    (4.MANUALLY SET V198 TO 0.0)
    (5.MANUALLY SET V199 TO 0.0)


    (6.RUN BARPULLER OP.)
    (FACEOFF .01)
    (SET TOOLS)

    (KEEP CHIP CNVYR. OFF)
    (***************)

    (**TOOL LIST**)
    (T0303)(PICCOR06.7-20IC228)
    (T0404)(ISCAR35DEGFR.TURN.004RIC20)
    (T0505)(MITSUBINT.PROFILEBAR)
    (T0707)(ISCAR.625DRILLINSERT)
    (ORDER#IDM 0625 GRADE IC908)
    (T0808)(CUTOFF)
    (T1212)(BARPULLER)


    N50
    (COMMON VARIABLES)
    V100=0 (LOOP-KEEP AT ZERO)
    V101=5 (PARTS PER CYCLE)
    V102=.096 (PART OAL)
    V103=.078 (CUTOFF WIDTH)
    V104=.003 (FACEOFF AMT)
    V105=.043 (ID CFER TOOL-FACE TO POINT)
    V106=30.0 (BARLENGTH-INCHES)


    (***DO NOT EDIT BELOW THIS LINE***)
    V107=[V102+V103+V104] (CYCLE WIDTH)
    V108=[V106-3.0]
    V109=ROUND[V108/[V107*V101]] (FEEDS/BAR)
    V110=[V107*V101] (BARPULLER FEEDOUT)

    CLEAR
    DRAW

    N100 (BARPULL)
    M72 (CHUCK CLOSE)
    T1212
    VZSHZ=0.0 (W.SHIFT SAFETY)
    G0X3.0Z.5
    Z0.0
    G94G1X0.0F100.0
    M84 (CHUCK OPEN)
    G04F1
    G91
    G1Z=[V110+.005]F100.0
    G90
    M83 (CHUCK CLOSE)
    G04F2
    G1X3.0F100.0
    G95
    G0X20.Z20.0
    M01

    N200 (INITIAL FACEOFF)
    T0404 (ISCAR 35 DEG .004R FT IC20)
    VZSHZ=0.0 (W.SHIFT SAFETY)
    G50S3500
    G96S500M3
    G0X.9Z.5
    Z.002
    G1X.5F.0015
    G0X.55Z.014
    G0Z.1
    G0X20.0Z20.0
    M01


    N300 (*DRILL THRU*)
    T0707 (.614 INSERT DRILL)
    VZSHZ=0.0 (W.SHIFT SAFETY)
    G97S1800M3
    G0X0Z.25
    Z.05
    G1
    Z-1.0F.009
    G0Z.25
    X20.0Z20.0
    M01

    N400 (*BORE*)
    T0505 (MITSUBINT.PROFILEBAR)
    VZSHZ=0.0 (W.SHIFT SAFETY)
    G50S4000
    G96S500M3
    G0X.719Z.1
    Z.05
    (M6)
    G1
    G74X.719Z-.730D500DA=.005F.005
    G0X.739
    G04F1
    (M7)
    G1Z-.73F.002
    X.710
    Z-.830
    X.69Z-.82
    G0Z.5
    (M6)
    G04F1
    (M7)
    G0X20.0Z20.0
    M01



    N500 (*INTERNAL CHAMFERS*)
    T0303 (PICCO R06.7-20 IC228)
    VZSHZ=0.0 (W.SHIFT SAFETY)
    G50S4000
    G96S500M3
    G0X.7Z.5
    Z=-[V105]
    N525
    IF [V100 GE V101]GOTO N550
    (FRONT CHAMFER)
    G1X.749F.001
    G0X.7
    G91
    Z=-[V107]
    G90
    V100=[V100+1]
    GOTO N525

    N550
    V100=0.0
    G0X.65
    Z.5


    (BACK CHAMFER)
    X.7Z=-[V105]
    G91
    Z=-[V102]
    G90
    N575
    IF [V100 GE V101] GOTO N585
    G1X.752F.001
    G0X.7
    G91
    Z=-[V107]
    G90
    V100=[V100+1]
    GOTO N575

    N585
    V100=0.0
    (M6)
    G0X.65
    Z.5
    (M7)
    G0X20.0Z20.0
    M01


    N600 (FACE TURN + CUTOFF*)
    VZSHZ=0.0 (W.SHIFT SAFETY)
    N625
    IF [V100 GE V101] GOTO N650
    T0404 (ISCAR 35DEG FR. TURN .004R IC20)
    G50S3000
    G96S600M3
    G0X.675Z.1
    (M6)
    Z.02
    G1Z0.0F.001
    (M7)
    X.7843
    X.809Z-.0123
    Z-.0302
    X.796Z-.0367
    Z-.054
    G2X.818Z-.065L.011
    G1X.8483
    X.859Z-.0703
    Z-.0987
    X.8436Z-.1064
    G0X.9
    Z2.5
    G0X20.0Z20.0


    (CUTOFF)
    M77(PARTS CATCHER ADVACE)
    T0808 (MAXBAR .031 CUTOFF)
    G0X.950Z.5
    (M6)
    Z=-[V107]
    (M7)
    G1X.660F.0015
    G0Z.01
    G0X.950
    G0Z2.5
    VZSHZ=[VZSHZ-V107] (WORKSHIFT)
    V100=V100+1
    GOTO N625
    N650
    VZSHZ=0.0 (RESET W.OFFSET)
    V100=0.0
    G0X20.0Z20.0


    M76(PARTS CATCHER RETRACT)
    M05
    V198=[V198+V101] (PART COUNT)
    V199=[V199+1] (FEED COUNT)
    IF [V199 GE V109] GOTO N1000
    GOTO N1500

    N1000(BAREND SEQUENCE)
    M84 (COLLET OPEN)
    V199=0.0 (RESET FEED COUNT)
    VUACM[1]='REPLACE BAR'
    MSG (REPLACE BARSTOCK)
    VDOUT[992]=1

    N1500
    /GOTO N50
    M30

  9. #9
    Join Date
    Jun 2015
    Posts
    4154

    Re: Fanuc lathe guy trying to learn Okuma-Please help me

    okey dokey


    that code is long and nasty ... if it works, keep it

    i don't have the patience to understand it, but if you wish for an opinion, just post your part

Similar Threads

  1. Replies: 1
    Last Post: 11-01-2022, 11:56 AM
  2. Okuma Lathe Fanuc parameter list
    By pacific51 in forum Okuma
    Replies: 1
    Last Post: 06-11-2015, 04:02 PM
  3. Okuma lathe with fanuc control Z alarms
    By rob jerico in forum Fanuc
    Replies: 2
    Last Post: 07-18-2013, 06:22 PM
  4. okuma LNC-8 cadet lathe with fanuc control
    By rob jerico in forum Okuma
    Replies: 10
    Last Post: 02-16-2012, 07:45 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
  •