Valmir Posted January 26, 2014 Report Share Posted January 26, 2014 Hello I used a Drum Sequencer to jump through subroutines (to energize in a particular order), but the problem is that when the Drum energizes the certain subroutine, the outputs are energized this is the good part but when i jump to the next step meaning the next subroutine is energized and the old subroutine is de energized, power should flows only in the new subroutine and de energize the old outputs of the old subroutine, problem is that even thou it jumps to new subroutine and energizes the outputs of new subroutine it does not de energize the old subroutine outputs. So in the next subroutine the old and the new subroutine outputs are active, what i need to do is to stop the old subroutine outputs while I'm in new subroutine. According to help file, if the subroutine is not energized the outputs should no be energized, right!!, in my case even thou the power in subroutine is not energized any more ( i can see it from the online mode) but still the output remain energized. What is that I'm doing wrong. I will attach the project too, so that you guys can have a better idea of what is going on. PS you can see in the drum config FB, step 1 lasts 5 sec doing nothing, step 2 activates subroutine 1 containing two outputs , step three should stop this two output in subroutine 1 and step four activates subroutine 2 activating one output... Any help is much appreciated, i really have a tight deadline i need to rep it up quickly thank in advance. Exampe for the forum.vlp Quote Link to comment Share on other sites More sharing options...
TozoM8 Posted January 26, 2014 Report Share Posted January 26, 2014 You could just use the drum for the outputs. It is much easier and keeps the program clean. If you want different orders or times just make as many drums as you want. I also like to use one net for one logic. It makes it easier to find problems. Quote Link to comment Share on other sites More sharing options...
MVP 2022 Flex727 Posted January 27, 2014 MVP 2022 Report Share Posted January 27, 2014 My experience is that a coil remains in the state it was last in when the ladder rung stops being executed. This makes sense since the coil had no logic executed to turn it off (if it was last on, for example). This will also crop up when a subroutine is conditionally executed. Any state change, whether bit, integer, or what-have-you, must be actively executed in order to occur - either off or on. 2 Quote Link to comment Share on other sites More sharing options...
Valmir Posted January 27, 2014 Author Report Share Posted January 27, 2014 You could just use the drum for the outputs. It is much easier and keeps the program clean. If you want different orders or times just make as many drums as you want. I also like to use one net for one logic. It makes it easier to find problems. Thank TozoM8 for the advice, that is what i did. Now i m using drum to activate different MB whitch than i condition different outputs and it works fine. It s first time that im using Drum sequencer FB, and i think that is a very powerfull tool, i m sure in future i will use it a lot. Quote Link to comment Share on other sites More sharing options...
Valmir Posted January 27, 2014 Author Report Share Posted January 27, 2014 My experience is that a coil remains in the state it was last in when the ladder rung stops being executed. This makes sense since the coil had no logic executed to turn it off (if it was last on, for example). This will also crop up when a subroutine is conditionally executed. Any state change, whether bit, integer, or what-have-you, must be actively executed in order to occur - either off or on. Thanks for the reply Flex727, since now I'm using drum to activate different MB which than i condition different outputs and for this project suits very well. I m not using the subroutines, but it would be interesting to fully understand how subroutines really work, and what you wrote makes sense. Thanks again for the reply. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.