Author Topic: Real time clock and day  (Read 10382 times)

tobor0216

  • Newbie
  • Posts: 24
  • I'm a llama!
    • View Profile
Real time clock and day
« 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?

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Real time clock and day
« Reply #1 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.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS