more than 1 counter

mick pitt

Member
Join Date
Apr 2002
Location
thailand
Posts
3
In a simple paintball target shooting situation,we have a fx2n programmer sending targets up at different times.When 1 gets shot down it sends another one up etc.Now we want to send up 3 at a time,when we did this if 2 targets go down together it only counted it as 1 hit.

Can someone please help

Mick Pitt
 
Two hits are better than one

This is classic in any PLC. If you only have one input line to a counter and two inputs drive the same line, the possibility exists for both inputs to be on at the same time. When this happens, the count input only sees a single transistion from off to on.

You need a separate counter for both inputs and then some math to add the counter values together and place them in a seperate register. If you have three inputs you need three counters, and so forth.... utoh

Ya'll Mits programmers need to help him out with the right statements for Mits, but the concept remains the same from PLC to PLC. nodi
 
more than 1 counter again

Thank you very much for your quick reply.(Next Problem)
We are not driving led's from the plc.
we are just sending a single to a stand alone unit (4 way led display unit)which will only exept 1 single to take the total up,and another seperate one to take it down again.
We had thought we could send 3 different singles and add them up,but we did not know how to display the answer.
Is there some way of doing this using the 4 way display we have.

Many Thanks


Mick Pitt
 
We had a similar situation where ther were multiple (possibly simultaneous) detections of 4 items but only one external total counter display (kind of a hybrid machine). I kept an internal register which was incremented (math instruction in 4 places) with each item seen. In another part of the code, if the internal register was non-zero, I issued timed pulses out to the external counter and decremented the internal register with each pulse sent. While the external counter may at times lag the real count, it was only by a fraction of a second, not enough to worry about.
 
I'll have to do this as pseudocode since my original has a lot of other stuff intertwined. I think I extracted the gist of it OK though.

Inputs: Item1. Item2, Item3, Item4 (sensors from items)
Output: External Counter (Increment line to external counter)

Internals: Counter1, 'Do Pulse', Timer1, 'Timer1 is done', Timer2, 'Timer2 is done'

If Item1 (one shot) THEN increment Counter1
If Item2 (one shot) THEN increment Counter1
If Item3 (one shot) THEN increment Counter1
If Item4 (one shot) THEN increment Counter1

If Counter1 > 0 then turn on 'Do Pulse'

If 'Do Pulse' AND NOT 'Timer2 is done' THEN Timer1 (on time for output pulse)
If 'Do Pulse' AND NOT 'Timer1 is done' THEN turn on External Counter
If 'Do Pulse' AND 'Timer1 is done' THEN Timer2 (off time for output pulse)
If 'Do Pulse' AND 'Timer2 is done' THEN decrement Counter1
 
To Jay and Bernie
Many thanks for your answer on our counter problem,we had to read your note about 5 times before we started to understand it.Please believe me,we are not programmers.
We now think we understand and will be trying it tonight,we will drop you a line on our progress.

Many Thanks

Mick Pitt

P.S. Great site or what.
 

Similar Topics

RE: Simatic PLC counter more than 999 HI everyone, I am new to use PLC. At present I am learning Simatic Step7. I have a problem that I need to...
Replies
3
Views
2,616
Hi everyone, recently i worked with a cmore panel and have the question that how can clear alarm list whit remote form,right now only can with...
Replies
0
Views
77
Hello, friends, I am trying to upgrade a system that uses an Onrom incremental encoder (E6B2-CWZ6C) connected to a Danfoss VFD (FC360), but now...
Replies
4
Views
249
Hello Friends I have took the sample program from AB webpage and modified, but I can only send 127 chars...
Replies
1
Views
156
Hello, I am new here and have been working with PLCs for a few years now. I have been tasked with setting up a Micrologix 1400….. to a Cmore 10...
Replies
10
Views
448
Back
Top Bottom