What control are you using?
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
What control are you using?
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: -
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.
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)
Last edited by christinandavid; 02-04-2011 at 05:40 PM. Reason: Made a boob...
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 !
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
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 ?
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...)
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.