Admir Hodzic Posted January 19, 2019 Report Posted January 19, 2019 Hi, Why I can not use same output let say O1 that has to be activated with different conditions in different networks but in same subroutine? I have to use always auxiliary MBs for all those different conditions and then put them all in parallel to activate O1 in main routine.
MVP 2023 Ausman Posted January 20, 2019 MVP 2023 Report Posted January 20, 2019 "Why?" Because the very last net that refers to the output is the one that over-rides all the other ones. Remember that the controller steps through the ladder sequentially, rung by rung. An analogy is a number of people going into a room and wanting the lights either on or off. George goes in and turns them on. Geoff goes in next and wants them off. Derek goes in after him and wants them on. Last of all, Admir goes in and wants them off. Because Admir is the last person in the room before everyone else is allowed in again (the end of the scan) the lights are switched according to what Admir wants, (in this case OFF) totally ignoring any other preferences from George, Geoff and Derek. So if the need is for any of the 4 people to independently turn the lights on, they all have to have their request processed at the same time (in the same rung) and if any one or combination of them wants them on then it is done. There are variations of this rule according to whether the various controls are in subroutines that are being called, but for now this hopefully helps you understand this basic PLC programming rule. cheers, Aus 1
MVP 2023 Flex727 Posted January 20, 2019 MVP 2023 Report Posted January 20, 2019 And to just expand on what Ausman is saying. The actual physical output from the PLC is not altered until the complete ladder routine has finished executing. It is only the final state of the digital output coil that will be sent to the output module on each PLC scan. Also keep in mind that ladder code is not like other computer code. A direct coil that is not explicitly turned on is explicitly turned off. Understanding that last sentence is critical to understanding the difference between ladder logic and regular computer programming.
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