Jump to content

Need Help with Turning Outputs in Subroutines

Recommended Posts

Hello All

I am calling a subroutine from the main and have two outputs linked to a button on the HMI screen.When i push the button, the two contacts and Output Coils energize but when i release the button the contacts turn off but the Output coils stay on. i have tried several combinations of contacts and coils...whenever i can get the output coils to energize they wont turn off.

What i am trying to do is...when i push the HMI button i need the outputs to energize as long as i hold the button on...then turn off when i release the button. 

Link to comment
Share on other sites

What type of coil are you using? If you are using set coils, that is why they are staying on. You would need to use direct coils in order for them to shut off when they are not powered.


Also, how are you calling the subroutine? Is it always running or does it only run when the buttons are pressed.


If they only run when the buttons are pressed then when you release the button it stops calling the subroutine. This will also cause the outputs to remain on since the logic that controls when the output turns on/off is in that section of ladder. If not called it will remain at it's previous state.

Link to comment
Share on other sites

Hello UniGuru

I have a HMI Button linked to MB 7, I then have a Direct Contact tied to MB 7 then linked to the Call Subroutine function in the main ladder, In the Subroutine I have Direct Contacts 3 of them tied to MB 7 linked to Direct Coils that are associated to my Outputs.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...