585,768 active members*
4,188 visitors online*
Register for free
Login
Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2011
    Posts
    0

    Macro calls with custom M/G coes

    I'm on a 18i-M here. I added lots of subs/macros I had from another control. They are assigned to G/M codes (through parameters 6000+).

    The problem is some work, some don't. It seems that those not working are those assigned to M/G codes that execute special functions provided by the machine builder, such as: tool change, pallet change, door open/close, etc.
    What happens in these cases is that the M/G codes dont' call my macros, the just ignore them perform their original function.

    For instance I have M13 (spindle start+coolant start) and M6 (tool change) mapped to subs (O9001 and O9002). The parameters to achieve this are undoubtly set correctly. M13 does call my sub, M6 does the normal tool change ignoring my sub.

    I can only speculate this is related to the way the machine builder programmed their M functions in the PLC, somehow interfering with the CNC's custom macro detection routine. Or maybe some option needs to be enabled.

    Any input would be appreciated. Thanks.

  2. #2
    Join Date
    Aug 2009
    Posts
    684
    So no system folder macros were originally in the memory before the ones you added - and no code appears on-screen during the said functions? If that is the case your hunch is probably correct.

    What are the built-in routines lacking that you need to add?

    One option would be to assign a new number to your macro with the original M-code called within it.

    If that approach fails, I recall that there is a parameter for calling a g-code macro within a g-code macro, maybe there is something similar for M-codes?

    DP

  3. #3
    Join Date
    Apr 2011
    Posts
    0
    Thank you for your response.

    What are the built-in routines lacking that you need to add?
    I need them to set common variables so the program can know which tool is on the spindle, which pallet is loaded, etc. (as far as I know the PLC data tables that store this information can't be read directly by the program) Also, the tool change sub automatically loads compensation data (G43, H, D codes). I can use different numbers (M66 instead of M6 for instance) but if, when programming, I forget and use the original number, I'll easily damage something. Also, I'd like to keep the codes consistent with my other machines.

    If that approach fails, I recall that there is a parameter for calling a g-code macro within a g-code macro, maybe there is something similar for M-codes?
    If that is really possible it would be very useful (but I can't see how it could help for this specific issue...). But I couldn't find how to do it, neither in the parameter manual nor in the little information about the "secret" parameters that I could find on the net.

  4. #4
    Join Date
    Aug 2009
    Posts
    684
    I must confess my experience using custom macro variables is limited to one machine, and the control it uses is 31i - I have, however, done quite a bit of delving myself to add further functionality and automate things like pallet change (I set it up to determine the current pallet positions and automatically load Pallet 1 for work offsets 1-24, and Pallet 2 for 25-47).

    I found that things like spindle head tool and pallet proximity switch status were stored in exec macros #1000 - #1035. So, assuming your control does something similar maybe you could get around the issue - say I wanted to call the offsets for the spindle tool automatically, and I couldn't use M6, I might put a G43 H#1035 D#1035 into an M3 linked macro.

    DP

Similar Threads

  1. Custom Macro Containing G65
    By LostInMacro in forum Fanuc
    Replies: 20
    Last Post: 09-15-2010, 09:21 PM
  2. Custom Macro B
    By rlgx4 in forum Parametric Programing
    Replies: 7
    Last Post: 08-02-2010, 10:05 PM
  3. "difference between Custom Macro A and Custom Macro B"
    By arulthambi in forum Parametric Programing
    Replies: 4
    Last Post: 10-05-2009, 09:34 PM
  4. Custom Macro B On A 18t.
    By JIMMYZ in forum Fanuc
    Replies: 3
    Last Post: 10-19-2006, 04:08 AM
  5. custom macro
    By The Metal in forum Daewoo/Doosan
    Replies: 2
    Last Post: 09-28-2006, 01:26 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
  •