One input X0 every time trigger different output alternatively Y0 and Y1

Jack2809

Member
Join Date
Mar 2024
Location
Klang
Posts
2
Hi i would like to ask!
Im using Omron CP1E PLC
May i know how to use one input to trigger two outputs alternatively?

Meaning press X0 on, Y0 will on, Y1 is off. When X0 released Both off.
Then press X0 once again Y1 will on, Y0 is off
When X0 released both off
Process repeats alternatively for every input of X0
Please guide
 
Search for flip/flop logic.

Or, since this sounds like a class assignment. Show your work and we will help you learn how to do it, instead of copying someone else.

I'm sure there are more eloquent approaches, but assuming your Omron PLC has rising edge logic, this can be done in three, easy to understand rungs of logic.
 
Last edited:
The first thing you'll want to accomplish is detecting when Input X0 transitions from off to on and on to off. Different PLCs use different methods to provide for creating a single scan pulse when a rising or falling transition of a particular bit occurs. In Ladder Logic, some use a special output function called a 1-Shot coil. Some offer low to high and high to low transition contacts. Even if your PLC doesn't provide transitional functions in it's instruction set, it's possible to create a 1-shot circuit with basic Ladder Logic functions. Here's an example roll-your-own 1-Shot for a rising edge transition that assumes synchronous IO updates:

1710342883058.png

Once you have created a means to detect when X0 transitions on or off, you'll be well on your way to writing flip/flop logic that meets your stated criteria.
 
Some PLC have ALT function block which works to give alternate output Y0 and Y1, but Omron dont have such function can guide me with PLC sample in how to switch output Y0 and Y1 everytime X0 is triggered
 
  • Have you found a toggle/flip-flop/alternating circuit yet?
  • Do you know how to detect the difference between
    • whether the value of X0 has transitioned from 0 to 1, or from 1 to 0, on a single scan cycle, and
    • the level of X0's value (0 or 1) on every scan cycle?
  • Do you know how to keep track of whether Y0 or Y1 was on most recently for scan cycles when X0's value is 0?
  • Do you know what a scan cycle is?
  • Do you know that the PLC is a discrete device?
 
Yes a counter is probably the best although it could be done with simple logic here is one with a counter
 

Attachments

  • One_Two_Off Toggle.png
    One_Two_Off Toggle.png
    40.6 KB · Views: 8
And I offer this, not as an improvement (because it's not*) on @TheWaterboy's and @parky's most excellent solution, but rather to get OP thinking about the different ways this could be done.

One_Two_Off_Toggle_drbitboy.png

* this is not an improvement, nor should it even be in production, nor turned in for an assignment, because @parky's solution is easier to read and understand, while this requires thinking more deeply about the internals of the CTU to understand why it works.
 

Similar Topics

My program is initiated by a N.O. input and once it is closed, it stays closed until the end of the program cycle (program is still running in PLC...
Replies
15
Views
4,155
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
59
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
248
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
68
All, I have a PowerFlex 525 driving an agitator motor. The goal is to have the agitator start automatically after a power loss or a comm loss. I...
Replies
2
Views
86
Back
Top Bottom