multiple count-up counters to single count-down output

DiscEng

Member
Join Date
Oct 2009
Location
Bedfordshire
Posts
9
Hi All,

Can this be done ? I looking at writing code for "stand alone" Micrologix500
(No other control purposes intended)

- Trying to track products from 4 lanes (count-up) which are constantly in use - totallising them - and then trickle feed the total (count down) as a single output.

Thinking of something like: -

Input 1 = Count-up 1: Input 2 = Count-up 2 : Input 3 = Count-up 3: etc

Then after Timer 1min lapse - Add all 4 counters & move to N#:## - also reset counters - Then counting resumes
(not concerned with minor count loss at this stage)

Thinking of Status file clock as pulse to enable N#:## count-down & therefore as single pulsed output

I obviously will have to contend with N#:## not being fully zero when next minute totals again.

Just wondered if I'm thinking alone the right lines - Welcome your thoughts

Thanks
 
I had a similar situation.

I had to modify a program which was not working as intended. Multiple feeds were arriving but the customer wanted a total on a single separate dedicated external counter. The program was supposed to pulse the counter for each count. But the multiple feeds would sometimes overlap and only one pulse was sent to the counter.

So I dedicated a register which started at zero.

Each of the multiple inputs was run in to their own one-shot.

On separate rungs the occurrence of a one shot incremented the register. So the register was keeping track of the input items.

Another section of the program was triggered by the register being more than zero. if so it created one on/off pulse for the external counter. At the end of the pulse a one shot was created which decremented the counter. Timers made sure of proper on time and off time for the external counter.

After that even a worst case of all the items arriving simultaneously yielded the proper number of pulses to the counter.
 
Forget the counter. Just use a DINT called Production count or something, and then you can use an ADD ProductionCount 1 ProductionCount as many times as you like and it won't upset anything. Just make sure you use a oneshot before it, because unlike a counter, it will execute and increment every scan while the preceding rung conditions are true.

For your count down, of course, you'd use SUB ProductionCount 1 ProductionCount. And for a reset, CLR ProductionCount.
 
Thanks for your reply's guys,

That is most reassuring - my initial thoughts were alone similar lines - will find time to program & monitor soon

Thanks again
 

Similar Topics

This is a very basic question but I figured I could get a quick answer here before I waste a lot of time. Can a TechConnect account be set up...
Replies
5
Views
1,792
Hello all, I'm new to the plc world here. Most of my experience is from CNC machines and some Motoman NX100 programming. I am currently working on...
Replies
4
Views
3,007
is it possible to install multiple ibaPDAs on single VM or PC?
Replies
0
Views
36
Hi. I need to create several alarm servers in an application, but first I need to know if there is any impact on communication, or if more...
Replies
0
Views
69
Hello all, I know its not good practice to have duplicate destructive bits when writing plc code, but I'm wondering about writing to the same tag...
Replies
2
Views
131
Back
Top Bottom