Counters for wallclocktime

waskojat

Member
Join Date
Aug 2005
Location
Dayton, OH
Posts
8
Help! I am creating a program that requires the plc to know what day it is (mon, tue, wed etc.) I realize a counter is needed to increment every day and reset at the end of the week. I was thinking 0-4 would be mon - fri and 5-6 would be sat and sun and reset on 7. I just dont know what operations are needed to accomplish this, I am new to programming PLCs and would appreciate some advice with my rookie question.

thanks

UD Student
 
Are you needing to keep track of the time as well??

If so, you'd need a 1 sec pulse. Then count the pulse until it reaches 60 (use a comparator to check the value). Then use the comparators output (ie. is count > 59) to reset the counter and also increment the next counter (the minute counter). Then when the minute counter gets to 60 (again.. another comparator). Use the output of that comparator to reset the minute count and increment the hour count.

Then compare the hour count to 24 and use that to reset the hour count and increment the day count.

Then another comparator to reset the day count when it gets passed 7...

But as Daniel said, we need more info on what PLC you are using.. what exactly you want the project to do etc etc

Cheers

JT :)
 
I can get my set values of wallclocktime from the plc, which i can set to the current date/time, Im trying to use the hours from the array to increment a counter when it goes from 23 to 0 to indicate a new day, but how?
 
you have the right idea...

just check the hour to be equal to zero but be sure to use a one shot, this will toggle your day counter, then reset the counter when the value is greater than or equal to 7...
 
This is a good exercise in counters, and doing it with a self-resetting counter will be informative. For future "real world" use, though, you should be aware that most PLCs with a real time clock also have date and day of the week information available in the special registers as well as time of day.
 
limit

I did the same few year ago. I used a counter for day of week. After, a got the LIM instruction to only use value 1-5 ( monday to friday )to got data only in the day week.
 
did error

I got .ACC of the counter for value 1-5. I used LIM instruction

low limit = 1

value = c5:0.acc

high limit = 5

the rung goes true when it's between 1 to 5.

keep it stupid and simple... no compare instruction
 
If you are using RSLogix 5000, you can use the built-in "WALLCLOCKTIME" object and the GSV instruction.

It gives you the day of the month, which you could run against a lookup table for a given year.
 
Tom Jenkins said:
This is a good exercise in counters, and doing it with a self-resetting counter will be informative. For future "real world" use, though, you should be aware that most PLCs with a real time clock also have date and day of the week information available in the special registers as well as time of day.

For some damn reson the control logix dosnt have the day of the week..Go figure??:?

Go with a cheap micrologix and RTC module and its there..go with the cream of the crop and they missed it!!

D
 

Similar Topics

Hi Hope you all are doing well. Iam working on a project with some AOI. I also hate no online edits... lol. My problem occurs when I use a UDT...
Replies
2
Views
157
Hey guys, thanks for reading. I am trying to use a micrologix(1000 or1500) to control 3 hydraulic pumps. I have a time clock to give a signal to...
Replies
38
Views
3,463
iFIX 5.5. We have alarm count database tags with SIM driver and I/O address = "C:AREA-SD:ACK" which is suppose to count the acknowledged alarms in...
Replies
16
Views
1,404
https://www.youtube.com/watch?v=zTOOYWMJg9M . Specifically see 1:46 to 2:11. 3. The Cell PLC is in constant communication with two other field...
Replies
14
Views
3,135
Does the 1100 only have 1 high speed counter, but it can have multiple inputs? And so then the 1400 has 6 HSC and you have a choice of multiple...
Replies
1
Views
1,716
Back
Top Bottom