|
proc timer(int type)" f. c, j# p& b3 K
;(1=360Basic,2=360B or AWD,3=360C)7 h! M/ O# r. }3 ?
def int error4 k o. V5 d1 k( x0 z4 n
def string[35] ld_name
( e! Q+ I$ p, B/ v7 R) S( Q( k3 |
if ($p_subpar[1]==false) or (type<1) or (type>3)
7 i5 s! C7 Y5 i+ U6 K ld_name=("<Unknown>")5 n% R0 w+ C: r3 n( L# }
endif* ]9 f6 e7 g+ }- ?5 J
if type==1
# i$ H# I8 t' |( w0 ^$ c ld_name=("<360Basic>")
# }5 ]1 q. C) l" N- H! f# Y3 _ endif
/ C+ |' N9 P: V0 m+ V" U) iif (type==2) and (r99==57529)/ j# U3 Q0 N$ T! Q
ld_name=("<360B>")
. U4 j; d. g1 }) G" X$ Z/ p4 M. y endif/ _1 Z% E( g' A; `4 i( m. k
if (type==2) and (r99==1359). O+ X5 c% K/ W. ]& m8 u
ld_name=("<360AWD>")
6 f- R. t) m0 Y: D# D' | endif
% t$ p0 Y S& ~3 o8 F8 v% Z/ `9 Tif type==3( f6 G2 L: ~1 t% [
ld_name=("<360C>")# z3 `) a0 v8 L7 V4 C$ \; f8 f& t
endif
( ?1 D8 ^2 i1 O/ @+ m+ h6 P+ ^5 c, ~; j1 P4 V& g, a3 _+ J( D o
write (error,"/_n_spf_dir/_n_cycle_timer_spf",""<<ld_name<<" Running:"<<$a_year<<"."<<$a_month<<"."<<$a_day<<" "<<$a_hour<<":"<<$a_minute<<":"<<$a_second )
8 d9 q4 u) F5 ?
5 a( I, I4 p4 c& N1 d5 tr600=$a_hour*3600+$a_minute*60+$a_second+$a_msecond/1000-r6005 f8 k# L' Z5 j$ q8 T
if r600<0' u r' t H' o2 R" \9 ]5 V
r600=r600+24*3600 s1 X$ t% L) W- z" I5 r
endif
4 r) y% D* \9 t" l, Bif r600>36004 @* w' P" O. l9 |
r600=0
+ J8 E0 B* X+ Q* rendif
4 f9 q* P) b* t) f2 Hr600=round(r600)
8 P6 I `9 P9 `+ d
* t. ]. B5 o+ N/ c3 D$ Bwrite (error,"/_n_spf_dir/_n_cycle_timer_spf","Cycle time : "<<r600<<" Sec")
& e2 A% r+ l* H- \( u5 o( ~" `' ?( U5 C, M# j( P
write (error,"/_n_spf_dir/_n_cycle_timer_spf","Machining Time: "<<round($ac_timer[1])<<" Sec " )' R6 S! `! H. }+ S! ?: s5 p2 x
* x- M; J, Y1 R
r600=$a_hour*3600+$a_minute*60+$a_second+$a_msecond/1000
$ D9 {5 l% ~# B" C0 c0 `4 ^* u: Aret |
|