Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

Calling A Pallet using Mastercam


Recommended Posts

I have a customer that has the ability to call the pallet number based off of a Mcode. M60 is a standard pallet change and M61 is Pallet #1 and M62 is Pallet #2.

 

I looked around in the generic posts and even Mpmaster and see no thought given to this. I looked up old topics and such and must have missed one that laid this out so I thought I would share this for others.

 

 

BEFORE ATTEMPTING ANY POST MODIFICATION BACK UP YOUR POSTS, MACHINE AND CONTROL DEFINITION. USE THIS AT YOUR OWN RISK!!!!!

 

Okay disclaimer out of the way lets start the process. Using the latest Mpmaster since this is In-House's web site here is what I did.

 

I decided to use mi3 as the trigger since it was not used by the post. We have to decide how we want to handle this. I like 0 as my default which will trigger M60 if it is turned on to be used. We need to define that using our control definition for Mpmaster. By doing this through the control definition the correct way we know it updates our associated Machine Definition as well.

 

 

MachineDefintion_zpsb5ff2f4a.png

 

MDtoCDthroughMD_zps2accf41a.png

 

CDMiscTextChange_zps037b668d.png

 

ChangingTextinMisc_zps5bd98d03.png

 

mi3Changefortextseen_zpsf397901e.png

 

We need to change the post to support the use of mi3 for this process. Under Mirc Variables section of the post define the sav_mi3 since we will be suing it for error checking.

 

#Misc variables
sav_mi3 : 0	 #Store mi3 value for error checking on pallet call

 

In the error messages on the post add the output statement for this function if used wrong. Meaning if you have pallet 1 called and call it again the system will alert you of this error and if done the other way will error out.

 

# --------------------------------------------------------------------------
# Error messages
# --------------------------------------------------------------------------
spalleterror : "ERROR - CANNOT USE SAME PALLET NUMBER AT START AND END OF PROGRAM"

 

We need to define our string to use this process. I like using strings for this process, but hard coded values for output would work as well. I placed this one under the Table Rotations strings in Mpmaster

# --------------------------------------------------------------------------
# Pallet Call Process using mi3
spallet_0 : "M60 (PALLET CALL)" #Pallet Call Standard
spallet_1 : "M61 (PALLET #1 CALL)" #Pallet Call for Pallet #1
spallet_2 : "M62 (PALLET #2 CALL)" #Pallet Call for Pallet #2
spallet : ""	 #Target for string
fstrsel spallet_0 mi3$ spallet 3 -1

 

We need to put the call statement for this in the bottom of our pheader$ section of the post:

 

pheader$		 #Call before start of file						
 hour = int(time$)
 min = int((time$ - hour)* 100)
 if hour > 12, hour = hour - 12
 if hour = 0, hour = 12
 year$ = year$ + 2000
 "%", e$
 spaces$=0
 if progno$ = 0, progno$ = 1234 # Added so there is never a program number Zero
 *progno$, " ", scomm_str, sprogname$, scomm_end, e$
 spathnc$ = ucase(spathnc$)
 smcname$ = ucase(smcname$)
 comment$ # File descriptor
 spaces$=0
 #scomm_str, "PROGRAM NAME - ", sprogname, scomm_end, e
 #scomm_str, "DATE=DD-MM-YY - ", date, " TIME=HH:MM - ", time, scomm_end, e
 #scomm_str, "MASTERCAM - V", *vers_no$, scomm_end, e$
#	 scomm_str, "MASTERCAM - X", scomm_end, e$
 scomm_str, "MCX FILE - ", smcpath$, smcname$, smcext$, scomm_end, e$
 if spostname_sav = snull, spostname_sav = spostname
#	 scomm_str, "POST	 - ", snamepst$, scomm_end, e$
 #scomm_str, "MP	 - V", *dll_vers$, scomm_end, e$
 stck_matl$ = ucase(stck_matl$)
#	 scomm_str, "MATERIAL - ", stck_matl$, scomm_end, e$
 scomm_str, "PROGRAM - ", sprogname$, sextnc$, scomm_end, e$
 scomm_str, "DATE	 - ", *smonth, "-", *day$, "-", *year$, scomm_end, e$ # MON-DD-YYYY
 #scomm_str, "DATE	 - ", *year$, "/", *month$, "/", *day$, scomm_end, e$ # YYYY/MN/DD
 #scomm_str, "DATE	 - ", *day$, "/", *month$, "/", *year$, scomm_end, e$ # DD/MN/YYYY
 #scomm_str, "DATE	 - ", date$, scomm_end, e$							 # DD-MM-YR
 scomm_str, "TIME	 - ", *hour, ":", *min, [if time$ < 12, " AM"], [if time$ >= 12, " PM"], scomm_end, e$ # 12 hour
 #scomm_str, "TIME	 - ", time$, scomm_end, e$ # 24 hour
#	 scomm_str, "POST DEV - ", *slicense, scomm_end, e$
 spaces$=sav_spc
 if seqno$ = 0, omitseq$ = yes$
 sav_progno = progno$
 if tseqno = 1 & omitseq$ = 1,
 [
 seqno$ = 1
 seqinc$ = 1
 n$ = seqno$
 ]
 sav_rot_on_x = 0
 header = 0
 pallet, e$ #Added for Pallet Call Logic

 

Then also at the end of for the code to come out:

peof$		 #End of file for non-zero tool		
 pretract
 if lock_codes = one & rot_on_x, pbld, n$, *sunlock, sunlockcomm, e$
 rotretflg = 1
# pbld, n$, *sg28, "X0.", "Y0.", protretinc, e$
 pbld, n$, *sg28, "Y0.", protretinc, e$
 rotretflg = 0
 if lock_codes = one & rot_on_x, pbld, n$, *slock, slockcomm, e$
 comment$
 if not(index), n$, *sg90, e$
 pallet, e$ #Added for Pallet Call Logic
 n$, "M30", e$
 mergesub$
 clearsub$
 mergeaux$
 clearaux$
 "%", e$
 #Multi-post logic
 spath_in = spathnci$ + snamenci$
 spath_set = spathpst$ + sset
 spath_out = spathnc$ + snamenc$ + sextdoc
 sparams = ssq + sdq + spath_in + sdq + sspace + sdq + spath_set + sdq + sspace + sdq + spath_out + sdq + ssq

 

Then we add the logic, error checking and outputting section into our post. I placed this after the pgear secton of the post:

pallet		 #Call the Pallet Number from the mi3$ Varaible.
 if mi3$ = 0, *spallet
 else,
	 [
	 if mi3$ = sav_mi3, result = mprint(spalleterror) #Added for error checking
	 else, *spallet
	 ]

 

Now you should have a process where in the 1st operation you use the mi3 for the pallet you want called and in the last peration you put in the mi3 value for the next pallet. If you use the 0 to call M60 you will not get an error, but if you use 1 or 2 and repeat that value then the post will tell you there is an error and not output the last one. You could make it a fatal error with exitpost$, but I did not think that was needed.

 

Hopefully this will help someone and can be of benefit for anyone trying to add or make changes to their post. I am not expert and I again and open to anyone pointing out my mistakes or things I missed.

  • Thanks 1
  • Like 2
Link to comment
Share on other sites

I setup our posts to use the call for pallet 1 if the work offset (extended) is 1-24 and pallet 2 if it's 25-50. We have an assigned M code (M500) that calls the subprogram with a pallet check (checks a system variable to validate the pallet number) and safety lines for the pallet change routine. We assign a C value for the pallet along with the m code.

 

So M500 C1 for work offset 1-24 and M500 C2 for work offsets 25-50. Very safe and you don't have to set Misc Integers.

 

Just another idea.

 

-Josh

 

%

O9020(PALLET CHECK)

G5.1Q0

IF[#3GE1]GOTO70

#3=#3*10000

N70

IF[#147EQ#3]GOTO71

(M60 PALLET CHANGE)

(SET 6072=60)

#3003=1

#33=#4003

G0G91G30Z0

G30X0Y0M11

G28B0M10

M60

G#33

#3003=0

IF[#147EQ#3]GOTO71

#3006=1(PALLET # OUT OF RANGE)

N71

M99

%

Link to comment
Share on other sites

Ron, I have something similar to what you are doing in our Makino post.

But I use the misc int for each and every operation. That way, I can force a pallet change any time I want. I also have logic for pallet confirmation codes M84 and M95 as a safety in the program.

I also flag the pallet numbers and check so that a pallet number cannot change during a null toolchange.

If the pallet number changes during a null toolchange, the post issues a

spalerror2  : "Error - you can only change pallets at a tool change!"

error and exits post

Link to comment
Share on other sites

Robert, I was thinking about adding that Logic, but these parts they are doing on not in cell system just a basic machine with only 2 pallets so the parts are complete in 1 operation so the idea is once they start a part they need to finish it once it is in the machine. That said I think I will add that logic to the post to give them more than what they paid me for. :laughing:

Link to comment
Share on other sites
  • 4 months later...

I use called pallet rotations regularly but depending on the "system" choice they're used differently. Most of the time pallet A is process No.1 and pallet B is process No.2. For "flippers" on vises or reclamping on tombstones the process is 1 on A, 1 on B, 2 on A, 2 on B. The way there used for each current work order is controlled by the operators through variables.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...