585,683 active members*
4,861 visitors online*
Register for free
Login
IndustryArena Forum > Machine Controllers Software and Solutions > G-Code Programing > Looking for a macro to get a cycle time average across a full day's operation
Results 1 to 8 of 8
  1. #1

    Looking for a macro to get a cycle time average across a full day's operation

    Hi,
    I am trying to write a macro that will record the exact time that the cycle start button is pressed, each time it is pressed, record the difference into a variable, and average the button-to-button time into another variable.

    for example, if I push the cycle start button at 3:06:52, then after loading a new part, push it again at 3:10:56, I want it to subtract most recent button push from previous button push, and I want that 4 minutes and 4 seconds to go into a variable, which will then be averaged with all of the other button-to-button pushes of the day, which would be stored in a new variable.

    Hopefully this makes sense to people. Feel free to ask for clarification if this is unclear. For reference, I'm trying to do this on a Fanuc OI-MD control.

    Bonus points if you can put an IF statement in to ignore button pushes that occur within less than the cycle time (if the operator immediately reset, then started again for some reason)

    Thanks

  2. #2
    Join Date
    Jun 2015
    Posts
    4154

    Re: Looking for a macro to get a cycle time average across a full day's operation

    hi helbonikster / switch to okuma-osp and ask again

    I am trying to write a macro that will record the exact time that the cycle start button is pressed
    if you wish to write code, then you won't be able to record the moment of the "button-press event", but the moment when the buffer reaches a time system variable or a time counter

    for exact data, you may need a buffer prohibit code, but in most cases a system variable delivers buff prohibit behaviour

    ... so dig for a time system variable for your controller; and build the code arround it ( common variables and writing/reading from a file will help )

    ... or try recording data from the plc

    Bonus points if you can put an IF statement in to ignore button pushes that occur within less than the cycle time (if the operator immediately reset, then started again for some reason)
    i can do this, on okuma, but in a different manner; things can be pushed even further than what you described in this thread, helping someone to see the bigger picture, for more then a single machine

    from some kind of perspective, deviation and stability are one and the same thing : once you have enough data, you may calculate the "statistical corelation coeficient" which is lower for a less trained person or a less organized shop ( more downtime, etc ), and if things are not handled well, it may lead to demoralization of a skilled employee; also, with patience & well spent $$$, nice things can be achieved

    statistics inside a shop is a sword with 2 edges scoring high numbers means a well organized shop, while wrong data colecting and wrong interpretations may lead to time waste and demoralization : everyone is under the same roof

    in the end, after you will do such kind of stuff, is easier to see that all you need is love / 99.8%? kindly
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

  3. #3
    Join Date
    Jun 2015
    Posts
    4154

    Re: Looking for a macro to get a cycle time average across a full day's operation

    one more thing : getting the average cycle time may not be a reference, because sometimes unitar production may vary a lot, thus how_many_parts/1_hour may be subject to deviations caused by different things

    sometimes i inspect when each operation starts&finishes, thus i can create an operation frequency chart for 1-2 days, 1-2 months, etc ...

    of course, main goal is to achieve minimal cycle time deviations, with minimal downtime and minimal total time : there is a thin line that may lead to problems if it is passed, because going faster on a stable setup may come with more downtime, caused by more tool changes or more offset changes / kindly
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

  4. #4

    Re: Looking for a macro to get a cycle time average across a full day's operation

    Really just want to know the average cycle time across a full day, which would take breaks/lunch etc into account. not looking to drastically change my program, more just want to have a more accurate idea to send to my corporate overlords lol

  5. #5
    Join Date
    Jun 2015
    Posts
    4154

    Re: Looking for a macro to get a cycle time average across a full day's operation

    yup, the lords, i know depending on control capabilites, you may take into consideration also shift changes, 24/7, time spent during an M0, offsets changes, etc

    you need a time system variable for your controller, or a time counter & i don't have experience with fanuc; try asking your near-by dealer about this ?! repost your question inside the fanuc forum : https://www.cnczone.com/forums/fanuc/

    check this :
    ... https://www.cnczone.com/forums/fanuc/351442-cnc.html
    ... https://www.cnczone.com/forums/fanuc...nderstand.html
    ... https://www.cnczone.com/forums/fanuc...-fanuc-oi.html

    pls consider that there are guys&girls that gather data from the plc, so to create charts about production / idle times for machines : [email protected], https://machine.report

    good luck helbonikster / see you arround, etc
    Attached Thumbnails Attached Thumbnails GUI-ver722.x13106.jpg  
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

  6. #6
    Join Date
    Sep 2018
    Posts
    10

    Re: Looking for a macro to get a cycle time average across a full day's operation

    Why not copy the time variable at the start of the program to #550 or any unused variable, and have another program that reads current time, that variable and the part counter to give you an estimated daily count.

  7. #7

    Re: Looking for a macro to get a cycle time average across a full day's operation

    Why not copy the time variable at the start of the program to #550 or any unused variable, and have another program that reads current time, that variable and the part counter to give you an estimated daily count.
    I can't find the parameter number for that on a Fanuc OI-MD control. Do you know?

  8. #8
    Join Date
    Mar 2024
    Posts
    1

    Re: Looking for a macro to get a cycle time average across a full day's operation

    Wow, this project sounds quite interesting and challenging! It will definitely take a bit of logic and programming time calculator skills to handle this request. Good luck with writing macros!

Similar Threads

  1. Replies: 0
    Last Post: 04-24-2012, 01:46 PM
  2. Custom Macro for Finding Cycle time
    By yaji63 in forum G-Code Programing
    Replies: 8
    Last Post: 02-08-2011, 04:58 AM
  3. Average set up time for mori lathes
    By Mike-G in forum Mori Seiki lathes
    Replies: 3
    Last Post: 06-25-2009, 08:28 PM
  4. Average costs for machine shop time
    By jdlinke in forum MetalWork Discussion
    Replies: 4
    Last Post: 01-08-2008, 07:20 AM
  5. cycle time macro program
    By mcash3000 in forum CNC (Mill / Lathe) Control Software (NC)
    Replies: 1
    Last Post: 03-29-2006, 07:33 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •