I have a main clock in place
the overtime clock = main clock - set time
the problem occures when the clock value roles over and the clockvalue - set_time < 0
during that time the value of the OT clock is incorrect
eg set time = 10 sec , when main clock counts to 1min , the over time clock would show 0.50 instead of 0.51 etc, for the duration of main clock moving 1.00 - 1.10 , then it be fine
this approch seems to be correct but i am not sure if it needs to be nested
Code:
if Days => Set_Day and Hours => Set_Hour and _
Minutes => Set_Min and Seconds => Set_Sec and _
100th => Set_100th then OT_Enable = 1
if OT_Enable = 1 THEN
OT_Days = Days - Set_Day
OT_Hours = Hours - Set_Hour
OT_Minutes = Minutes - Set_Min
OT_Seconds =Seconds - Set_sec
OT_100th = 100TH - Set_100th
endif
if Hours - Set_Hour <0 then
OT_Days = Days - 1
OT_Hours = 24 - Set_Day + Hours
endif
if Minutes - Set_Min <0 then
OT_Hours = OT_Hours - 1
OT_Minutes = 60 - Set_Min + Minutes
endif
if Seconds - Set_Sec <0 then
OT_Minutes = OT_Minutes - 1
OT_Seconds = 60 - Set_Sec + Seconds
endif
if 100TH - Set_100th <0 then
OT_Seconds = OT_Seconds - 1
Ot_100TH = 100 - Set_100th + 100TH
endif
Bookmarks