[?+]: Help in SCL Commands (if possible,some samples)

SIMATIC S7-200/300/400, Step7, PCS7, CFC, SFC, PDM, PLCSIM,
SCL, Graph, SPS-VISU S5/S7, IBHsoftec, LOGO ...
alansal
Posts: 60
Joined: Mon Sep 24, 2007 1:03 pm
Location: Somewhere in Europe

[?+]: Help in SCL Commands (if possible,some samples)

Post by alansal »

Hi All,

I need some advices and data in SCL,please help.

The problem is i need to use GOTO, i will paste some of the program but the goto does not start... =(
plus i am afraid to have a infinite loop (need advices accordingly) and stop the plc because currently the cpu is in run mode in a electrical power plant...

Thanks in advance....

Cheers...

Mert,

(this is how i wrote to start the goto command to double check the setpoints)

Code: Select all

IF SFC_Overload_offset > 0 AND (G1_SFC_IN+G2_SFC_IN+G3_SFC_IN+G4_SFC_IN+G5_SFC_IN+G6_SFC_IN+G7_SFC_IN+G8_SFC_IN+G9_SFC_IN+G10_SFC_IN+G11_SFC_IN+G12_SFC_IN+G13_SFC_IN+G14_SFC_IN+G15_SFC_IN+G16_SFC_IN) < (SFC_count*8730)
THEN 
GOTO OFFSET_CALC;
END_IF;


(this is some of the logic planned....)

OFFSET_CALC:

//This calculation is re-placed here in order to prevent vicious circle of the SP's
SFC_Overload_offset := REAL_TO_INT(Teias_SP)-(G1_SFC_IN+G2_SFC_IN+G3_SFC_IN+G4_SFC_IN+G5_SFC_IN+G6_SFC_IN+G7_SFC_IN+G8_SFC_IN+G9_SFC_IN+G10_SFC_IN+G11_SFC_IN+G12_SFC_IN+G13_SFC_IN+G14_SFC_IN+G15_SFC_IN+G16_SFC_IN);


SFC_Overload[1] := G1_SFC_Overload AND SFC_Genset[1];
SFC_Overload[2] := G2_SFC_Overload AND SFC_Genset[2];
SFC_Overload[3] := G3_SFC_Overload AND SFC_Genset[3];
SFC_Overload[4] := G4_SFC_Overload AND SFC_Genset[4];
SFC_Overload[5] := G5_SFC_Overload AND SFC_Genset[5];
SFC_Overload[6] := G6_SFC_Overload AND SFC_Genset[6];
SFC_Overload[7] := G7_SFC_Overload AND SFC_Genset[7];
SFC_Overload[8] := G8_SFC_Overload AND SFC_Genset[8];
SFC_Overload[9] := G9_SFC_Overload AND SFC_Genset[9];
SFC_Overload[10] := G10_SFC_Overload AND SFC_Genset[10];
SFC_Overload[11] := G11_SFC_Overload AND SFC_Genset[11];
SFC_Overload[12] := G12_SFC_Overload AND SFC_Genset[12];
SFC_Overload[13] := G13_SFC_Overload AND SFC_Genset[13];
SFC_Overload[14] := G14_SFC_Overload AND SFC_Genset[14];
SFC_Overload[15] := G15_SFC_Overload AND SFC_Genset[15];
SFC_Overload[16] := G16_SFC_Overload AND SFC_Genset[16];
SFC_Overload_i := 0;
FOR I := 1 TO 16 DO
    IF SFC_Overload[I] THEN
        SFC_Overload_i := SFC_Overload_i + 1;
    END_IF;
END_FOR;

SFC_Overload_count := SFC_count-(SFC_Overload_i+1);

IF NOT SFC_Overload[1] AND SFC_Genset[1] THEN G1_SP2 := (G1_SP1+REAL_TO_INT(INT_TO_REAL(SFC_Overload_offset)/INT_TO_REAL(SFC_Overload_count))); ELSE G1_SP2 := G1_SP1; END_IF;
IF PFC_Genset[1] THEN G1_SP2 := G1_SP2-PFC_Reserve_1; END_IF;
IF PFC_Genset[1] AND SFC_Genset[1] AND G1_SP1 > G1_SFC_MAX-PFC_Reserve_1 AND G1_SFC_MAX-PFC_Reserve_1 > 0 THEN G1_SP1 := G1_SFC_MAX-PFC_Reserve_1; END_IF;
IF (PFC_Genset[1] AND G1_SP2 > G1_kW_MAX-PFC_Reserve_1) THEN G1_SP2 := G1_kW_MAX-PFC_Reserve_1; END_IF;
IF INT_TO_REAL(G1_SP2) < (INT_TO_REAL(2619)+INT_TO_REAL(PFC_Reserve_1)) THEN G1_SP2 := REAL_TO_INT(INT_TO_REAL(2619)+INT_TO_REAL(PFC_Reserve_1)); END_IF;
.
.
alansal
Posts: 60
Joined: Mon Sep 24, 2007 1:03 pm
Location: Somewhere in Europe

Re: [?]: Help in SCL Commands (if possible,some samples)

Post by alansal »

solved the problem via "for" comment....


thanks for interest....