A user wrote today with a small example to turn an output on with a schedule and off depending on the state of an input. The program they submitted has a goto and some tricky logic, I suggested some small changes to simplify it and posted here so others can learn:
I am trying to do this very simple program and I don’t know why it doesn’t work. The prog file is attached, here is the code:
10 IF SCH1 THEN START OUT7
20 IF TIME-ON ( OUT7 ) > 00:30:00 THEN GOTO 30
30 IF IN1 > 1 THEN START OUT7
The problem is that out7 starts when sch1 is off because in1>1 but it stops when in1<1…I want that out7 still on for 30 minutes after in1 becames from >1 to <1.
Can you help me?