I'm programming the LED lamp to turn on at a specific time by controlling the SW12 port.
It is difficult to light it up at a specific time, not every hour or every minute.
- Every day beetween 04:00~07:00 and 17:00~20:00
- Every 10 minutes to 30 seconds back and forth (Total 1 minute)
※ for example
03:59:30 ~ 04:00:30
04:09:30 ~ 04:10:30
04:19:30 ~ 04:20:30
..........
I've tested it with functions such as "TimeIntoInterval" and "TimeIsBetween" as well as "IfTime", but it's not working well.
Is there a suitable examples or functions?
Thank you.
Hi, I think the below should do what you want :-
If (TimeIsBetween (239,421,1440,min) OR TimeIsBetween (1019,1201,1440,min)) AND (TimeIsBetween (570,600,600,Sec) OR TimeIsBetween (0,30,600,Sec)) Then
SW12 (SW12_1,1 )
Else
SW12 (SW12_1,0)
EndIf
All the contents of "If .... Then" are on one line.
Oh, I think it's a really good way. I'll test it right now.
Thank you so much for your help!!!