How to monitor an event or an input in the background while your MachineLogic application is running
The goal of this post is to:
1- Monitor an input in the background and
2- Every time this input is at level one, execute a given sequence
Follow the steps below to do so
Create two child sequences:
1- "Monitor Input – Waiting": will allow you to monitor the input in the background forever
2- "Monitor Input – Triggered": will include the input you want to monitor and the commands you want it to trigger
In the sequence "Monitor Input – Triggered".
1- Add a Wait instruction.
2- Select Wait For Digital Input.
3- Fill in your input and its corresponding state.
4- Afterwards, add the commands that you want to execute
In the sequence " Monitor Input – Waiting ".
1- Add a Loop instruction.
2- Set the type to FOREVER.
3- Under Sequence Name select "Monitor Input – Triggered".
In the sequence "Main Sequence"
1- Add an Execution instruction.
2- Select Execute In Parallel.
3- Select the sequence "Monitor Input – Waiting".