Hi, I created a timer to calculate a working time in macro O1000 (sub-pro)
In the main program:
you can add on one line in the begining to set starting time in #500 and call #1000 in end before M30.
After run this program, you can check #505 - for hours, #506 - for minutes, #507 - for seconds
Any questions, you can e-mail to me "yihong.wu99@gmail.com" or "jwu@optimamfg.com"
for Example:
O1 (Main program)
#500=#3012 (set staring time in #500)
---------
---------
---------
M98 P1000 ( to calcute working time)
M30
O1000 (MACRO FOR A TIMER BY Yi-Hong WU 07/23/2007)
#501=#3012(TO GET ENDING TIME)
#2=0
IF[#500GT#501]GOTO500
N1#1=#500
N100#100=FIX[#1/10000]
#101=FIX[[#1-#100*10000]/100]
#102=#1-#100*10000-#101*100
IF[#2EQ1]GOTO2
#103=#100
#104=#101
#105=#102
#1=#501
#2=1
GOTO100
N2#106=#100
#107=#101
#108=#102
N3IF[#108GE#105]GOTO200
#108=60+#108
#107=#107-1
N200#507=#108-#105
IF[#107GE#104]GOTO300
#107=60+#107
#106=#106-1
N300#506=#107-#104
#505=#106-#103
GOTO600
N500#3000=141(OVERSIZE VALUE)
N600
(#500 - FOR STARTING TIME)
(#501 - FOR ENDING TIME)
(#505 - FOR HOUR)
(#506 - FOR MINUTE)
(#507 - FOR SECOND)
M99