Results 1 to 9 of 9

Thread: Custom Macro for Finding Cycle time

  1. #1
    Registered
    Join Date
    May 2008
    Location
    India
    Posts
    92
    Downloads
    0
    Uploads
    0

    Smile Custom Macro for Finding Cycle time

    Hi,

    Can someone help me with a custom macro to find out the exact cycle time for an executed program ?
    Right now i enter the system clock variable value into another user variable during start and end of the program and then manually find out the time difference between the two times to find the cycle time. This is a cumbersome job when there are multiple programs with ATC being used. I was wondering whether someone knows how to subtract the end time from start time on a 24 Hr clock (also considering date of execution by taking into account system date). The date on my system reads in format hh/mm/ss and the variable is updated as hhmmss.

    thanks a ton


  2. #2
    Registered Perfect Circle's Avatar
    Join Date
    Jul 2010
    Location
    USA
    Posts
    267
    Downloads
    0
    Uploads
    0
    What control are you using?


  3. #3
    Registered
    Join Date
    May 2008
    Location
    India
    Posts
    92
    Downloads
    0
    Uploads
    0
    Fanuc 0i-MD


  4. #4
    Registered christinandavid's Avatar
    Join Date
    Aug 2009
    Location
    New Zealand
    Posts
    654
    Downloads
    0
    Uploads
    0
    Hi,

    You may find it simpler to use the continuous millisecond counter #3001.

    Reset #3001 to zero at start of program.

    At end of program save the value of #3001 to another macro variable (#500 for example). Then convert this value to a legible format (sexagesimal). I use the format hh.mmss (this works well as the values on my macro setting screen are displayed to four decimal places regardless).

    Conversion example: -

    #500=FIX[#500/3600000]+[[FIX[[[#500/3600000]-FIX[#500/3600000]]*60]]/100]+[[FIX[[[#500/60000]-FIX[#500/60000]]*60]]/10000]

    This one-line formula rounds down to the last whole second. You can probably live with this when measuring a single cycle time.



    For greater accuracy (eg if you are adding these times together) you may want to use ROUND where FIX is. This creates another issue, however - in some cases it will round up to 60 seconds and you would need to put in another couple of lines of logic to check and correct the final value if necessary.

    Something like...

    IF[[[#500*100]-FIX[#500*100]]EQ.6]THEN#500=#500+.004 (rounds up the minute if necessary)
    IF[[#500-FIX[#500]]EQ.6]THEN#500=#500+.4 (rounds up the hour if you have now made it necessary)


    DP
    Last edited by christinandavid; 02-04-2011 at 05:40 PM. Reason: Made a boob...


  • #5
    Registered
    Join Date
    May 2008
    Location
    India
    Posts
    92
    Downloads
    0
    Uploads
    0

    Smile

    Thanks for the help

    I will try the code that you gave. I will probably go with the millisecond option. Assign the value to a variable and then deduct the same value from the millisecond variable and then put it through the code that you helped with.

    I was actually thinking of a code where i calculate the hours from the clock but it could get complicated during changeover of the day but your approach of calculating from milliseconds look simpler !


  • #6
    Registered christinandavid's Avatar
    Join Date
    Aug 2009
    Location
    New Zealand
    Posts
    654
    Downloads
    0
    Uploads
    0
    No probs,

    I managed to write one-liners for converting all the other time formats the control uses - millisecs to decimal hours and vice versa, decimal hours to hh.mmss and vice versa. Give us a shout if you need any pointers.

    The system I am working on keeps track of the shift as well as seperate tools and sequences within a cycle, extracting those times from auxilliary functions such as tool and pallet changes - I'm having a hard time proving it out as it involves modifications to those macros and I have to wait for the right jobs to come along to do the testing...plus I'm not always on the control in question.

    I'm getting there...slowly

    DP


  • #7
    Registered
    Join Date
    May 2008
    Location
    India
    Posts
    92
    Downloads
    0
    Uploads
    0
    I' am actually just looking at getting a program run time in minutes at this point of time.

    My next step would be to output the concerned macro variables into a program for which i have not got a solution yet. I cant use DPRINT as my machine has a dataserver and I' am not connected by RS232 which is supposed to be a must for DPRINT to work. If only i would output the data into a program and then punch it out to data server, i have ways of processing this data externally on a computer by putting it into an excel spreadsheet and getting all the info that i want in an understandable and presentable format.

    Do you know of a way to take out macro variables the way i' am wanting them ?


  • #8
    Registered christinandavid's Avatar
    Join Date
    Aug 2009
    Location
    New Zealand
    Posts
    654
    Downloads
    0
    Uploads
    0
    DPRNT is the only way to get a decent report out of the machine as far as I know...

    From what I have read on this site, it should be possible to set up the system parameters to output data to RS232 using DPRNT (as long as the external computer is 'ready'), while still keeping the dataserver path for programs.

    Saying that - surely the macro variable values can be 'punched' to the dataserver/dataserver host, as can the system parameters? I'll look at that the next chance I get...


    Hopefully I will get this sorted on our control when we get the Renishaw GUI installed (been waiting two years for that one). For now, I have a little laminated template to hold over the monitor so I can keep track of what each variable represents (my system uses from #500 up to #799...don't laugh...)

    DP


  • #9
    Registered
    Join Date
    May 2008
    Location
    India
    Posts
    92
    Downloads
    0
    Uploads
    0
    You use close to 300 variables for monitoring ! Thats great....seems like you dont allow any information to escape..i cant even imagine how to make use of all 300 variables in one go

    I' am also looking for ways of just punching the variable values into data server and i hope i can get it sometime soon. There are things that Fanuc is very unfriendly about and i think this is one of them. Even though computers and networking technologies have moved ahead FANUC still holds onto stuff like DPRINT which does not work on an internal channel like the data server communication.


  • Similar Threads

    1. Custom Macro Containing G65
      By LostInMacro in forum Fanuc
      Replies: 20
      Last Post: 09-15-2010, 04:21 PM
    2. "difference between Custom Macro A and Custom Macro B"
      By arulthambi in forum Parametric Programing
      Replies: 4
      Last Post: 10-05-2009, 04:34 PM
    3. First Time In still finding my way
      By askalot in forum Linear and Rotary Motion
      Replies: 1
      Last Post: 03-05-2009, 02:30 PM
    4. Custom macro!!!!
      By chrisryn in forum G-Code Programing
      Replies: 4
      Last Post: 05-27-2008, 11:13 PM
    5. cycle time macro program
      By mcash3000 in forum General CNC (Mill and Lathe) Control Software (NC)
      Replies: 1
      Last Post: 03-29-2006, 01:33 PM

    Posting Permissions


     


    About CNCzone.com

      We are the largest and most active discussion forum from DIY CNC Machines to the Cad/Cam software to run them. The site is 100% free to join and use, so join today!

    Follow us on

    Facebook Dribbble RSS Feed


    Search Engine Friendly URLs by vBSEO ©2011, Crawlability, Inc.