586,594 active members*
3,030 visitors online*
Register for free
Login
Results 1 to 9 of 9
  1. #1
    Join Date
    Oct 2010
    Posts
    134

    Illegal G code on a 30i

    Hi all,

    I'm writing a macro on a jig grinder and getting this alarm,
    here's the end of the macro and it would be very appreciate
    if somebody could comment.
    Thanks


    G54
    bla bla .....
    G51.1 X0 (mirror image on)
    move here
    move here
    M5
    G50.1 (cancel mirror)
    G17G40G80G90 (alarm is on at this line, and without this line, no change)
    G91G28Z0 (tried G53 Z0, no change)
    M30

  2. #2
    Join Date
    Feb 2009
    Posts
    6028

    Re: Illegal G code on a 30i

    Macros end with M99, not M30 AFAIK.

  3. #3
    Join Date
    Mar 2003
    Posts
    2932

    Re: Illegal G code on a 30i

    Illegal G-Code often means the option is not installed. You might post the whole segment between the G51.1 and the G50.1 just to be sure there's now illegal commands while the G51.1 is active/

    "In programmable mirror image mode, G codes related to reference
    position return (G27, G28, G29, G30, etc.) and those for changing the
    coordinate system (G52 to G59, G92, etc.) must not be specified. If
    any of these G codes is necessary, specify it only after canceling the
    programmable mirror image mode."

  4. #4
    Join Date
    Oct 2010
    Posts
    134

    Re: Illegal G code on a 30i

    Thanks dcoupar, here's the segment of the program and
    if I run it like this, it will stop at line "G91G28Z0" even with G50.1 before that line.
    Does that mean the mirror is not really canceled?

    And sorry for some french in the macro.

    G51.1 Y0.0 (MIRROR)
    G01 X=#508 Y=#512 F100.0 (APPROCHE X ET Y)
    GOTO25
    N20

    M01 (OPTIONAL STOP POUR CHAQUE PASSE GRINDING)

    N25

    G01 Z#516 F100.0 (DEGAGEMENT Z)
    G01 X=#508 Y=#512 F100.0 (APPROCHE X ET Y)
    /M20 B0 (Z CHOPPING ON)

    /2 G01 Z#520 F100.0 (START Z SI PAS DE CHOPPING)

    GOTO40

    N30

    G01 X=#508 Y=#512 F100.0 (APPROCHE X ET Y POUR FORM CHECK)
    G01 Z#544 F100.0 (START Z POUR CHECK SHAPE)
    F#552 (FEED POUR CHECK SHAPE)
    D0 (COMPENSATION ANNULER)
    GOTO1 (VA A LA FORME)

    N40
    F#548 (FEED POUR GRINDING)
    D10 (ACTIVE COMPENSATION TOOL #10)
    GOTO1 (GO TO SHAPE)

    N50 (BACK FROM SHAPE)

    IF[#540EQ1]GOTO70 (SI POUR CHECK SHAPE VA LIGNE 70)
    IF[ABS[#103-#528]LT0.00001]GOTO60 (IF NO MORE CUT GOTO 60)
    #103=[#103-#532] (DECREMENTER COUPE DEPART)
    #2610=#103 (UPDATE WEAR #10)
    GOTO20 (LOOP FOR ANOTHER PASS)

    N60

    IF[#536EQ0]GOTO65 (SI PAS DE FREE CUT VA N65)
    IF[#106EQ#536]GOTO65 (SI FREE CUT TERMINER VA N65)
    #106=[#106+1] (INCREMENTER NB FREE CUT)
    GOTO20 (FOR FREE CUT)

    N65

    M5
    M15 (PLANETARY OFF)
    /M21 (CHOPPING OFF)
    M26 (DUST COLLECTOR OFF)
    G50.1 (CANCEL MIRROR)
    N70
    G91G28Z0
    G17G40G80G90
    D0 (DESACTIVE COMP. TOOL#10)

    M30

  5. #5
    Join Date
    Mar 2003
    Posts
    2932

    Re: Illegal G code on a 30i

    Quote Originally Posted by Tancuda View Post
    Thanks dcoupar, here's the segment of the program and
    if I run it like this, it will stop at line "G91G28Z0" even with G50.1 before that line.
    Does that mean the mirror is not really canceled?

    And sorry for some french in the macro.

    G51.1 Y0.0 (MIRROR)
    G01 X=#508 Y=#512 F100.0 (APPROCHE X ET Y)
    GOTO25
    N20

    M01 (OPTIONAL STOP POUR CHAQUE PASSE GRINDING)

    N25

    G01 Z#516 F100.0 (DEGAGEMENT Z)
    G01 X=#508 Y=#512 F100.0 (APPROCHE X ET Y)
    /M20 B0 (Z CHOPPING ON)

    /2 G01 Z#520 F100.0 (START Z SI PAS DE CHOPPING)

    GOTO40

    N30

    G01 X=#508 Y=#512 F100.0 (APPROCHE X ET Y POUR FORM CHECK)
    G01 Z#544 F100.0 (START Z POUR CHECK SHAPE)
    F#552 (FEED POUR CHECK SHAPE)
    D0 (COMPENSATION ANNULER)
    GOTO1 (VA A LA FORME)

    N40
    F#548 (FEED POUR GRINDING)
    D10 (ACTIVE COMPENSATION TOOL #10)
    GOTO1 (GO TO SHAPE)

    N50 (BACK FROM SHAPE)

    IF[#540EQ1]GOTO70 (SI POUR CHECK SHAPE VA LIGNE 70)
    IF[ABS[#103-#528]LT0.00001]GOTO60 (IF NO MORE CUT GOTO 60)
    #103=[#103-#532] (DECREMENTER COUPE DEPART)
    #2610=#103 (UPDATE WEAR #10)
    GOTO20 (LOOP FOR ANOTHER PASS)

    N60

    IF[#536EQ0]GOTO65 (SI PAS DE FREE CUT VA N65)
    IF[#106EQ#536]GOTO65 (SI FREE CUT TERMINER VA N65)
    #106=[#106+1] (INCREMENTER NB FREE CUT)
    GOTO20 (FOR FREE CUT)

    N65

    M5
    M15 (PLANETARY OFF)
    /M21 (CHOPPING OFF)
    M26 (DUST COLLECTOR OFF)
    G50.1 (CANCEL MIRROR)
    N70
    G91G28Z0
    G17G40G80G90
    D0 (DESACTIVE COMP. TOOL#10)

    M30
    Tankuda,

    The first block under N50 jumps to N70 if #540=1. This skips the G50.1 then calls a G28. This might be a problem.

    Dave

  6. #6
    Join Date
    Oct 2010
    Posts
    134

    Re: Illegal G code on a 30i

    Thanks dcoupar

    Yes you're right, but my variable #540=0, so no jump, but I'll fix that because my variable could be 1,
    and I just tried cancelling my mirror with G50.1 Y0.0 instead of just G50.1 and its fine !!!!
    Any idea why??

    Thanks again.

  7. #7

    Re: Illegal G code on a 30i

    I believe when you specified which axis to mirror you also have to specify which axis to cancel the mirror. As you could have more than one axis running mirror images at the same time. The controller needs to know which axis you want to cancel the mirror image with G50.1

  8. #8
    Join Date
    Oct 2010
    Posts
    134

    Re: Illegal G code on a 30i

    Thanks guys,

    If I write G51.1 Y0.0 it will mirror on X axis !! Normal ??

    And if I write G51.1 Y1.0, do I have to cancel with G50.1 Y1.0 or Y0.0 ?

  9. #9
    Join Date
    Feb 2006
    Posts
    1792

    Re: Illegal G code on a 30i

    G50 does not require any argument, but G50.1 does require it.
    G51.1 and G50.1 should both have the same argument (the axis of symmetry).

Similar Threads

  1. 065 Illegal Command in G71-G73
    By ReacerX427 in forum Fanuc
    Replies: 6
    Last Post: 01-20-2015, 10:52 AM
  2. Illegal I,J, or K
    By Kool Parts in forum Haas Lathes
    Replies: 10
    Last Post: 01-07-2013, 09:32 PM
  3. coupling device illegal
    By korte1 in forum Okuma
    Replies: 9
    Last Post: 09-21-2010, 09:12 PM
  4. 065 Illegal command in G71-G73
    By jdgromi in forum Fanuc
    Replies: 4
    Last Post: 12-15-2008, 08:45 PM
  5. 032 illegal offset value in G10
    By mr-seiki in forum Mori Seiki lathes
    Replies: 7
    Last Post: 10-15-2008, 08:11 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
  •