adccommunitymod (AutomationDirect) asked a question.

Set/Reset Output on Click

Created Date: October 26,2019

Created By: coda87

**** This post has been imported from our legacy forum. Information in this post may be outdated and links contained in the post may no longer work.****

Pretty simple question... Can't figure out what's happening here. I have a three position switch wired to a click PLC. The switch is a "return to center " selector switch. Middle position has no contacts, and each left & right positon both have a NO contact wired to an individual input on the click PLC. In position "JOG ".. I want to turn on a relay ONLY when the switch is held in that position. In position "RUN ".. I want to turn on a relay and keep it on even if the switch is released I am using the OUT command for the JOG input to turn on the relay only when the JOG switch is active, and the SET command for the RUN input to turn on the relay and maintain it on when run is active. However, RUN does not seem to turn on the relay? If I change both of the lines to be SET commands, it works fine (but in JOG, it stays active even when the switch is released, which is not the desired operation). I assume I need to have a reset command somewhere in here to reset the relay after the set command from the JOG position. But where would that go in here? Simple program.. screenshot here: https://ibb.co/cXJkcVH


  • adccommunitymod (AutomationDirect)

    Created Date: October 26,2019

    Created by: coda87

    Pretty simple question... Can't figure out what's happening here.

    I have a three position switch wired to a click PLC. The switch is a "return to center " selector switch. Middle position has no contacts, and each left & right positon both have a NO contact wired to an individual input on the click PLC.

    In position "JOG ".. I want to turn on a relay ONLY when the switch is held in that position.

    In position "RUN ".. I want to turn on a relay and keep it on even if the switch is released

    I am using the OUT command for the JOG input to turn on the relay only when the JOG switch is active, and the SET command for the RUN input to turn on the relay and maintain it on when run is active.

    However, RUN does not seem to turn on the relay? If I change both of the lines to be SET commands, it works fine (but in JOG, it stays active even when the switch is released, which is not the desired operation).

    I assume I need to have a reset command somewhere in here to reset the relay after the set command from the JOG position. But where would that go in here?

    Simple program.. screenshot here: https://ibb.co/cXJkcVH

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: October 26,2019

    Created by: johnaden

    The error is that you are specifying output Y1 twice. That means the output gets conflicting states. You need to combine the logic to drive Y1 output only once. There is a longer explanation dealing with PLC Scan cycle, but I'll reserve that for later.

  • adccommunitymod (AutomationDirect)

    Created Date: October 26,2019

    Created by: Adisharr

    Like John mentioned, the OUT command works differently than SET or RESET. You never want to use more than one OUT on the same bit. SET and RESET can use the same bit in multiple paces but that can also be a catch in larger programs when trying to figure out how it works.

    See if this example makes sense:

    { "data-align ": "none ", "data-size ": "full ", "title ": "Ladder example.png ", "data-attachmentid ":126143}

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: October 26,2019

    Created by: NevergoldMel

    Out of curiosity what stops it.

  • adccommunitymod (AutomationDirect)

    Created Date: October 28,2019

    Created by: johnaden

    When the rung with the output is determined to be true, the PLC writes a 1 value into an Output Image Register. If a subsequent rung causes a 0 value to be written into the same output location in the Output Image Register., it writes over the results from the first rung. At the End of the scan, the last entry into the Output Image Register. is sent out to the actual hardware output.

  • adccommunitymod (AutomationDirect)

    Created Date: October 28,2019

    Created by: kewakl

    When the rung with the output is determined to be true, the PLC writes a 1 value into an Output Image Register. If a subsequent rung causes a 0 value to be written into the same output location in the Output Image Register., it writes over the results from the first rung. At the End of the scan, the last entry into the Output Image Register. is sent out to the actual hardware output.

    Or, Last (scanned) Rung Wins.

    Forum admin, FIX THIS!

    This forum requires that you wait 120 seconds between posts. Please try again in 24 seconds.

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: October 28,2019

    Created by: coda87

    Thanks for the help...

    Adisharr, that program worked as intended. thank you!

  • adccommunitymod (AutomationDirect)

    Created Date: October 29,2019

    Created by: Huff360

    Or, Last (scanned) Rung Wins.

    Is it considered bad practice to call the same output in multiple sub-routines so long as you would only call 1 subroutine at a time?

    If so, what is the best practice for doing something like that? Activate two distinct C bits from the two subroutines, then OR the two bits to drive the coil in Main (or another sub you call each loop)?

    Thanks!

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: October 30,2019

    Created by: kewakl

    I don't know if it is BAD practice, but how many place s do you want to look/debug to find/correct an issue?

  • adccommunitymod (AutomationDirect)

    Created Date: October 30,2019

    Created by: quaizywabbit

    i always put outputs in their own sub called from the main. one stop shopping.

10 of 12