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,138
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
361
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,140
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
Back
Top Bottom