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:

Any good macros for recording cycle times?


Bob W.
 Share

Recommended Posts

I am currently recording my cycle times using variable #3012 and I was wondering if there was a better way to do it. At the beginning of the program I have #700=#3012 and at the end I have #701=#3012. These are exported using M296 and I calculate the difference manually to get my cycle times. #3012 outputs the time in 140335 format. This value would equal 2:03:35 PM. Is there a better way?

Link to comment
Share on other sites

There's a Cycle Time variable... I don't recall what it is at the moment but that'll give you HHMMSS format as well but no calculation necessary. Nothing will give you HH:MM:SS though if that's what you're after.

Link to comment
Share on other sites

You could do:

 

#702=[#701-#700]

 

So that your output is just the actual cycle time. Not a huge difference, but you wouldn't have to do the math each time.

 

I wasn't sure if that would work given that it is a standard number (or is it?) and not a time based number where the third digit counts up after 60 instead of 100. So #702 would be based on 60 seconds in a minute and 60 minutes in an hour? Does that make sense?

 

Nothing will give you HH:MM:SS though if that's what you're after.

 

That isn't really what I'm after. I wasn't sure if the control would do the math in Joe's post based on time or base10 math calculations. If it does it based on time, problem solved.

Link to comment
Share on other sites

I wasn't sure if that would work given that it is a standard number (or is it?) and not a time based number where the third digit counts up after 60 instead of 100. So #702 would be based on 60 seconds in a minute and 60 minutes in an hour? Does that make sense?

 

 

Oh yeah, forgot about that. You'd need to isolate the minutes, check to see if they're above 60, then subtract 60 from the minutes and add 1 to the hours if they are. Sort of a PITA.

Link to comment
Share on other sites

I didn't feel like doing anything productive this morning, so I did the work for you. The obnoxious part is moving the decimal around so that the FIX function can strip away the hours, leaving just the minutes. I'm sure there's a more elegant way to do this, but I tend to stick with what's simple. I just ran it and it works perfect.

 

(#705 IS FINISH TIME MINUS START TIME)

 

#705=[#701-#700]

#706=[#705/10000.] (DIVIDE TOTAL TIME BY 10,000 TO GET DECIMAL BETWEEN HOURS AND MINS)

#707=FIX[#706] (USE FIX FUNCTION TO ELIMINATE EVERYTHING TO THE RIGHT OF THE DECIMAL, LEAVING ONLY THE HOURS)

#707=[#707*10000.] (MULTIPLY THE HOURS BY 10,000, TO END UP WITH HOURS ONLY, AS A WHOLE 6 DIGIT NUMBER)

#708=[#705-#707] (SUBTRACT WHOLE NUMBER OF HOURS FROM TOTAL CYCLE TIME, TO LEAVE ONLY THE MINUTES AND SECONDS)

 

IF[#708LE5999.]GOTO555 (IF THE MINUTES AND SECONDS ARE LESS THAN 5999, NO FURTHER ACTION IS NECESSARY)

 

#709=[#708-6000.] (SUBTRACT 60 MINS FROM CYCLE TIME)

#710=[[#707+10000.]+#709] (CARRY THE 1 FROM THE MINUTES, AND ADD THE HOURS BACK TO THE MINUTES)

 

#705=#710 (REPLACE ORIGINAL CYCLE TIME WITH 60 MINUTE CORRECTED CYCLE TIME)

 

N555 (CYCLE TIME MINUTE/HOUR CALCULATION NOT NEEDED)

M30

Link to comment
Share on other sites

Here is one that I have for an I-80 control....and it *should* be almost a direct plug in for a Fanuc...

 

O9601(PALLET A TIMER)
(INSERT #3001=0 AT BEGINNING OF MAIN PROG)
(#550=TOTAL TIME COUNTER-SECONDS);
(MANUALLY RESET TO ZERO WHEN DESIRED);
(#553=ACCUMULATED HOURS);
(#554=ACCUMULATED MINUTES);
(#555=ACCUMULATED SECONDS);

#552 = #0
#556 = #0
#550 = #550 + #3001 / 1000
(TOTAL SECONDS)
#103 = #550 / 3600
(DECIMAL HRS)
#553 = FIX[#103]
(STORE HRS ONLY)
#104 = [#103 - FIX[#103]]*60
(DECIMAL MINUTES)
#554 = FIX[#104]
(STORE MINS ONLY)
#105 = [#104 - FIX[#104]]*60
(DECIMAL SECONDS)
#555 = ROUND[#105]
(STORE SECS ONLY)
M99

Link to comment
Share on other sites

Thanks for all the help on this. I have been pretty busy so I haven't got to it yet but my plan is to utilize the FIX function to get the output in decimal minutes (25.55 minutes, etc...) and I will have the programs call this routine as a macro at the end of the program. The examples will be a huge help, much appreciated.

Link to comment
Share on other sites

Bob i missed the first post where you were using #3012

I use #3002 (resettable clock) and set it to zero at the beginning and then record the time at the end. It outputs in minutes only but thats easier than having to calculate a bunch of hours minutes and seconds.

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