Hi guys, I'm trying to implement state machine in PLC. Need some advice on it
Attached is some code on my State Transition section.
Assuming that the instruction "JP 31" has been called, the code will now jump to "LBL 31" which is the beginning of my state transition code.
"JP 32" to "JP 37" are used to jump to my states (State 32 to 37) when certain conditions are met.
"DT 99" is the data register (Program Counter) where I store my current completed state number. Lets say i'm now at state 33 ("LBL 33" and "DT 99" = 32) and i've done what I needed to do there and am ready to transit to next state, what I'll do is in "LBL 33", i'll increase my Program Counter "DT 99" to 33 and after that jump back to "LBL 31". It will then 'hang' at rung 180 until T1 is HIGH. After that, it will jump/transit to state 34.
This is the concept that I have. However, my PLC will only arrive next week so I am not able to test whether it work or not.
Can somebody advice whether the code will work or not.. Will the instruction at rung 229 be executed since at rung 226, i've commanded it to jump back to "LBL 31".
Pls advice ya.. Thanks.
Attached is some code on my State Transition section.
Assuming that the instruction "JP 31" has been called, the code will now jump to "LBL 31" which is the beginning of my state transition code.
"JP 32" to "JP 37" are used to jump to my states (State 32 to 37) when certain conditions are met.
"DT 99" is the data register (Program Counter) where I store my current completed state number. Lets say i'm now at state 33 ("LBL 33" and "DT 99" = 32) and i've done what I needed to do there and am ready to transit to next state, what I'll do is in "LBL 33", i'll increase my Program Counter "DT 99" to 33 and after that jump back to "LBL 31". It will then 'hang' at rung 180 until T1 is HIGH. After that, it will jump/transit to state 34.
This is the concept that I have. However, my PLC will only arrive next week so I am not able to test whether it work or not.
Can somebody advice whether the code will work or not.. Will the instruction at rung 229 be executed since at rung 226, i've commanded it to jump back to "LBL 31".
Pls advice ya.. Thanks.