No announcement yet.

Using the same Output coil twice in a Click PLC program

  • Filter
  • Time
  • Show
Clear All
new posts

  • Using the same Output coil twice in a Click PLC program

    I realize that if you use the same output coil twice, the program will react to the state of the last occurrence of the output coil during the execution of the program. However if I set up two separate sub routines called by two different conditions, but in each subroutine the same output coil exist, do I still have a problem?

    To minimize PLC code, I need to provide the ability to manually force on all real outputs thru an HMI as part of diagnostics screen. If one subroutine is the manually forcing and the other sub routine is the normal machine code to run,and based upon a selector switch on the HMI only one subroutine can be called during the program. Will this work? Do not want to create two separate internal coils (Cnn) and than have a line of code which turns on the real output.

    Any input will be greatly appreciated.

  • #2
    The method you mention would most likely work, although making the internal Cbits for each instance that the output would be turn on really is the way to go.
    Having the Output turning on/off in more than one location creates a dependency that a programmer must keep in mind to prevent unanticipated results.
    A second person programming is also likely to miss this or have difficulty in understanding the logic.


    • #3
      You can change the state of an output as many times as you want during the length of your program. The output itself will only be affected by the last change before the end of your program which marks the end of scan.

      Whether you keep changing the state of an output during one scan time won’t reflect in the actual state of the output.

      the paradigm of programming a plc requires that you do all changes in control bit and only update the output once. The reason being that if you have multiple rings that facet the same output it will be difficult to follow program logic.

      i did encounter programs where the same output is either energized by rung logic, to be even set or reset or toggled in other rungs. While this works, because it is logically prone to random results, it is considered bad practice.


      • #4
        I haven't tried what you are proposing with the Click, but I know it will not work on the Rockwell 500 series.
        Automation & Electronic Controls

        Design, Build, Repair, Training