Jump to content

Recommended Posts

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

  • MVP 2023

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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

Confirm to continue.