Alternating Output

PackagingRich

Member
Join Date
Jun 2009
Location
Chicago
Posts
22
Hi All, I am a rookie at ladder programming a Micrologix 1200, and would like to know how to alternate an output from energizing every time from a N.O. contact to every other time. I have tried useing a counter, but have not had much success. Any ideas?
 
Not sure exactly what your asking, but it sounat we call a "toggle". Use the search function and you will find tons of posts.

Or give an explaination of what your trying to achieve in the real world and we can go from there.
 
-I am useing a signal from a timing cam that is 1:1, and would like to energize an output everyother time (2:1). Have tried useing CTU with a CU enable, then reset my counter with a DN. Sorry if i am not explaining this very good.
 
Had some free time..... Here is how I got it to work on a MicroLogix1000.

The TOF timer is so you can set how long you want the output to stay energized.

The CTU counter is just so you have something to watch and see if it is working correctly.

toggle.jpg
 
The easiest way to do it with a counter is to use the least significant bit of the timer accumulator. In binary it changes each time the counter value increments.

0 = 000
1 = 001
2 = 010
3 = 011
4 = 100
5 = 101

Notice how the least significant bit in bold changes each time. So if you are using C5:0 as your counter then C5:0.ACC/0 if your flip flop bit. Ignore the preset and the /DN bits.

Just remember however that the counter value is retentive.
 
Last edited:
Rich,

You started off just dandy with a correct description...
...would like to know how to alternate an output from energizing every time from a N.O. contact to every other time.
Then let these guys talk you into degenerating into slang terms, like "toggle" and "flip-flop".

Toggle is the name of a switch.
Flip-flop is a name long taken by a type of transistor gate, the "J-K Flip-Flop".

In most cases people use the first term they think of to describe a function, even though it is not the best name.

I applaud you for first using the can't-go-wrong "alternate". I would like to see the term "alternator" adopted here for the type of circuit that turns something on and off by repeatedly pressing one momentary-contact button (or by turning a PLC bit instruction on and off).

True, the terms "toggle" and "flip-flop" decribe what it does, but are not unique - they were better-applied to other things many years before PLCs were invented.

The term "alternator" has long been applied to a type of circuit that switches control of pumps or compressors from A to B. It seems appropriate to add this PLC-equivalent version to the definition.
 
Last edited:
HMMM

The term "alternator" has long been applied to a type of circuit that switches control of pumps or compressors from A to B. It seems appropriate to add this PLC-equivalent version to the definition.

Not for me. I think of something that generates "Alternating Current"

I like the "Push to start Push to stop", Maybe there's a poll in the works here.

http://en.wikipedia.org/wiki/Alternator
 
I vote for "Thingy that turns it on and then back off again but only uses one input and one switch and shouldn't be used as a start/stop switch due to safety reasons... kind of deal" To long? Darn!

Does it really matter? He got the point and he fixed his problem.

I said "toggle" because I read his first post too quick. But I now agree with OkiePC that "flip-flop" was a better term to search with.

The main idea is "What is the first thing that pops into a persons brain?" cause that is what they are going to type into the search block. I wouldn't think alternator, even though you are correct that it is the appropriate term.

Overall I am still stupified by the simplicity of Alaric's solution. Master piece!!!!
 
Just to throw ANOTHER log on the bonfire..... :D

Technically you're "dividing by two", or "halving" the frequency relationship between the input and the output.

"Alternating" (while I fully understand what Lancie is getting at), may have a slight disadvantage because the INPUT is technically "alternating" too.

From the OTHER side of the looking glass, you shouldn't exclude "alternating" just because that's what A/C current does, as they BOTH are changing state in a predictable pattern. The term "alternating" has been used for as long as I can remember to describe what two pumps do when you want a different lead pump every time they go into service. Before the proliferation of PLC control there was a DISCRETE device to perform that function called (you guessed it) an "alternator".

By the way, a J/K flip flop will do exactly that when both the inputs are at zero and you give it a stream of clock pulses.

String a bunch of them together, with an output of one connected to the clock input of the next and each will "halve" the frequency signal of the one before it. This will result in "COUNTING" in binary as in the example given by Alaric.

So perhaps another poll IS warranted.... I vote for "Halve".

Stationmaster
 
Last edited:
Rich,

You started off just dandy with a correct description...
Then let these guys talk you into degenerating into slang terms, like "toggle" and "flip-flop".

Toggle is the name of a switch.
Flip-flop is a name long taken by a type of transistor gate, the "J-K Flip-Flop".

In most cases people use the first term they think of to describe a function, even though it is not the best name.

I applaud you for first using the can't-go-wrong "alternate". I would like to see the term "alternator" adopted here for the type of circuit that turns something on and off by repeatedly pressing one momentary-contact button (or by turning a PLC bit instruction on and off).

True, the terms "toggle" and "flip-flop" decribe what it does, but are not unique - they were better-applied to other things many years before PLCs were invented.

The term "alternator" has long been applied to a type of circuit that switches control of pumps or compressors from A to B. It seems appropriate to add this PLC-equivalent version to the definition.

You were doing so well until you contradicted yourself with the example of alternating EQUIPMENT rather than alternating the STATE of a single equipment. This is, after all, an INPUT question.

Many years ago in ****** repair school we were taught that the circuit in discussion here was called a "Bi-Stable Flip-Flop". I still use that name.

To me, alternator means to alternate equipment, such as more than one pump in a sump pump-down configuration.

Just my 2¢ worth.

Bill
 

Many years ago in ****** repair school we were taught that the circuit in discussion here was called a "Bi-Stable Flip-Flop". I still use that name.

To me, alternator means to alternate equipment, such as more than one pump in a sump pump-down configuration.

Just my 2¢ worth.

Bill

You'll have to admit though... that the OP is only talking about one output with 2 states. A "flip-flop" has two outputs. At best, THIS circuit would only use HALF of a flip-flop.

"Alternating" current is ONE signal with two "states" (polarities).....

Still, the relationship between the OP's input and the OP's output is "every-other-one" or half the frequency.

~/2

We're rolling now.... I think we should get this settled once and for ALL!

:)

Stationmaster
 

Similar Topics

Hi, i recieved this machine in our plant and it was missing some parts and some code. I am trying to get O:8/5 turn every other time it goes up in...
Replies
30
Views
7,373
Today I was making an online edit to a 5/40 Series E Rev K.2 with about 14% free memory. I was removing one branch in a large rung. Accept...
Replies
4
Views
3,166
I have 2 pumps not alternating at a lift station. When im at the panel and use the test switches to initiate the pumps,it alternates in the PLC...
Replies
22
Views
5,828
Hello I have been thinking in some way to operate 3 pumps in the same way (I have schneider modicon m340 PLC): -the pumps feed a tank. - As...
Replies
3
Views
1,876
Hi Everyone, trying to get an alternating output to work. Read through the forums on flip flop, toggle, etc. Found this site...
Replies
5
Views
4,214
Back
Top Bottom