adambg Posted December 12, 2016 Report Share Posted December 12, 2016 I have a COIL and a PROBE. When PROBE contact is raised (positive transitional) then energize COIL (this works): Probe Coil ---[P]---+--( )--- | Coil | ---[ ]---+ Now, how do I do the following: When PROBE contact is raised again (positive transitional) and COIL is already energized, then de-energize the COIL. Any help would be greatful as I already spent half a day trying to solve this.. I'm using VisiLogic ladder. SM43-J-T20. Thank you! Link to comment Share on other sites More sharing options...
adambg Posted December 12, 2016 Author Report Share Posted December 12, 2016 I finally found two solutions that seems to work. 1. Use toggle coil: Probe Coil ---[P]------(X) 2. Use toggle logic: Probe Coil Coil -------[P]---+---[ ]------(R) | | Coil Coil +---[/]------(S) Thank you all! Link to comment Share on other sites More sharing options...
Henny Posted December 15, 2016 Report Share Posted December 15, 2016 Hello third option nw1 Probe Coiltemp -------[P]----------(. ) nw2 Coil Coiltemp Coil ----[./ ]------[ ]--------------(. ) | Coil Coiltemp | ---[ ]------[/ ] ---------| Not so nicely. drawn but I think you understand kind regards Henny Link to comment Share on other sites More sharing options...
cantcliff Posted December 16, 2016 Report Share Posted December 16, 2016 On 12/12/2016 at 11:09 AM, adambg said: I finally found two solutions that seems to work. 1. Use toggle coil: Probe Coil ---[P]------(X) 2. Use toggle logic: Probe Coil Coil -------[P]---+---[ ]------(R) | | Coil Coil +---[/]------(S) Thank you all! Be careful using a conditional to set and reset the same coil on the same rung of logic. When the program is compiled to down to code it may not compile how you think and can give weird logic bugs. You can get conditions in the final code where the coil changes states between evaluations and you set and reset the coil on the same pass. I highly recommend separating the logic out into multiple rungs. Link to comment Share on other sites More sharing options...
stembera Posted December 30, 2016 Report Share Posted December 30, 2016 Hi, the second design is definitely wrong. Even if you break it into two rungs, you will get this: If Probe is set and Coil is set, the Coil will be reset. In the next rung, the positive transition of Probe is still active and Coil is in reset state. So it will be set again; i.e. these two rungs will make the Coil set not regarding its initial state. If you really like this design, you will need third bit variable, let's say Test. Test will be reset before the first rung, and it will be set in the case if Coil is reset. The setting rung should be called only if Test is still in reset state: Test -(R) Probe Coil Coil Test -[P]-------------| |-----(R)-----(S) Probe Test Coil Coil -[P]-----|/|-----|/|-----(S) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now