One Input, Alternating two outputs, RSLogix 5000

Robb B

Lifetime Supporting Member
Join Date
Feb 2011
Location
BC, Canuckistan
Posts
362
Hi Everyone, trying to get an alternating output to work. Read through the forums on flip flop, toggle, etc. Found this site http://accautomation.ca/creating-a-flip-flop-circuit-in-the-plc/ which seems to do what I want, but not sure about implementing it on control logix. I tried with ONS and a similar logic, but not quite getting the results.

Basically, one input (joystick button) needs to activate output 1 with the first press, and output 2 with the second press while cancelling the previously activated output.
 
The example of the logic on that site should work. But for the ONS you'll need to create a bit.

 IN      BIT               ONS PULSE
-||-----[ONS]----------------(OTE)



Then use that OTE address and an XIC where they have the X0 Oneshot instruction. I don't think that instruction exists in ControLogix (or, if it does, I never used it, coming from 500/Micro platform).
 
Last edited:
Whichever "method" you choose, you must consider what happens to the toggled bit on processor restart, whether that is a power outage, or a processor mode-change.

Many of the examples will "reset" the toggled bit to a default state, and that may not be desirable.

My personal preference is to use a method that always remembers the state of toggled bits, and to program a specific reset of them if I don't want their state remembered through a processor restart. In other words, the programmer is making the decision, not the hardware.

I use a counter, driven by the "toggling" input. The counter's accumulator bit 0 will toggle on and off with each successive toggle input, and there's no need for a one-shot either. The counter accumulator will eventually "rollover" after 2,147,483,647 counts, but that is not an issue, it will count forever, and bit 0 will always alternate 0-1-0-1 etc. Just ignore the actual "value" in the accumulator. The counter is a "retentive" instruction, so the accumulator will always be remembered through a power-cycle or mode-change.
 
My personal preference is to use a method that always remembers the state of toggled bits, and to program a specific reset of them if I don't want their state remembered through a processor restart. In other words, the programmer is making the decision, not the hardware.

I use a counter, driven by the "toggling" input. The counter's accumulator bit 0 will toggle on and off with each successive toggle input, and there's no need for a one-shot either. The counter accumulator will eventually "rollover" after 2,147,483,647 counts, but that is not an issue, it will count forever, and bit 0 will always alternate 0-1-0-1 etc. Just ignore the actual "value" in the accumulator. The counter is a "retentive" instruction, so the accumulator will always be remembered through a power-cycle or mode-change.

Great example, this is why I follow PLC.net, simple straight forward logic tips.

Regards,
Sydney
 

Similar Topics

Hi, I have a ControlLogix system with 1756-IF16 analogue inputs. I can't scale the inputs at the card as there is a requirement to facilitate...
Replies
14
Views
363
I'm having trouble calming down 2 Tempo Sonics. I'm using Studio 5000 CompactLogix my Raw value is jumping around from 8575.0 to 8755.0 at a...
Replies
30
Views
1,143
I cannot add SLC500 analog input tag (I: 8.3) to EZSeries Touch Panel Editor (V 5.3). I used all the listed tag datatype but it all says "Invalid...
Replies
10
Views
259
Hi, I have questions. I have Analog Input that need to put into Ignition Designer. But I don't know how to put?
Replies
1
Views
119
Omron AD081-V1 Analog Input Card Offset & Gain Adjustment Entering Adjustment Mode 1. Set the input card in adjustment mode (Turn ON Dip SW No-1)...
Replies
0
Views
88
Back
Top Bottom