Zuviel Werbung? - > Hier kostenlos beim SPS-Forum registrieren

Seite 2 von 2 ErsteErste 12
Ergebnis 11 bis 13 von 13

Thema: Pumpenpendelung

  1. #11
    Registriert seit
    27.05.2004
    Ort
    Thüringen/Berlin
    Beiträge
    12.218
    Danke
    533
    Erhielt 2.696 Danke für 1.948 Beiträge

    Standard


    Zuviel Werbung?
    -> Hier kostenlos registrieren
    @vladi

    Hi,
    wenn du zugibst, dass du es nicht geschrieben hast, und dich
    bei @UG entschuldigst, hilft er dir bestimmt.

    Vladi
    Das war hoffentlich nicht ernst gemeint!

    Zitat Zitat von TedescoA Beitrag anzeigen
    Ich habe Pumpenpendelung in SCL für 3 Pumpen geschrieben,
    ich möchte es auf 6 Pumpen ausbauen, leider habe ich die Übersicht verloren kann mir jemanden helfen?
    Ich würde den Satz anders interpretieren, wär schön wenn TedescoA das klargestellt hätte, aber er scheint ja nicht zu wissen, daß das schief ankommt.

    Ich habe hier eine Punmpendeckelung, die ist in SCL geschrieben. So kann man das auch lesen und nun fürft ohr ihm helfen oder evtl. auch mal nichts mehr posten.

    @TedescoA

    Probiere das mal. Hab es allerdings auch nur stur umgesetzt, sich damit genauer zu befassen, dauert schon seine Zeit.

    Code:
    FUNCTION FC200 : INT
    
    VAR_INPUT
    QUARTZ_Sec,QUARTZ_Min,READY1,READY2,READY3,READY4,READY5,READY6: BOOL;
    END_VAR
    VAR_OUTPUT
    RUN1, RUN2, RUN3,RUN4, RUN5, RUN6: BOOL;
    END_VAR
    VAR_IN_OUT
    REQUESTED, TurnOverPresetTime, TurnOverRemainTime, OverlapPresetTime, OverlapRemainTime, SEQ : INT;
    END_VAR
    VAR_TEMP
    AccountToReady, AccountToRun, xSeq, xReady, xRequest : INT;
    READY : ARRAY[1..7] OF BOOL;
    Run : array[1..6] of bool;
    END_VAR
    BEGIN
    //Initialise variable
    //--------------------
    AccountToRun := 0;
    AccountToReady := 0;
    xSeq := 1;
    xReady := 1;
    xRequest := 1;
    READY[1] := READY1;
    READY[2] := READY2;
    READY[3] := READY3;
    READY[4] := READY4;
    READY[5] := READY5;
    READY[6] := READY6;
    READY[7] := READY1;
    Run[1] := false;
    Run[2] := false;
    Run[3] := false;
    Run[4] := false;
    Run[5] := false;
    Run[6] := false;
    
    // Account ready inputs
    // --------------------
    WHILE xReady <= 6 DO
    IF READY[xReady] = true THEN AccountToReady := AccountToReady + 1; END_IF;
    xReady := xReady + 1;
    END_WHILE;
    xReady := 1;
    //Initialing of turn over, overlap time and sequence
    //--------------------------------------------------
    
    IF TurnOverRemainTime <= 0 AND OverlapRemainTime <= 0 THEN
    TurnOverRemainTime := TurnOverPresetTime;
    OverlapRemainTime := OverlapPresetTime;
    SEQ:= SEQ + 1;
    END_IF;
    IF SEQ < 1 OR SEQ > 6 THEN SEQ := 1; END_IF;
    // Overlap request
    // ---------------
    IF TurnOverRemainTime <= 0 AND OverlapRemainTime > 0 THEN Requested:= Requested + 1; END_IF;
    // Change sequence always when first of sequence isn't ready
    // ---------------------------------------------------------
    xReady := 1;
    WHILE xReady <= 6 DO
    IF READY[xReady] = false
    AND SEQ = xReady
    THEN
    SEQ := xReady + 1;
    TurnOverRemainTime := TurnOverPresetTime - 1;
    IF SEQ > 6 THEN SEQ := 1; END_IF;
    END_IF;
    xReady := xReady + 1;
    END_WHILE;
    // Change sequence always when second of sequence isn't ready
    // ---------------------------------------------------------
    xReady := 1;
    WHILE xReady <= 6 DO
    IF READY[xReady+1] = false
    AND SEQ = xReady
    THEN
    SEQ := SEQ - 3 + 2; //was soll das eigentlich??? versuch mal SEQ := SEQ - 1;
    TurnOverRemainTime := TurnOverPresetTime - 1;
    IF SEQ <=0 THEN SEQ := 6; END_IF;
    END_IF;
    xReady := xReady + 1;
    END_WHILE;
    
    //Algorithme
    //----------
    WHILE xSeq <= 6 DO
    IF SEQ=xSeq THEN xReady :=xSeq;
    WHILE xRequest <= 6 DO
    IF Requested = xRequest THEN
    WHILE xReady <= 6 DO
    IF READY[xReady] THEN Run[xReady]:= true;
    AccountToRun := AccountToRun + 1;END_IF;
    IF Requested = AccountToRun THEN xReady := 9999;
    ELSE xReady := xReady + 1;
    END_IF;
    IF xReady > 6 AND xReady <> 9999 THEN xReady := 1;END_IF;
    IF xReady = xSeq THEN xReady := 9999; END_IF;
    END_WHILE;
    END_IF;
    xRequest := xRequest + 1;
    END_WHILE;
    END_IF;
    xSeq := xSeq + 1;
    END_WHILE;
    //Discount turn over and overlap time
    //-----------------------------------
    IF AccountToReady > AccountToRun THEN
    IF QUARTZ_Min = true AND TurnOverRemainTime > 0 AND AccountToRun > 0 AND REQUESTED > 0
    THEN TurnOverRemainTime := TurnOverRemainTime - 1; END_IF;
    END_IF;
    
    IF QUARTZ_Sec = true AND OverlapRemainTime > 0 AND TurnOverRemainTime <= 0
    THEN OverlapRemainTime := OverlapRemainTime - 1; END_IF;
    //Ajustement of variable
    //----------------------
    Run1:= Run[1];
    Run2:= Run[2];
    Run3:= Run[3];
    Run3:= Run[4];
    Run3:= Run[5];
    Run3:= Run[6];
    
    FC200 := 1;
    
    END_FUNCTION
    Geändert von Ralle (30.01.2007 um 09:16 Uhr)
    Gruß
    Ralle

    ... there\'re 10 kinds of people ... those who understand binaries and those who don\'t …
    and the third kinds of people … those who love TIA-Portal

  2. #12
    Registriert seit
    28.06.2006
    Ort
    Königreich Neuseeland
    Beiträge
    2.027
    Danke
    133
    Erhielt 96 Danke für 76 Beiträge

    Standard

    Zitat Zitat von TedescoA Beitrag anzeigen
    Ich habe es geschrieben aber mit mithilfe von einen anderen SPS Programmierer.
    Hier die Lösung-> 6 Pumpen

  3. #13
    Registriert seit
    27.05.2004
    Ort
    Thüringen/Berlin
    Beiträge
    12.218
    Danke
    533
    Erhielt 2.696 Danke für 1.948 Beiträge

    Standard


    Zuviel Werbung?
    -> Hier kostenlos registrieren
    Ich hab das mal noch etwas in Form gebracht, sonst ist es sowieso unmöglich hier irgendwas zu verstehen:

    Code:
    FUNCTION FC200 : INT
    
    VAR_INPUT
    QUARTZ_Sec,QUARTZ_Min,READY1,READY2,READY3,READY4,READY5,READY6: BOOL;
    END_VAR
    VAR_OUTPUT
    RUN1, RUN2, RUN3,RUN4, RUN5, RUN6: BOOL;
    END_VAR
    VAR_IN_OUT
    REQUESTED, TurnOverPresetTime, TurnOverRemainTime, OverlapPresetTime, OverlapRemainTime, SEQ : INT;
    END_VAR
    VAR_TEMP
    AccountToReady, AccountToRun, xSeq, xReady, xRequest : INT;
    READY : ARRAY[1..7] OF BOOL;
    Run : array[1..6] of bool;
    END_VAR
    BEGIN
    //Initialise variable
    //--------------------
    AccountToRun := 0;
    AccountToReady := 0;
    xSeq := 1;
    xReady := 1;
    xRequest := 1;
    READY[1] := READY1;
    READY[2] := READY2;
    READY[3] := READY3;
    READY[4] := READY4;
    READY[5] := READY5;
    READY[6] := READY6;
    READY[7] := READY1;
    Run[1] := false;
    Run[2] := false;
    Run[3] := false;
    Run[4] := false;
    Run[5] := false;
    Run[6] := false;
    
    // Account ready inputs
    // --------------------
    WHILE xReady <= 6 DO
        IF READY[xReady] = true THEN 
            AccountToReady := AccountToReady + 1; 
        END_IF;
        xReady := xReady + 1;
    END_WHILE;
    xReady := 1;
    
    //Initialing of turn over, overlap time and sequence
    //--------------------------------------------------
    IF TurnOverRemainTime <= 0 AND OverlapRemainTime <= 0 THEN
        TurnOverRemainTime := TurnOverPresetTime;
        OverlapRemainTime := OverlapPresetTime;
        SEQ:= SEQ + 1;
    END_IF;
    IF SEQ < 1 OR SEQ > 6 THEN 
        SEQ := 1; 
    END_IF;
    
    // Overlap request
    // ---------------
    IF TurnOverRemainTime <= 0 AND OverlapRemainTime > 0 THEN 
        Requested:= Requested + 1; 
    END_IF;
    
    // Change sequence always when first of sequence isn't ready
    // ---------------------------------------------------------
    xReady := 1;
    WHILE xReady <= 6 DO
        IF READY[xReady] = false AND SEQ = xReady THEN
            SEQ := xReady + 1;
            TurnOverRemainTime := TurnOverPresetTime - 1;
            IF SEQ > 6 THEN 
                SEQ := 1; 
            END_IF;
        END_IF;
        xReady := xReady + 1;
    END_WHILE;
    
    // Change sequence always when second of sequence isn't ready
    // ---------------------------------------------------------
    xReady := 1;
    WHILE xReady <= 6 DO
        IF READY[xReady+1] = false AND SEQ = xReady THEN
            SEQ := SEQ - 3 + 2; //was soll das eigentlich??? versuch mal SEQ := SEQ - 1;
            TurnOverRemainTime := TurnOverPresetTime - 1;
            IF SEQ <=0 THEN 
                SEQ := 6; 
            END_IF;
        END_IF;
        xReady := xReady + 1;
    END_WHILE;
    
    //Algorithme
    //----------
    WHILE xSeq <= 6 DO
        IF SEQ=xSeq THEN 
            xReady :=xSeq;
            WHILE xRequest <= 6 DO
                IF Requested = xRequest THEN
                    WHILE xReady <= 6 DO
                        IF READY[xReady] THEN 
                            Run[xReady]:= true;
                            AccountToRun := AccountToRun + 1;
                        END_IF;
                        IF Requested = AccountToRun THEN 
                            xReady := 9999;
                        ELSE 
                            xReady := xReady + 1;
                        END_IF;
                        IF xReady > 6 AND xReady <> 9999 THEN 
                            xReady := 1;
                        END_IF;
                        IF xReady = xSeq THEN 
                            xReady := 9999; 
                        END_IF;
                    END_WHILE;
                END_IF;
                xRequest := xRequest + 1;
            END_WHILE;
        END_IF;
        xSeq := xSeq + 1;
    END_WHILE;
    
    //Discount turn over and overlap time
    //-----------------------------------
    IF AccountToReady > AccountToRun THEN
        IF QUARTZ_Min = true AND TurnOverRemainTime > 0 AND AccountToRun > 0 AND REQUESTED > 0 THEN 
            TurnOverRemainTime := TurnOverRemainTime - 1; 
        END_IF;
    END_IF;
    
    IF QUARTZ_Sec = true AND OverlapRemainTime > 0 AND TurnOverRemainTime <= 0 THEN 
        OverlapRemainTime := OverlapRemainTime - 1; 
    END_IF;
    
    //Ajustement of variable
    //----------------------
    Run1:= Run[1];
    Run2:= Run[2];
    Run3:= Run[3];
    Run3:= Run[4];
    Run3:= Run[5];
    Run3:= Run[6];
    
    FC200 := 1;
    
    END_FUNCTION
    Gruß
    Ralle

    ... there\'re 10 kinds of people ... those who understand binaries and those who don\'t …
    and the third kinds of people … those who love TIA-Portal

Lesezeichen

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •