MicroLogix 1500 Timer/counter help

Dorrance

Member
Join Date
Feb 2012
Location
Michigan
Posts
39
Hello my name is Dorrance I am very new to plc programming. I am capable to make simple programs like inputs that trigger outputs but never worked much with timers or counters.
I have a micro logics 1500 and need it to count (from a prox) how many times it cycles in 5 or 10 seconds. If the count is too high trigger an alarm if not reset the count and start over.
Basically what I want to do get an alarm when a pump runs dry. In normal operation it goes 3 to 4 strokes in 5sec when out of product it pumps 6 to 8 strokes in 5sec.
I have been working with relays and picax pic chip but not having good luck I would really like to start over with a plc
 
Could you use your prox drive a CTU counter and then use a GRT instruction to alarm if the stroke count is greater than 5? Not sure about the 5-10 second window. Maybe a timer that runs for 10 sec and then resets. The prox rung could have the TT (timer Timing) bit in it to make sure it is counting strokes in that 10 sec span. hmm something isn't quite right there. Hmmm.


In full disclosure I'm pretty new to PLC programming too so I may not be the best person to listen to but might get some ideas flowing for you!
 
Last edited:
Yes this is what I want to do but unsure how. When I wrote 5 to 10 sec it was meant to be a generic number I would really like to use 5sec just to catch the pump faster but thought fine tuning would be needed.
There is a lot more to my program I just thought this would be a good starting point.
What I have is 8 ink totes and pumps. What I need to do is be able to monitor all 8 pumps also on the tote there is a steel float that would also be covered by a prox. I will need all 8 to have different outputs and one general reset for all 8.
For instance if pump 1 had its counting prox as I/0 and its float prox I/1 then both will need to set off O/0 and I will also need one input like I/9 to reset all alarms.
I hope this makes enough sense
 
It's been a year or so since I last used a ML but think I have the mneumonics right.

//if Inputs on count up
XON I1.0 , CTU1.EN
XON I1.2 , CTU2.EN
//if timer done set fault bits
XON T1.TD, CTU1.ACCU >5, OTL B1.1 //Fault Bit 1
XON T1.TD, CTU2.ACCU >5, OTL B1.2 //Fault Bit 2
//if timer done bit on resest counters
XON T1.TD, RES CTU1
XON T2.TD, RES CTU2
//if timer not done and reset not pressed run timer
XOF T1.TD, XOF I1.9 TON T1
//if reset ON reset counts and fault bits
XON I1.9, OTU B1.1
XON I1.9, OTU B1.2
RES CTU 1
RES CTU 2
 
Yeah, I was a bit off. Here is code that should work right.
Code:
SOR XIC I:1.0/0 CTU C5:0 99 0 EOR  
SOR XIC I:1.0/1 CTU C5:1 99 0 EOR  
SOR XIC T4:1/DN GRT C5:0.ACC 5 OTL B3:3/1 EOR  
SOR XIC T4:1/DN GRT C5:1.ACC 5 OTL B3:3/2 EOR  
SOR BST XIC T4:1/DN NXB XIC I:1.0/9 BND BST RES C5:0 NXB RES C5:1 BND EOR  
SOR XIC I:1.0/9 BST OTU B3:3/1 NXB OTU B3:3/2 BND EOR  
SOR XIO T4:1/DN XIO I:1.0/9 TON T4:1 0.01 500 0 EOR 
SOR END EOR
 
Last edited:
how many times it cycles in 5 or 10 seconds. If the count is too high trigger an alarm if not reset the count and start over.
Since the counters are reset to zero every time the timer reaches five seconds you might want to monitor the counters every scan instead of incliding the timer done bit. This would allow you to catch the fault as soon as it happens instead of waiting for the timer to time out.
 
Thank you so much for the help rikcando. I have got the program to work but have a couple questions if you wouldn’t mind?
I didn’t see an out put so I added them I made new rungs and put B:3 as examine open to an output. Was this a good or the rite way to do this? It worked but like I said I am new so always looking for the best answer.
Next you mentioned to paste your code. I tried a couple ways but really don’t have any clue on how to do this? Any help would be appreciated.
You have done more than I could have asked anyone for. THX
 
First highlight the code above and then press Ctrl-C, or right click and select copy (assuming a Windows computer).

Open a new ladder file in RSLogix 500 and click on the first empty rung (0000).

Now press Ctrl-V or right click and select paste.

This will copy the above code and paste it into your file.
When programming you ladder you can select the instructions fom the icons or you can just type them in. I prefer not to use the mouse if I do not have to.
 
Last edited:
I didn’t see an out put so I added them I made new rungs and put B:3 as examine open to an output.

Examine open (XIO) - true if input is opened? Do you not want it to be closed (XIC). Do you want the fault output if there is a fault detected. Or do you want to disable your pump if it is faulted?

Regardless, true, I did not put any outputs as I am not sure what you want to output. If you want to turn on a light when there is a fault you could set up branches of XIC B3:{fault bits} and tun on the light if any of the bits come on.
 
My RSLogix computer is off but I think this is right. It should have two branches of the fault bits which drives a fault output.

sor bst xic b3:3/1 nxb xic b3:3/2 bnd ote o:2.1/1 eor
 
FYI:
sor bst xic b3:3/1 nxb xic b3:3/2 bnd ote o:2.1/1 eor

SOR = start of rung
BST = branch start
XIC = examine input closed
NXB = next branch
BND = branch end
OTE = output enable
EOR = end of rung
 

Similar Topics

I have been working on this for a while now and I can't seem to get it. I was finally able to view the 1500 on the PanelView under the serial...
Replies
1
Views
99
Hello, I have a 1764 1500 LSP Series A that keeps failing with DTL_E_FAIL I/O error. Searching around it seems there's a weird issue specifically...
Replies
2
Views
110
Good Day i Have Micrologix 1500 LSP, and I want to get data from plc and send it through Modbus RTU slave; I have only ch0 on that plc I Order...
Replies
6
Views
923
Hello folks, Hope everyone is doing fine. I got an OMRON NS10-TVOOB-V2 hmi screen last day and planning to use it with Micrologix 1500. 1. Is...
Replies
4
Views
1,211
Good morning to all, I need to modify an existing PLC MIcrologix 1500 configured with a Modem on Channel 1 (DF1 Full Duplex) and an...
Replies
7
Views
1,434
Back
Top Bottom