Search code examples
plcladder-logic

How can i develop a mutual exclusivity feature between thee inputs of PLC program using ladder logic in CX-programmer?


I have three inputs; Speed1, Speed2, Speed3. These inputs can be selected through interactive graphics on an HMI. Currently I can select all three speeds by clicking all three buttons. However, I want to make it so that when one speed is selected, the other speed is unselected.

I currently have an error system in place where if two or more speeds are selected, the corresponding multi-speed binary output will not occur. However, I can still select two or more speeds on the HMI interface, something I would like to avoid.


Solution

  • This will depend on the capabilities of your HMI.

    Suggestion 1 (Recommended)

    When I have a situation like this, I usually use a button that can set a fixed value to a WORD variable and then create 3 buttons, each one writing a different and fixed value to the same variable when pressed, this avoids having inconsistency in the states:

    • Button A writes 0 in D100
    • Button B writes 1 in D100
    • Button C writes 2 in D100

    So I can use a comparison block (=) in the PLC:

    enter image description here

    If you need to show which button is activated, there are HMIs that can link the state of an image or button to WORD type variables as well, or you can use a Bit activated by the comparator itself and use it as an indicator for the button (for example, as a bit for each status ... W0.00 / W0.01 / W0.02).

    Suggestion 2

    If you need to use toggle buttons that set bits (like W0.01), at the beginning of the program you can use the rising edge (Right click > Differentiate > UP) and then reset the state of the other buttons, and only after that apply the speed according to the state of the button.

    This will only work if there is no other way to trigger these bits than through the HMI, or else you will need to study other ways of blocking.

    You have to do for each Button: enter image description here enter image description here

    Apply the velocity: enter image description here