Working in a high production environment we need to keep close control of cycle time. Created this cycle timer that records five cycles and then gives you the average. Which is good when you are there. But we are a 24/7 operation so I wanted a way to keep track and log cycle times every 300 cycles. So the first file is the cycle timer. Second final is used to log a cycle every 300 and copy it to a file with the date and time. 3rd is the output file.

If you'd like copies of the files just send me an email to [email protected]

or if you have questions and comments put them here so everybody can take advantage of it. Would really like to hear if anyone has a better way or different way of doing this.

;OPERATION *** CYCLE TIME COUNTER ***
;Shared By: [email protected]



R755=R754
STOPRE
R754=R753
STOPRE
R753=R752
STOPRE
R752=R751
STOPRE
R751=R750
STOPRE
R760=((R751+R752+R753+R754+R755)/5)

$AC_TIMER[1]=-1
STOPRE


R750=$AC_TIMER[1]
STOPRE


$AC_TIMER[1]=0
STOPRE

NN9999:
M17
____

;RECORD_CYCLETIME
;Shared By: [email protected]


DEF INT ERROR
DEF STRING [16] NAME="RECORD_CYCLETIME"
DEF STRING [4] ENDING="_SPF"
STOPRE

R401=R401+1 ;AFTER 300 CYCLES IT RECORDS CYCLE TIME IN FILE "RECORD_CYCLETIME.SPF"
STOPRE

IF R401==300 GOTOF RECORD
STOPRE

GOTOF END
STOPRE

RECORD:
R400=R400+1 ;RECORDED CYCLES
WRITE (ERROR,<<NAME<<ENDING, "#"<<R400<<"DATE = "<<$A_MONTH<<"/"<<$A_DAY<<"/20"<<$A_YEAR<<" TIME = "<<$A_HOUR<<":"<<$A_MINUTE<< "CYCLE TIME = " <<R750<<" SEC")

IF ERROR
MSG ("ERROR IN WRITE COMMAND" <<ERROR
M0
ENDIF
R401=0 ;RESET R401 BACK TO ZERO

END:
STOPRE

NN9999:
M17
____

; output to the log
#1 DATE: 11/3/2013 TIME: 14:21 CYCLE TIME: 47.04 SEC
#2 DATE: 11/3/2013 TIME: 14:32 CYCLE TIME: 235.304 SEC
#3 DATE: 11/3/2013 TIME: 14:43 CYCLE TIME: 46.968 SEC
#4 DATE: 11/3/2013 TIME: 14:51 CYCLE TIME: 46.876 SEC
#5 DATE: 11/3/2013 TIME: 15:4 CYCLE TIME: 46.82 SEC