587,990 active members*
5,585 visitors online*
Register for free
Login
Results 1 to 8 of 8
  1. #1
    Join Date
    Feb 2011
    Posts
    0

    macro for verification

    Hi,

    We have a horizontal machining center that runs the same part on two different machine tables. So the machine has a shuttle and shuttles one table in, runs the part, shuttles the other table in, runs a like part but different fixture, then starts over.

    The problem we have is when someone starts the program over it could pick up the wrong work offsets (we've tried to make the work offsets the same between the two pallets so we wouldn't have to worry about that, etc., but to no avail).

    There has to be a way that you could write some macros that would direct the program to the correct work offsets. Using common variables or some other kind of variables, I don't know. Something like IF#101EQ1GOTO900 (2nd set of work offsets). So that could be at the beginning of the program, with work offsets for both parts at the beginning of the program, it would jump over the one it doesn't need. Then I only have to have one program. Then at the bottom of the program it can activate a "counter" or something that switches the 1 to a zero. Does that make any sense or am I crazy? Can anyone give me some direction with this?

    Any help is appreciated. Thanks.

  2. #2
    Join Date
    Feb 2011
    Posts
    0
    I'm going to do something like this:

    (AT BEGINNING OF PROGRAM

    N30M#100
    N40G90G94G20G0
    N50IF[#100EQ46]GOTO140
    N60IF[#100NE45]GOTO210
    N70G90G94G20G0
    N80(TABLE--1)
    N90G10L2P1X0.000Y-24.0920Z-20.5150B0.000
    N100G10L2P2X0.0000Y-24.0920Z-20.5150B0.000
    N110G10L2P3X0.0Y-24.0920Z-20.5150B0.000
    N120G10L2P4X0.0Y-24.0920Z-20.5150B0.000
    N130GOTO220
    N140G90
    N150(TABLE--2)
    N160G10L2P1X0.000Y-24.0920Z-20.5150B0.000
    N170G10L2P2X0.0Y-24.0920Z-20.5150B.000
    N180G10L2P3X0.0Y-24.0920Z-20.5150B0.000
    N190G10L2P4X0.0000Y-24.0920Z-20.5150B.000
    N200GOTO220
    N210(COMMON-VARIABLE-ERROR)


    (AT END OF PROGRAM

    N2060G90
    N2070G10L2P1X0Y0Z0B0
    N2080G10L2P2X0Y0Z0B0
    N2090G10L2P3X0Y0Z0B0
    N2100G10L2P4X0Y0Z0B0
    N2110#100=[#100+1]
    N2120IF[#100LE46]GOTO2140
    N2130#100=45
    N2140M160
    N2150M99

  3. #3
    Join Date
    May 2004
    Posts
    4519
    I did not try to go through your macro, but will say this: Write your macro so that it reads in the pallet number and then sets offsets based on a the pallet number. Write the offsets into sub programs. Logic: If pallet number equals 1 run sub program for offsets for pallet 1.

  4. #4
    Join Date
    Aug 2011
    Posts
    2517
    or if current program is for pallet 1 but pallet 2 is loaded your checking macro could bring up a custom alarm (using macro) to tell the operator the wrong pallet is loaded.

  5. #5
    Join Date
    Oct 2007
    Posts
    9
    your program seems logical, we use something similar. Not sure what the GOTO220 line is for, I am not seeing line 220. You could also try looking up what parameter your machine is using to transfer the pallet number and just read from this to make sure the correct offsets are loaded.
    If your need to test it just manually cycle the pallets in and run this program by it self, after check the work offsets to make sure they are what you expect.

  6. #6
    Join Date
    Aug 2009
    Posts
    684
    Surely your work-offset/pallet check macro should be repeated at EVERY conceivable start position in the program? There are many scenarios where either one needs to rework the previous part or the wrong program is inadvertantly run after a minor distraction. I would suggest the following format for your programs: -

    Nnum (Description of Operation);
    CHECKING MACRO HERE;
    TOOL CALL NEXT;
    M1;
    CYCLE;
    RETRACT;
    M0/M1;
    ;

    Repeat for each process in this fashion 'til the end of the program. This is what Mr Bill angelw describes as each process being a self-contained program. Only use the N-number at the first line and all operators can restart from any N-number without fear. Put the optional stops in regardless (sometimes when the buzzer goes its nice to be able to leave machine unmanned and know it will stop before the next bit).

    DP

  7. #7
    Join Date
    Aug 2011
    Posts
    2517
    that's a good idea but the program can get very long if there are many N sequences and the macro is included at each N.
    it would be better to have the macro called as a custom M code (say M59)

    N1 M59
    (rest of program here)

  8. #8
    Join Date
    Sep 2010
    Posts
    1230
    Quote Originally Posted by pwilson101 View Post
    (AT BEGINNING OF PROGRAM

    N30M#100
    N40G90G94G20G0
    N50IF[#100EQ46]GOTO140
    N60IF[#100NE45]GOTO210
    Hi Paul,

    The safest method is to determine which pallet is being called into the machine and being able to determine the current pallet at any time.

    In most instances, you will be able to Read an Interface Input Signal that is associated with a switch input for each pallet. If this is available, there should be some reference to the Interface Input Point in the documentation for the machine. If no such information is available, you can get the Input number by reading all 32 input points when each pallet is called and compare the difference between the values to determine the decimal value for each. Once you know this information, the Macro algorithm is simple. You merely use Bit Wise "AND" as follow

    Lets say that the Decimal Value of the Interface Input Signal for one of the pallets is 16, then to determine if this signal is on, the following could be used.

    IF [16 AND #1032] GOTO100 (N100 being the program area for that particular pallet)

    In your program listing, #100 will have to be set the desired Pallet Call M Code for each particular Pallet. I can see problems using the method as shown in your program if you had to start the program any where other than where the pallet is called.

    If an Interface Input is not available, another method will be to set a Common Variable based on the Pallet Call code. A method based loosely on your listed method, is to register the numbers 45 and 46 in the parameters that are associated with Macro Program Numbers called via M Code. For example, with a Series 12 control, if 45 is registered in parameter 7071, program number O9001 will be called when M45 is executed. In O9001, the number 45 could be stored in an available, Non-Volatile, Common variable (=> #500) and M45 is executed to call the pallet; an M code in a Macro called by a G or M code is treated like a normal M code and will not call another iteration of the Macro. By storing the Pallet M code in Non-Volatile Common Variable, the current Pallet number will be retained even when the power to the machine is turned off. The only limitation here is if a manual pallet change is made, where the Common Variable is not updated. However, the next time a pallet is called via program or MDI, the number stored in the Common Variable will be made correct again.

    If an Interface Input is available, this is the safest method of all, as its based on an Input Signal and not on a code that may or may not have been executed (manual pallet change with no code)

    For safety sake, and to make the program easy to repeat any particular tool, a Conditional Macro statement can be included after each tool change to query the current pallet. Even with a program having a large number of tool calls, the program size would only be increase by a couple of blocks per tool change.


    Regards,

    Bill

Similar Threads

  1. Dimension's Verification
    By jerrywi in forum Momus Design CNC plans
    Replies: 2
    Last Post: 02-02-2012, 01:35 AM
  2. 4tt axis verification
    By cuyeyo in forum Mastercam
    Replies: 6
    Last Post: 11-19-2011, 06:22 PM
  3. Toolholder verification
    By mastercamrookie in forum Mastercam
    Replies: 7
    Last Post: 02-22-2011, 01:29 PM
  4. Sharing a tool offset verification macro
    By dpuch in forum Parametric Programing
    Replies: 0
    Last Post: 08-02-2010, 09:46 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
  •