I have a idea of making use of sub-routines to model a state machine since the sub-routines can be make to only be called when its inputs ladders condition is true.
But to do that, I need to fully understand how a relay that got energized within a sub-routine will behave after the calling of that sub-routine is isolated.
To further explain my question, I will create a scenarios of a simple ladder program here.
Let say we have Input 1, Sub-routine "Sub1", Relay 1, Timer (Delay) 1, Output 1. Se