Hello again, everyone.
Could anyone help me understand the best way to handle state transitions in ladder logic programs with Studio 5000? I currently have a system where I manage a NextState -> CurrentState mov instruction at the top of some of my routines. When a state is finished I move the value of the next state to the NextState tags and then on the next go around the machine moves along well.
The thing I have difficulty with is that I get to a routine by using a "StartRoutineX" tag. At the end of the last part of the routine I unlatch the "StartRoutineX" tag. At this point the routine I am in is no longer connected because the "NextState" variable for that routine has wrapped around to zero. However, it is as if the unlatching instruction continues to execute even when the subroutine it is inside is disconnected from the rest of the system control flow.
I guess this is the real issue of my confusion - I don't understand why latching instructions in a subroutine continue to hold even after I have returned from the subroutine.
Sorry if that is a little too confusing. Hopefully there is a simple answer to this that someone already has typed up somewhere else!
Could anyone help me understand the best way to handle state transitions in ladder logic programs with Studio 5000? I currently have a system where I manage a NextState -> CurrentState mov instruction at the top of some of my routines. When a state is finished I move the value of the next state to the NextState tags and then on the next go around the machine moves along well.
The thing I have difficulty with is that I get to a routine by using a "StartRoutineX" tag. At the end of the last part of the routine I unlatch the "StartRoutineX" tag. At this point the routine I am in is no longer connected because the "NextState" variable for that routine has wrapped around to zero. However, it is as if the unlatching instruction continues to execute even when the subroutine it is inside is disconnected from the rest of the system control flow.
I guess this is the real issue of my confusion - I don't understand why latching instructions in a subroutine continue to hold even after I have returned from the subroutine.
Sorry if that is a little too confusing. Hopefully there is a simple answer to this that someone already has typed up somewhere else!