Programming logic help in micro logix 500

kulmaint

Member
Join Date
Dec 2018
Location
AUSTRALIA
Posts
42
Dear friends,
i wand to creat a program in which my motor runs 6 month in every year. Means motor on 6 months and ofer that off automatically every yaer. How do we create real time clock. Please sugguest such program.
Thanks
 
First, which model of MicroLogix PLC do you have?

The older ML1000's I am sure don't have the clock/calendar.

If the PLC is going to be on all the time you could do your own clock. Run a TON timer (0.01 base) with a PRE of well over 100, say 200.

GEQ compare the timer.ACC to 100, if true then count a counter and SUB 100 from the timer. Do not RES the timer or make the PRE 100 because then you will lose a little time, just SUB 100 every second.

Your counter now counts minutes, when it reaches 60 count a hours counter and RES the minutes counter.

Have the Hours counter count to 24, then count days and RES hours.

When your days gets to 180 your 6 months is up, latch a DON'T RUN bit and RES the days.

The next time the 180 days counter reaches 180 unlatch the DON'T Run bit & run the motor.

If the PLC is powered off, say at night, then I would buy an appliance timer from a store, set it to come on at a time when the PLC will be running once per day. Wire the timer output to a PLC input. If the PLC is 24V inputs then have the timer turn on a relay.

Each time the timers input comes on use a OneShot to count days as above.
 
I just thought - if you use the appliance timer to an input and the PLC will be powered off full days I would count how many days per 6 months the PLC would be off (Saturday, Sunday, Holidays) and reduce the 180 days count to the number of days normally worked per 6 months.

13 Saturdays
13 Sundays
5 Holidays
--------------
31 days off, so 149 days worked per 6 months.
 
thanks for your reply
i have micrologix 1400 plc.
i again repeat my question.......i want to run my motor only 1 april to sep 30 every year day night all year and rest of month motor remains off
 
For that set the counter Accumulators to the present date & time, set the Presets to one over the max (second & minute = 60, month = 13, day of month = 32)
You will have to add a year counter to determine if February is 28 or 29 days.
Have your 1 second timer count a Seconds timer then SUB 100 from it.


When the second counter is Done count a minute & RES the second counter.


When minutes count is done count an hour and RES minute.


Have hour count day.



Have day count month. But don't RES day - MOV 1 to .ACC



Have month count year. But don't RES month - MOV 1 as above.



Now for 30 day months:


If the day is 31 and the month is 4, 6, 9, or 11 then count a month and MOV 1 to day


Now for leap year:



If the month is 2 and the day is GEQ 29 DIV the year by 4 and save it to an integer, then DIV by 4 again and save it to a Float. Compare the integer to the float and if they EQU it is a leap year - OTE a "It's A Leap Year" bit


If the month is 2 and the day is 29 and your bit is NOT on then count a month and MOV 1 to day. If your bit IS on wait until the day is 30 and the month is 2, then count a month, MOV 1 to day


If you have a HMI for this I would add lines to display all the counter.ACC's, change them as needed, and add a Reset Second To :00 PB to calibrate it.


Then to run your pump do a LIM Month.ACC to when you want and set a "Run The Pump" bit. If you don't want the pump running 24 hours then check the hour and minute as wanted.


To account for days of week you could also have the Hour counter add 1 to a DayOfWeek counter, set PRE to 7 and RES it when done to follow the RSLogix norm of Sunday=0, Saturday=6.
 
I would set the Real time clock in the Function files and use the Month (RTC:0.MON)
as the TEST in a LIM instruction with 4 as the low preset and 9 as the High preset,
To enable the pump
 
I am also running clock program on my office computer that has Linxs running and it will sync all the clocks on all the PLC's I have set to check every month
so no need to run a leap year routine or adjust for daylight savings
 
I don't use the ML's very much and even new RSLogix500 projects are getting rare.


I forgot the 1400 has a RTC. I looked at a project I did and saw all the clock S2 entries were blank, so I presumed it didn't.
 
I am also running clock program on my office computer that has Linxs running and it will sync all the clocks on all the PLC's I have set to check every month
so no need to run a leap year routine or adjust for daylight savings


please send me your contac t number
 
On first power up the disable clock bit(RTC:0/DS) is set 1. It is indeed read-only. You cannot write a 0 to it through logic, or even manually in the Function File itself. It's on a toggle with the 2 buttons beside it. You have to press the "Set Date & Time" button to write a 0 to the disable bit and you have to press the "Disable Clock" button to write a 1. We have no way to mimic the actions of these buttons, at least not through logic.

Ken, you cannot write values to the RTC:0 Function File while the disabled bit is set or the controller will fault on Major Error:44h - "Invalid write to RTC Function File".
It has to be enabled first.

2. download a blank program from update RTC from your PC or laptop.

3. Then use compare instruction with status bits and make your program.


S:37- YEAR
S:38- MONTH
S:39- DAY
S:40- HOUR
S:41- MINUTE
S:42- SECOND
 
Dear friends,
i wand to creat a program in which my motor runs 6 month in every year. Means motor on 6 months and ofer that off automatically every yaer. How do we create real time clock. Please sugguest such program.
Thanks

If that is all you want your MicroLogixto do then I suggest it is over the top.

Something like a smart relay with RTC will do the job admirably.
 

Similar Topics

Hi all I have a program question what is the best way to go around the following, i have a micrologix 1400 and I have a mixer that I would...
Replies
13
Views
2,694
Hi, I am using visilogic to control a system that i have designed. I have designed a automated color sorting mechanism using a color sensor. I...
Replies
2
Views
1,422
Hello there, I am currently taking my final year project and working out in my ladder logic programming. I am finding some difficulties on...
Replies
76
Views
32,226
We have some tanks that have have discrete level sensors in them. The hysteresis is very low in them and depending on the type of liquid we have...
Replies
4
Views
4,028
Back
Top Bottom