Micro850 Counter Driver

lolproe

Member
Join Date
May 2013
Location
Canada
Posts
11
Hey guys, I'm trying to build a basic counter on an AB Micro 850. I want it to count from 0 to 3, and then reset it back to 0 and repeat the process forever. The counter should increment once roughly once every 230ms.

The image below is how it's implemented now:

C9OH5qy.png


From my understanding, this setup should work, assuming that fast_flash has a rising edge every 230ms. Once the counter reaches 4, reset will be set to TRUE. The next time this block is evaluated, it will see that reset is true and set the counter back to zero. I don't see any issues with this, but if anyone sees any problems it would be appreciated.

My real concern is generating the pulses to drive the counter. I can't find any elegant way to generate periodic pulses on the Micro850, so I was hoping that someone could give me some advice. This is how I have it now:

a14aJ02.png


I pretty much have two timers, one for each of the on/off durations, which cause a chain of events that make them start/reset each other forever. This seems extremely convoluted to me, and I'm not really confident that this is a dependable setup.

The reason I'm asking this is that when I run this program, everything works fine...for a while. When I did short-term testing of the program (less than a few hours) I never ran into problems, but after I left the PLC running full-time for a few days, I noticed a problem that can only really be explained by the counter not working. I'm not sure if it's due to the counter being constantly reset, the counter running towards an overflow or the square-wave driving the counter falling out of sync and causing it to freeze the counter.

I'm not sure what could be causing this problem, so I was hoping that someone could look at my PLC functions and see if there's a better way to implement the counter, or if I'm doing something that might lead to problems.
 
I haven't programmed these but the solution looks fairly straightforward.

CTU1 - change input contact 'fast_flash' to 'A_temp2'

TON_1 - change input from 'fast_flash' to 'NOT A_temp2' (I don't know how the NC of a bool is shown. I'll leave that up to you.)

TON_2 - change 'A_flash_Off' to 'A_temp1'

Remove the four rungs that have 'Set' and 'Reset'
 
Or even simpler, after completing my previous post ...

Delete TON_1

TON_2 - change 'A_temp1' input to 'NOT A_temp2'
then change the PT value to 'T#230ms'
 

Similar Topics

Hello, First post to these forums, long time reader. I have Micro850 PLC (2080-LC50-48QWB) with 3 2080-IF4 plug-in modules and 2 2080-MOT-HSC...
Replies
2
Views
1,768
Good Morning Folks. I'm having a bit of an issue with a machine and I'm looking for opinions on something. I have a beam that is moved with a...
Replies
31
Views
6,170
I have a square wave being put into the Micro850 input channel 0. I have tried with counting the rising edges with code and with trying the high...
Replies
4
Views
1,885
Hey All. Starting another little machine project here. I am using this time a Micro850 simply to take advantage of the memory capacity over the...
Replies
1
Views
2,352
We have some Pines Benders that we want to upgrade to a digital bend angle, one of them has a CompactLogix PLC with a 1769-HSC module, but I was...
Replies
0
Views
1,804
Back
Top Bottom