Host Engineering Forum
General Category => General Discussion => Topic started by: maciek on November 12, 2019, 06:04:28 PM
-
as always this is going to sound dumb but
i would like an output to be on from 8pm(20)to 6am and another one from 7am to 7pm(19)
-
Is this two different outputs? The second one is easy
STRGE $Now.Hour 7
ANDLT $Now.Hour 19
OUT C42
The first one is easier if you think about when you want it OFF, between 6 and 20, then invert using the NOT contact.
STRGE $Now.Hour 6
ANDLT $Now.Hour 20
ANDNOT // inverts power flow; this is the triangle contact with a small circle on the end
OUT C43
-
Or just
STRGE $Now.Hour 20
ORLT $Now.Hour 6
OUT C43
;D
-
thanks you are the man
-
The first one is more difficult, but do you get any benefits for using that one?
-
No "benefits" to the more difficult rung. I suspect franj1 thought about a cleaner way to go about it a minute later.
-
How about if these outputs need to be on between 2 different times including minutes? E.g. 6:24 to 12:54 but not on Mondays and Fridays. It becomes a little more difficult and messy. That is why a scheduling structure would be great for Do-more.
-
I will sometimes create a variable HHMMSS, (Hour *3600) + (Minute *60) + Seconds, creating a time code. Then you can use comparison statements to a single number to enable desired actions.