THis will do a basic Time to TC countdown based on times derived from the worklog it will ouput the countdown to either the message bar OR a user DRO you would create on the screen.
'Program Load, Program The Vars to the TC time values derived from the WorkLog
#310 = 0 'Turns OFF Timer
#400 = 0 'Sets TC Var Holder to Zero
#401 = 10 'Start of the TC values 401 = 1st TC time
#402 = 2 '2nd
#403 = 6 '3rd
#404 = 0 '4th, etc
***************************
'M6Start (add too)
setvar(310,0) 'Turn Off Timer
SetVar(400,(Getvar(400)+1) 'Up the Tool# count
IF GetVar(400) = 0 Then End 'IF var value = 0 then end
IF GetVar(400) > 0 then SetVar(301,400) 'IF Var has a value then process
End
***************************
'M6End (add too)
SetVar(310,1) 'Turn ON Timer
End
**************************
'M1030 End ( Create) , Is called by the M30/program end
Message" End Of Program Run"
SetVar(310,0) 'Turn Off Timer
'SetOemDro(1000,0) 'Reset Dro
SetVar(400,0) ' Reset TC Vars to Zero
SetVar(401,0)
SetVar(402,0)
SetVar(403,0)
SetVar(404,0)
SetVar(405,0)
SetVar(406,0)
SetVar(407,0)
SetVar(408,0)
SetVar(409,0)
SetVar(410,0)
End
***************************
'Macropump (add to)
If Getvar(310)<>1 Then End ' IF Timer is OFF then end
settimer(10)
SETvar(298,(GetTimer(10)))
setvar(299, (Getvar(299) + (GetVar(298)/60)))
Setvar(301, (Getvar(300)- Fix(Getvar(299))))
Message" Next TC Due In " &getvar(301) &" Minutes" 'Use IF you use message bar
'SetOemDro(1000,Getvar(301)) 'Use only if you use a DRO to display countdown
End
Hope it helps,