how about using 2 loops depending on operating output,
if progon=1 then do turnoff checking ' "otherwise"
do turn on checking
'''
'''
'''
turnoff checking stuff
''''
turnon checking stuff
don
how about using 2 loops depending on operating output,
if progon=1 then do turnoff checking ' "otherwise"
do turn on checking
'''
'''
'''
turnoff checking stuff
''''
turnon checking stuff
don
Calculating time from Midnight is not possible since it more than 16Bit.
Moreover, If start time is 13:00:00 and end time is 01:00:00 will be also a problem.
Maybe, checking the Seconds can be with > instead of =, since there is no chance that it will miss for more than few seconds.
Next time if the Program is already On the check will be passed.
Which is why I suggested only counting every other second above....
Or like DT said, you have another bit that'll signify AM or PM...
if time_of_day = 0 ' then it must be between 0000 and 1159Code:time_of_day var bit am con 0 pm con 1
if time_of_day = 1 ' then it must be between 1200 and 2359...
Or again, you can use a LONG variable type and use a 32 bit (ok, 31 plug a sign) variable type.
How do I define LONG variable?
What do I do with a situation where start is 10:00 and end is 09:00?
If using AM/PM sign, what do I do if start is at AM and stop is PM ?
It's in your PBP manual...just like you define any other variable.
Time to start thinking a bit...What do I do with a situation where start is 10:00 and end is 09:00?
If using AM/PM sign, what do I do if start is at AM and stop is PM ?
If it starts at AM, then the flag would equal AM AND the time would match.
If it starts at PM, then the flag would equal PM AND the time would match.
Doesn't matter if it starts or stops, it's all in how you set up your If/Then statement to match what YOU want to do.
From the HELP "Size is BIT, BYTE or WORD."
Does the 16F support 32bit ?
Bookmarks