Hi,
I'm trying to get some good habits regarding structured text.
So that's why I'm looking for some info from others with experience in that area.
I've added a small program where the same output is controlled in each step (or where it is needed)
Would you handle it like this.
Case Istate of
0:
Motor1:=FALSE;
IF Statement_1 then
Istate:=10;
END_IF
10:
Motor1:=TRUE;
IF Statement_2 then
Istate:=20;
END_IF
20:
Motor1:=FALSE;
IF Statement_3 then
Istate:=30;
END_IF
30:
Motor1:=TRUE;
And so on...
End_Case
Or more like when making a Ladder program, where the output is only set one place, and then controlled by the steps.
Like this:
If Istate = 10 OR Istate = 30 then
Motor1:=TRUE;
ELSE Motor1:=FALSE;
Thanks!
I'm trying to get some good habits regarding structured text.
So that's why I'm looking for some info from others with experience in that area.
I've added a small program where the same output is controlled in each step (or where it is needed)
Would you handle it like this.
Case Istate of
0:
Motor1:=FALSE;
IF Statement_1 then
Istate:=10;
END_IF
10:
Motor1:=TRUE;
IF Statement_2 then
Istate:=20;
END_IF
20:
Motor1:=FALSE;
IF Statement_3 then
Istate:=30;
END_IF
30:
Motor1:=TRUE;
And so on...
End_Case
Or more like when making a Ladder program, where the output is only set one place, and then controlled by the steps.
Like this:
If Istate = 10 OR Istate = 30 then
Motor1:=TRUE;
ELSE Motor1:=FALSE;
Thanks!