Cambio Programa IS2000 PLC-Schneider M241

Progrma PLC:

CASE iStepPulseTrain OF
0:
iAuxProgram:= 0;
IF i_xExecute THEN
iStepPulseTrain:=10;
END_IF
10:
IF TON_20ms.Q THEN
iStepPulseTrain:=20;
END_IF
20:
IF TON_10ms_Off.Q THEN
iStepPulseTrain:=30;
END_IF

30:
IF TON_10ms.Q THEN
iAuxProgram:=iAuxProgram + 1;
IF iAuxProgram >= i_iNumProgram THEN
iStepPulseTrain:=50;
i_xExecute:=FALSE;
ELSE
iStepPulseTrain:=40;
END_IF
END_IF

40:
IF TON_10ms_Off.Q THEN
iStepPulseTrain:=30;
END_IF
50:
IF TON_10ms_Off.Q THEN
iStepPulseTrain:=51;
END_IF

51:
IF TON_20ms.Q THEN
iStepPulseTrain:=100;
END_IF

100:
IF NOT i_xExecute THEN
iStepPulseTrain:=0;
END_IF

END_CASE
o_xPulseTrain:=iStepPulseTrain=10 OR iStepPulseTrain=30 OR iStepPulseTrain=51;
TON_20ms(IN:=(iStepPulseTrain=10 OR iStepPulseTrain=51),PT:=T#19MS);
TON_10ms(IN:=(iStepPulseTrain=30),PT:=T#09MS);
TON_10ms_Off(IN:=(iStepPulseTrain=40 OR iStepPulseTrain=50 OR iStepPulseTrain=20),PT:=T#09MS);