Need help starting a program daily at 8:00 AM

kitlegg

Member
Join Date
May 2016
Location
Discovery Bay, CA
Posts
3
Hello. I am brand new to PLC programming, as in I took a few introductory classes two weeks ago. I am trying to help a family member with a project he is working on. He is building a footbath for dairy cows. It is a bath that the cows walk through after being milked that has a chemical mixture that keeps their hooves from getting infected.

The PLC needs to fill up the footbath with the correct dosages of water and chemical. The barn runs 24/7, and there are three milking shifts every day, 8 hours each. The chemical treatment only happens during the 8:00 AM to 4:00 PM shift.

During the treatment shift, the PLC must fill the bath at 8:00 AM. It must then wash down the bath with clean water and refill every two hours. During the other two shifts, the PLC must continue to wash down the bath every two hours.

I have completed most of the program but cannot seem to cross the finish line. That is where you all come in! (y)

How do I program the treatment shift to start at 8:00 AM daily?

I am using an Allen-Bradley Micro820 and the Connected Components Workbench.

Thank you in advance for your help!
 
A quick check of the specs for the micro 800 series doesn't show that it has a real-time clock. Granted, I didn't find anything that specifically says it doesn't have one and I didn't do a very thorough search. Perhaps someone will chime in who knows the product line better than I.
 
I would suggest going to the local store and buying a digital appliance timer, set the on time for 8:00 and off time just after 14:00, 7 days a week. Wire the timers output to an input (or if only DC input have the timer trip a GP relay with a dry contact to the Micro) Total cost about $10 -20

When the timer is on run your wash cycle. For the 2 hours cycle you can use internal timers in the Micro.
 
Simplest would be to create a Boolean that is true between 0800 and 1600. Put that Boolean as a permissive in the line of code controlling the chemical valve. With that, the sequence will run normally except that the valve won't turn on. That's assuming that the chemical valve is a PLC output.
 
But don't forget, plc clocks are not brilliant time keepers and are known to drift.
Not only that, how would you change the summer/winter daylight saving.
Are you going to reprogram it twice a year.
 
How about this? There is also a remote display that looks like it could be used as an input device to set the time using the RTC_Set Command.

Micro820.jpg
 
Thanks all for your feedback. As usual, it looks like I have several solutions. The solution I ended up finding was not provided here, so I want to share so that if someone else is looking they can find it.

I used the Time of Week (TOW) function. Previously, I ignored this function, assuming it was a weekly timer only, and I needed a daily timer. However, the second variable in each time setting channel, called "DailyWeekly," is used to change the timer from a weekly timer to a daily timer. See images below.

The following YouTube video was helpful: https://www.youtube.com/watch?v=ffhFMKAdCR8

Capture.jpg Capture2.jpg
 
But don't forget, plc clocks are not brilliant time keepers and are known to drift.
Not only that, how would you change the summer/winter daylight saving.
Are you going to reprogram it twice a year.

You need to think about this.

The clock will drift and show the wrong time after a while. Usually it is worse than the cheapest watch you ever owned.

So you need to either be able to set the time from somewhere, like an HMI. Or you should check if the PLC has some kind of time sync.

Or you can implement it in the program yourself if your PLC supports generic serial communication. This would be a good training project.

In that case you get a GPS module with a serial output and connect it to the serial port on the PLC. It doesn't have to be something expensive, you could use something like the GlobalSat BR-355. Each second the GPS will send a message that tells what position you are at and what time it is. Search for NMEA 0183 and you can see how it looks. You need to get receive the message and pick out the time information from it and set the PLC clock to the time you got from the GPS.
 
the variabele NOW will give you time.
in a type called TIME or DT (sorry i am codesys)
with this in mind you say
IF time.hour > 8 AND time.hour < 14 THEN chemical=TRUE ELSE chemical = FALSE

for the water:
IF time.hour MOD 2 then clean
an RTC is good enough for this.
 
Why is this? Why does the RTC on PLC not hold the time better than they do? What is the flaw?

Probably cheap components but I think also that the RTC is temperature dependent and you'll have more variation than on your wrist. Real high quality stuff puts the crystal in an small temperature controlled oven.

Either way if you have a watch you just correct your watch when it gets to much out of time. With a PLC or any computer that no one is working with, the time just gets more and more out of line. Usually it doesn't matter except when something is supposed to happen at a certain time.

If you hook up a PLC that has been running unsynced for years the time can easily be a day or two off. It's the same with PCs. If you don't set the time for 6 months or so it can easily be half an hour off. If you're lucky it might just be a few minutes.

In the office windows PCs are synced to the domain controller which may in turn be synced to an time service of some kind. So regular users usually don't have to think about it, but the IT department does.

Many operating systems today are by default installed with time syncing over internet. Cross platform uses NTP as sync protocol. If you have a plant that is running PCs that are not connected to internet and you want accurate time, you install a local NTP server. Normally this NTP server gets it's time from the GPS satellites that themselves contains atomic clocks (which are very accurate).
 
Last edited:
Why is this? Why does the RTC on PLC not hold the time better than they do? What is the flaw?

I suspect that part of the reason is that most customers don't care, and so they don't nvest more money in it than they need to. The majority of the systems I've touched have never had their clocks changed from the system default.

In the systems where time was actually important, we'd always sync the clocks. If no network access was available, a GPS system would be used. If the plant had a network connection, then we'd set up an NTP server.

However, from a technical design side, I've been told that realtime clocks are very sensitive to temperature. Since PLCs need to have wide temperature ratings, the clocks are unlikely to be at the design temperature.

I'd be really curious to hear from someone who actually knows the answer, though. "we're too cheap to bother" sounds entirely correct, but there's usually more to the story than that.
 
I'd be really curious to hear from someone who actually knows the answer, though. "we're too cheap to bother" sounds entirely correct, but there's usually more to the story than that.

This info on the RTC used in Intel chipsets might clear things up.
http://www.intel.com/content/dam/do...l-time-clock-accuracy-considerations-note.pdf

Intel says the best their circuits can do is 20 ppm (part per million) accuracy without the accuracy of the crystal oscillator (which is also typically 20 ppm).

So 40 ppm in total which means within 40/1000000. That equals about 20 minutes on a year since a year has 60*24*365 minutes.

40 ppm is the same as 0.004 percent so it's actually not a lot of variation if we compare to many other things. But it adds up over time.


PS. I have an installation with an industrial PC (not cheap stuff) and I have an application that corrects the clock each 15 minutes. Looking at it right now it's -0.357 seconds wrong each time. That would be 1.4 seconds per hour. Doesn't sound much but it's 34 seconds in a day and that becomes 12509 seconds in a year. The same as 208 minutes or 3.5 hours.

.
 
Last edited:
This info on the RTC used in Intel chipsets might clear things up.
http://www.intel.com/content/dam/do...l-time-clock-accuracy-considerations-note.pdf
.

Found some neat info in that PDF you posted.

ich-family-real-time-clock-accuracy-considerations-note.pdf said:
Crystal Characteristics: Typical 32.768 kHz crystals have an operating temperature
ceiling of 60 °C, thus limit the test temperature accordingly. In addition, the
temperature coefficient of these crystals can cause time-loss of approximately 3 sec/day at 60 °C.

Fork Capacitor Tuning: The timekeeping of the RTC is dependent on the RTCX1 input voltage swing. Oscillation that is marginal may result in failure to meet Vih of this input and thus “ticks” of the clock may be missed resulting in time-loss. Optimum Vpp of this RTCX1 signal is achieved by accurately matching the crystal’s C-load specification (typically 12 pF).

Board Leakage: Since this circuit operates at such low current, it is very sensitive to sources of leakage on the motherboard. Manufacturing residue can cause leakage as well as condensation on the board encountered during temperature and/or humidity testing.
 

Similar Topics

I picked up a Siemens S7 1200 from a buddy and I want to start fiddling around with it to learn about PLC's. I don't want to spend a lot of bucks...
Replies
0
Views
2,460
Good day all! Can someone help me with the procedure to update Beijers E700 firmware? The Panel I am working on is firmware 2.04v and I would...
Replies
1
Views
9
Hello nice to meet you, im new in here, I'm currently trying to convert code written in STL for a S7-400 to SCL for an S7-1500, because when i run...
Replies
5
Views
295
Hello, I am programming in S7-1500, V17. I have some blocks from a drive manufacturer that are not compiling and giving me an error "Invalid...
Replies
2
Views
289
Back
Top Bottom