travisroberts88
Lifetime Supporting Member
I am curious on something with a Case Statement in Structured Text. I am not the greatest at it so I want to know if my assumption is wrong or not.
I have an issue with a tank not aborting and I feel like I know why, but I could be incredibly wrong.
//Issue Phase Complete Command
CASE Tank1234PhaseOwner OF
1:
Tank1234PhaseOwner:=0;
PSC();
12:
Tank1234PhaseOwner:=0;
PSC();
123:
Tank1234PhaseOwner:=0;
PSC();
1234:
Tank1234PhaseOwner:=0;
PSC();
12345:
Tank1234PhaseOwner:=0;
PSC();
0:
Tank1234PhaseOwner:=0;
PSC();
END_CASE;
In my head my Phase Complete [PSC();] command will never execute and trigger the END_CASE; because the last on having a Case for 0: Tank1234PhaseOwner: =0; PSC(); will never get to PSC because as it looks at the case it will always see a Case for 0 to set it to 0 and just loop forever. Is this thinking wrong? I don't have much details on why my abort function doesn't exit but this was the only thing that looked odd to me. Without having someone try to Abort and see what it actually does I am speculating and want to see if I'm understanding it correctly or not. Thanks!
I have an issue with a tank not aborting and I feel like I know why, but I could be incredibly wrong.
//Issue Phase Complete Command
CASE Tank1234PhaseOwner OF
1:
Tank1234PhaseOwner:=0;
PSC();
12:
Tank1234PhaseOwner:=0;
PSC();
123:
Tank1234PhaseOwner:=0;
PSC();
1234:
Tank1234PhaseOwner:=0;
PSC();
12345:
Tank1234PhaseOwner:=0;
PSC();
0:
Tank1234PhaseOwner:=0;
PSC();
END_CASE;
In my head my Phase Complete [PSC();] command will never execute and trigger the END_CASE; because the last on having a Case for 0: Tank1234PhaseOwner: =0; PSC(); will never get to PSC because as it looks at the case it will always see a Case for 0 to set it to 0 and just loop forever. Is this thinking wrong? I don't have much details on why my abort function doesn't exit but this was the only thing that looked odd to me. Without having someone try to Abort and see what it actually does I am speculating and want to see if I'm understanding it correctly or not. Thanks!