585,996 active members*
4,222 visitors online*
Register for free
Login
Results 1 to 8 of 8
  1. #1
    Join Date
    Jun 2008
    Posts
    1511

    Custom G codes in Custom G codes

    Gents,
    I have a custom G code set to call program 9018 for setting my tool height and diameter data. In program 9018 I have a subprogram call to call program 7000 were all my speeds and feeds are set for each tool. In this program I have a custom G code to call 9014 so it bounces through 7000 until it matchs to tool speed and feed to the tool in the spindle.

    When it hits the G-code in 7000 it alarms out with PS010 IMPROPER G-CODE. Any of these two G-codes when called in MDI work properly. Is the problem that I am calling a custom within a custom?? Or is this an option because the alarm description also reads "Also occurs if a G-code corresponding to a non-additional option was specified"?

    I am running a Fanuc 15MF

    Stevo

  2. #2
    Join Date
    Jan 2007
    Posts
    91
    "calling a custom within a custom"
    In your custom, can you just call the program # instead of the G code?

  3. #3
    Join Date
    Jun 2008
    Posts
    1511
    It's a bit more complicated then that. I have a program 7000 which is my speed and feed program. G500 is set to call program 9014

    O7000-------------------the N1 and N2 are tool 1 and tool 2. I shortened it from 50 tools but you get the idea.
    N1G500F.6S300
    N2G500F1.2S1200
    N999M99

    O9014
    IF[#535EQ#4114]GOTO1------looks at modal T call to see if it matchs modal N
    M99
    N1F#9S#19
    M99P999

    These 2 programs working together will scan through program 7000 until the tool number in the spindle matches the N address then sets that speed and feed and end all programs. I typically have the M98P7000 in my tool change program. Works great. No setting of speeds and feeds and the H value is set in the toolchange macro. No mistakes.

    My problem is with 1 machine. Some idiot decided to write the ladder so it alarms out when you try calling the tool that is currently in the spindle. So from op1 to op2 if you use the same tool you can not do a M6 call. This eliminates being able to set the H in the tool change macro and the speeds and feeds. I created a G69 to call program 9018 that sets the tool length. So if we use the same tool instead of a T1M6 which will alarm out you just program G69. However I need my S&F's as well so in the end of the 9018 program I call M98P7000 and this will collect my S&F's. But in 7000 I have the G500 call so 7000 can be scanned but it alarms out on the G500.

    This is my typical tool change program. It might help understand.

    O9006
    #20=#4120----modal T
    G40G80
    IF[#20EQ#535]GOTO1----skip M6 if tool called is in the spindle
    G91G28Z0M9
    G28Y0M5
    M6
    N1
    G90G49Z#5043
    #536=#21
    #537=#[2000+#20]+#[2200+#20]----Gets tool geometry
    G43Z[#5043-#537]H#20--------------sets H with NO movement of the tool (pretty slick)
    M98P7000----------------------------calls 7000 to bounce back and forth between 7000 and 9014 to get S&F's
    M99

    Now that I can't use my tool change program at every op or drill macro I had to set up the 9018 tool geometry instate.

    Stevo

  4. #4
    Join Date
    May 2007
    Posts
    1003
    stevo, this is probably a stupid question as I am only familiar with the O, 18T and 21i controls (for lathes), but can you use G500? I can only use to G255 on the controls I'm familiar with. I know the 15 for sure and maybe the 11 controls have more options than the lathe controls I am use to. Maybe all mill controls have more options than the lathe ones. I don't know. Just an idea. Most likely a useless one.

  5. #5
    Join Date
    Jun 2008
    Posts
    1511
    Thanks for the thought. I can use the G500. It works when just programming a G500 in MDI. It also works when I run a program with G500 in it. It just won't run in a program that I call up using another custom G-code. I have also tried using different G-codes other than G500. Still no go.

    Thanks,
    Stevo

  6. #6
    Join Date
    Nov 2006
    Posts
    175
    You can not command G code calling custom macro inside a program, called itself by another G code. But you can use G65Pxxxx without any problems inside your 9014

  7. #7
    Join Date
    May 2007
    Posts
    1003
    Quote Originally Posted by stevo1 View Post
    Thanks for the thought. I can use the G500. It works when just programming a G500 in MDI. It also works when I run a program with G500 in it. It just won't run in a program that I call up using another custom G-code. I have also tried using different G-codes other than G500. Still no go.

    Thanks,
    Stevo
    Re-read your post and see where you said they both work in MdI. My bad. Sorry.

  8. #8
    Join Date
    Jun 2008
    Posts
    1511
    no worries gcoder. I have changed it from G69 to a M69 call then using the G500. It now works fine. I just wanted to try and keep them all the same.

    Thanks guys for all the input.

    Stevo

Similar Threads

  1. help using custom M codes and M-FIN on haas
    By josh591 in forum Haas Mills
    Replies: 8
    Last Post: 08-26-2017, 02:40 PM
  2. 417 & 427 codes
    By chetohead in forum CNC (Mill / Lathe) Control Software (NC)
    Replies: 0
    Last Post: 04-30-2008, 08:40 PM
  3. Custom bending a custom extrusion
    By brokenrinker in forum Bending, Forging, Extrusion...
    Replies: 10
    Last Post: 12-15-2007, 03:28 PM
  4. M-codes and G-codes 4 Matsuura ES-1000V
    By maximusek in forum G-Code Programing
    Replies: 2
    Last Post: 11-27-2007, 01:41 PM
  5. Need help with G codes
    By soldier in forum G-Code Programing
    Replies: 2
    Last Post: 11-23-2007, 06:38 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
  •