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:

Little help on macro code


BBprecise
 Share

Recommended Posts

Ok, here's the situation we have a high qty job and currently we manually advance the stock to a turret bump on every part and collect the part that was just parted off. Well operators can't make quoted time so we're going to add a 2 finger bar puller. We can't just let program run in a loop and hope the operator is paying attention enough to see when he's chucking on to little material. We also can't run a whole bar at once because of in-process inspection. Supervisor has told me they can get 43 parts per bar and operator has to check 1 in every 4 parts and feels comfortable enough to be able to run 8 parts before collecting them from machine to inspect and package.

Just would like someone to proof read my code to make sure it's work and makes sense so here it is,

Start of program

(#510 PART COUNTER FOR NUMBER OF PARTS TO RUN BEFORE COLLECTING)
(#511 IS INCREMENT AMOUNT WHICH WILL BE ONE)
(#512 IS HOW MANY PARTS TO RUN BEFORE COLLECTING)
(#513 NUMBER OF PARTS ON CURRENT BAR)
(#514 NUMBER OF PARTS TO MACHINE PER BAR)

MACHINE PART

#513=#513+#511
#510=#510+#511
IF[#513EQ#514]GOTO200
IF[#510EQ#512]GOTO300
GOTO400

N200M0(LOAD ANOTHER BAR)
#513=0(RESET BAR COUNTER)
IF[#510EQ#512]GOTO300
G0TO400

N300M0(COLLECT PARTS)
#510=0(RESET 8 COUNT)

N400M99

I like to put an explain what each variable is at the start of the program for my benefit. Only myself and the supervisor is allowed to change the variables in the control and what to set each one when job is set up will be on the setup sheet.

#510 will be set to 0.

#511 will be set to 1.

#512 will be set to 8.

#513 will be set to 0.

#514 will be set to 43.

 Any suggestions will be helpful.

Now how many of you started singing the 1st few words to the music of Parents just dont understand by The Fresh Prince? LOL

Thanks.

Link to comment
Share on other sites

Lets assume Z0 is 3" from face of chuck jaws and after part is parted off face of stock is 2" from jaws. When job is set up operator will put stock so face is a bit more then 3" from jaws.

Right now my bar puller is the very 1st tool in the program and my concern is that if the operator puts the new bar in the same location (3" from jaws) as when job was set up and the bar puller then runs it will advance stock another 1" and the 1st tool will rapid right into the stock (😡). Now I could put directions on setup sheet for the operators to locate new bars 2" from jaws, bu I can guarantee that at some point somebody wont read all of the information and still put the new bar 3" from jaws.

So at the beginning of the program should I put,

IF[#513EQ0]GOTO2 (N1 is the bar puller sequence)

This way regardless of whether operating is setting up job or a new bar is loaded the program will skip the bar puller sequence, and the setup sheet will have directions to set every bar 3" from jaws which should eliminate confusion and hopefully a crash.

Thanks.

Link to comment
Share on other sites

Don't have the need for this kind of stuff very often so sometimes it takes me a while to get the code right.

The last one I did was to only run a certain portion of a tool every 3 parts because it took 15min to run that portion and all it did was to machine the top of a bore on a mill in the exact same manner as the bottom is machined so the operator had a feature they could measure for that tool as the bottom of the bore can not be reached with any gauge we have. Our in process for that part is every 3 parts so why waste the time machining the inspect-able feature if operator isn't going to check it anyways. Our CMM correlated that the insp. feature was the same size as machined feature so we felt this would work. Made several hundred parts with this and no rejects yet.

 

Link to comment
Share on other sites
On 2/1/2019 at 5:16 PM, myemail said:

 

#510=#510+#511...#513=##513+1

#510=#510+1

#511 IS NOT NEEDED

You can also use #3006 to output instructions to the operator. Up to 26 characters. It will automatically stop the machine and wait for a cycle start button to be pushed.

It will throw up an alarm message to the operator. CHECK PARAMETER 3111 B7=0

#3006=10(CHECK 4TH PART)

#3006=12(PULL 8 PARTS)

#3006=14(CHANGE BAR)

 

myemail, I thought about using 3006 (which I may still do), but I need to check a couple things out 1st.

I know I don't have to, but I always use a variable for the increment value. Just one of those things I guess.

Thanks.

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...