One Input, Alternating two outputs, RSLogix 5000

Robb B

Lifetime Supporting Member
Join Date
Feb 2011
Location
BC, Canuckistan
Posts
373
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 looking to install a smaller less sophisticated PLC for fountain timing and also one analog pressure sensor which would be used to detect...
Replies
23
Views
560
Hello All, After trying to transfer some field changes on the safety scanner microscan3, and verifying, the device is stuck at .... waiting for...
Replies
0
Views
75
I have a 120V relay, 120V DI card and a analog input. I was wanting to know if i could put a 24V DI and well as a 120V DI card on the same plc...
Replies
1
Views
101
Hello, I'm looking for a dirt cheap digital display + input, that would be wired to an analog input and analog output. This would be for my home...
Replies
10
Views
281
Hello, I am trying to read a barcode scanner input using a cognex dataman 280 barcode reader, store it another string, the compare with another...
Replies
1
Views
105
Back
Top Bottom