Stop process when DI is off

Greetings,

In case of pick and place application, we have a vacuum sensor, connected to DI, which is TRUE, when we successfully pick a part.
In case of any situation, where robot drops the part, the DI will go FALSE.
How in this situation to interrupt execution of the program, and to return the at home position a request for new cycle?
I think for IF DI = TRUE do something construction, but my understanding, that it would become quite a lot nested IF constructions.
It would become a rather cumbersome structure.

Is there more elegant approach?
Regards,
Svetozar

Use the “Check expression continuously” box in the IF statement.

This means that the condition DI=True will be tracked as long as the things inside the IF statement are still running
The concept is important because once you are out of the IF, the condition won’t be checked again.
An idea of what you can do:

image

Notice that the program will go out of the IF immediately, for example, midway of task 2.
Therefore the system recommends you to use “stopl”, so in case the robot is midway of a movement, this movement ends in a smooth way.

1 Like

Dear cags,

many thanks for your notes and comments.
This is exactly what I need.

Best regards,
Svetozar