Internet PLC Forum

General => Technical support => Topic started by: tobor0216 on July 17, 2009, 03:14:12 AM

Title: Real time clock and day
Post by: tobor0216 on July 17, 2009, 03:14:12 AM
I have a FA1616-BA controller,and I am wondering how I can control a I/O based on the day of the week. For example I want to set or clear I/O's Monday through Friday, but on Sat and Sun I do not want to do abything with the I/O's?
Title: Re:Real time clock and day
Post by: support on July 19, 2009, 07:54:13 AM
The day of the week is in the variable DATE[4]. So you can use IF THEN ELSE statement to make decision on what to do.

E.g. IF DATE[4] < 6 THEN
   SETIO XXX
ELSE
   CLRIO XXX
ENDIF

You only need to run this check only when TIME[1] = 0.