News:

  • June 09, 2026, 10:11:00 PM

Login with username, password and session length

Author Topic: Time of Day and Day of Week  (Read 22532 times)

PStiles

  • Full Member
  • ***
  • Posts: 31
Time of Day and Day of Week
« on: August 31, 2010, 07:43:26 AM »
Is there a example somewhere let I can download that show how to turn a output on and off at certian times of the day and on certain days of the week.

What I would like to do is turn a output off Monday thru Friday between the hours of 8:00 am and 4:00 pm. The out put would be on all other times.

CPU is a 440

b_carlton

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 606
    • thePLCguy
Re: Time of Day and Day of Week
« Reply #1 on: August 31, 2010, 09:06:35 AM »
So you want to turn the output on if:

It is Saturday

OR

It is Sunday

OR

It is before 8 AM

OR

It is after 4 PM


Now, can you turn that into a rung using the day/time information?
An output is a PLC's way of getting its inputs to change.

PStiles

  • Full Member
  • ***
  • Posts: 31
Re: Time of Day and Day of Week
« Reply #2 on: August 31, 2010, 09:16:08 AM »
Yes this is what I am looking to do. Is there a example that I may look at, not sure how to start.

b_carlton

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 606
    • thePLCguy
Re: Time of Day and Day of Week
« Reply #3 on: August 31, 2010, 10:26:44 AM »
In your previous thread you ended up creating a rung. You will create 1 rung.

You will use the day and time information in the PLC. Do you know where that is?

You will use compare functions. Are you confused about those?

What is the specific problem?
An output is a PLC's way of getting its inputs to change.

PStiles

  • Full Member
  • ***
  • Posts: 31
Re: Time of Day and Day of Week
« Reply #4 on: August 31, 2010, 11:18:21 AM »
I do not understand how to access the time and day info in the PLC. Is there documentation that shows an example that I can use to extrapolate this programming from?

b_carlton

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 606
    • thePLCguy
Re: Time of Day and Day of Week
« Reply #5 on: August 31, 2010, 11:48:05 AM »
Do you have the manual for the CPU, either in printed or PDF form? Do you know the V registers where the time/date information is stored?
An output is a PLC's way of getting its inputs to change.

b_carlton

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 606
    • thePLCguy
Re: Time of Day and Day of Week
« Reply #6 on: August 31, 2010, 11:57:17 AM »
Here is a test for Sunday

An output is a PLC's way of getting its inputs to change.

PStiles

  • Full Member
  • ***
  • Posts: 31
Re: Time of Day and Day of Week
« Reply #7 on: August 31, 2010, 01:42:23 PM »
Thanks for the start.  I have the day of week working, but the time of day does not. Below is my program.

PLC 440

// Rung 1
// Address 0
STRE V7771 K2
ANDN V7770 K8
AND V7770 K16
OUT Y40

// Rung 2
// Address 7
END

// Rung 3
// Address 8

b_carlton

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 606
    • thePLCguy
Re: Time of Day and Day of Week
« Reply #8 on: August 31, 2010, 02:01:06 PM »
Say the instructions out loud (at least it helps me)

STRE V7771 K2 - If it's Monday
ANDN V7770 K8 - And it's earlier than 8 AM
AND V7770 K16 - AND its later than 4 PM (huh?)


Do you know how to make an OR operation in ladder logic?
« Last Edit: August 31, 2010, 02:03:07 PM by b_carlton »
An output is a PLC's way of getting its inputs to change.

PStiles

  • Full Member
  • ***
  • Posts: 31
Re: Time of Day and Day of Week
« Reply #9 on: August 31, 2010, 02:34:12 PM »
I do understand and and or logic. The reason I tried it the way in my program is I am asking if it is Monday between 08:00 am and 4:00 pm turn Y40 off. If it is after 4:00 pm or before 08:00 am, turn Y40 on.

PStiles

  • Full Member
  • ***
  • Posts: 31
Re: Time of Day and Day of Week
« Reply #10 on: August 31, 2010, 03:09:13 PM »
The day of the week and the time less then 08:00 am works. The issue is with the greater then 4:00 part, any suggestions?

PStiles

  • Full Member
  • ***
  • Posts: 31
Re: Time of Day and Day of Week
« Reply #11 on: August 31, 2010, 03:33:02 PM »
After reading the manual there are no examples of the or function. While I understand the concept, I do not understand how to make on. Could you providea example?

PStiles

  • Full Member
  • ***
  • Posts: 31
Re: Time of Day and Day of Week
« Reply #12 on: August 31, 2010, 03:38:18 PM »
Thanks for your help. I figured it out.