MVP 2022 Ausman Posted May 18, 2022 MVP 2022 Report Share Posted May 18, 2022 Hi all, if you are new to Vision and Visilogic, one thing that constantly crops up on the forum is the correct use of subroutines. This is discussed in depth at point 11 in https://forum.unitronics.com/topic/6229-ongoing-20-topics-almost-worth-pinning/ but a quick overview is here to alert you in the first place. If you STOP calling a sub, then everything in it will remain exactly the way the sub was setting things on the scan when the conditional call stops. They do NOT change state at all when the call ceases, until different areas of the ladder that are still active work on the operands/elements involved. If the sub turns a MB on, it remains ON when the sub ceases to be called. It is very easy to think along the lines of if the power is not supplied to the sub, because the power rail supplying the MB has gone off, the MB will go OFF if it was ON. This is not true and is a very important thing to understand. The ongoing list is a good thing to go through completely anyway. And another topic that explains things well: https://forum.unitronics.com/topic/7081-subroutines/ cheers, Aus Quote Link to comment Share on other sites More sharing options...
MVP 2022 Flex727 Posted May 19, 2022 MVP 2022 Report Share Posted May 19, 2022 This is well worth paying attention to and is a strong reason that conditional subroutine calls should be avoided. 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.