cantcliff Posted May 7, 2015 Report Share Posted May 7, 2015 I haven't been able to find a good answer to this in the documentation or through the forum search. If I'm using an HMI screen to run a subroutine as 'While Display,' will the '! Main Subroutine' still scan every cycle or does the 'While Display' take precedence and skip '! Main' at that point? Much appreciated. Link to comment Share on other sites More sharing options...
s.pratt Posted May 7, 2015 Report Share Posted May 7, 2015 Hello, The Main Routine will still run every cycle with the "While Displayed" routine. Hope this helps. Link to comment Share on other sites More sharing options...
cantcliff Posted May 7, 2015 Author Report Share Posted May 7, 2015 Very much so, drastically affects how I approach the logic. Much appreciated. Link to comment Share on other sites More sharing options...
MVP 2023 Flex727 Posted May 8, 2015 MVP 2023 Report Share Posted May 8, 2015 Great question - and the answer I expected. On that same subject, subroutines run in the order they are called in the Main Routine. Where does the "While Displayed" routine fall in that order - at the beginning of the Main Routine, the end, or somewhere in the middle? Link to comment Share on other sites More sharing options...
cantcliff Posted May 8, 2015 Author Report Share Posted May 8, 2015 Great question - and the answer I expected. On that same subject, subroutines run in the order they are called in the Main Routine. Where does the "While Displayed" routine fall in that order - at the beginning of the Main Routine, the end, or somewhere in the middle? It was the answer I was hoping for, as I had already planned the logic around that but wanted to make sure before anything with live. I'd love to see the answer to your question as it may lead some insight into some problems a co-worker is having as well. Link to comment Share on other sites More sharing options...
s.pratt Posted May 8, 2015 Report Share Posted May 8, 2015 Hello, The "While Displayed" subroutine will "run first", and then the Main routine will run. In other words, the last statement seen before updating the HMI, comms, and outputs will be from the Main Routine. Hope this helps. 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