FB MAIN P01 : P01 Main programme management

[hit  <- on your browser to return]

 

 

 

Network 1: P01 Initialisation

IF #M00.Init OR NOT "M00 OB1 FirstCycle" THEN

    #STEP_BITS := 0;

    IF #M00.Init THEN

        #M00.SEQ1_Start := #M00.Init := FALSE;

        #M00.HomPosRun := TRUE;

        "ModulDa".P01.CrntModule := 101;

    END_IF;

END_IF;

 

 

 

Network 2: P01 SET execute home position

#SET.SSM.S.steps := #SET.SSM.S.stepa;

IF NOT #M00.HomPosRun OR "HMI KEY".P00.GLB.F8_Stop OR "HMI KEY".P01.GLB.F8_Stop OR #M00.FLT_ModuleStpSR THEN

    #SET.SSM.S.stepa := #M00.HomPosRun := FALSE;

ELSIF #M00.HomPosRun AND #SET.SSM.S.step0 THEN

    #SET.SSM.S.stepa := TRUE;

END_IF;

#SET();

 

 

 

Network 3: P01 SEQ1 start, stop, hold

#SEQ1.Support.steph := NOT "DI MAIN GLB".M00.AutoCmpltMa_run AND #M00.SEQ1_Start;

#SEQ1.SSM.S.steps := #DlySEQ1off.Q; //#SEQ1.SSM.S.stepa; mc210922

#DlySEQ1off(IN := #SEQ1.SSM.S.stepa,PT := t#400ms); // mc210922

#SEQ1.SSM.S.stepa := NOT #M00.HomPosRun AND #M00.SEQ1_Start;

 

#SEQ1();

 

 

 

Network 4: P01 FLT faults monitoring

#FLT(FLT_MODULE := #M00.FLT_ModuleIS);

 

 

 

Network 5: P01 STEP.SEQ1_Start

IF "DI MAIN GLB".M00.CmpltMaRun_Imp AND ("DI MAIN GLB".M00.AutoCmpltMa_run XOR "DI MAIN GLB".M00.InchCmpltMa_run) THEN

    #STEP.SEQ1_Start := TRUE;

    RETURN;

ELSIF #STEP.SEQ1_Start THEN

    IF NOT (#M00.HomPosRun OR #M00.SEQ1_Busy) THEN

        #M00.SEQ1_Start := TRUE;

    ELSIF #M00.SEQ1_Busy THEN

        #MoDA.RunTimeCntr_seq1 := 0;

        #STEP_BITS := 0;

        #STEP.SEQ1_Running := TRUE;

    END_IF;

END_IF;

 

 

 

Network 6: P01 STEP.SEQ1_Running

IF #STEP.SEQ1_Running THEN

    IF #M00.SEQ1_Done THEN

        #M00.SEQ1_Start := FALSE;

        #STEP_BITS := 0;

        #STEP.SEQ1_Done := TRUE;

        RETURN;

    END_IF;

END_IF;

 

 

 

Network 7: P01 STEP.Done

IF #STEP.SEQ1_Done THEN

    #M00.SEQ1_Done := FALSE;

    #STEP_BITS := 0;

    #STEP.SEQ1_Write := TRUE;

    // Save actual data   

    "ModulDa".P01.STS.RunTimeCntr_seq1 := #MoDA.RunTimeCntr_seq1;

    "ModulDa".P01.STS.WPC_Ok := #M00.SEQ1_DoWP1 AND #M00.SEQ1_WP1_DnOK;

    "ModulDa".P01.STS.Current_WP_Ok := #M00.SEQ1_WP1_DnOK AND NOT #M00.SEQ1_WP1_DnNOK;

    "ModulDa".P01.TrgtModule := 102;

    // If necessary, changing drive direction to module 105   

    IF NOT "ModulDa".P01.STS.Current_WP_Ok THEN

        "ModulDa".P01.TrgtModule := 105;

    END_IF;

    "AdminPC".P01 := "ModulDa".P01; // BLKMOV

END_IF;

 

 

 

Network 8: P01 STEP.Write

IF #STEP.SEQ1_Write THEN

    #M00.SEQ1_WP1_DnOK := FALSE;

    #M00.TCPIP_Wrt_start := TRUE;

    IF #M00.TCPIP_Wrt_done THEN

       #M00.TCPIP_Wrt_start := #M00.TCPIP_Wrt_done := FALSE;

       #STEP_BITS := 0;

       RETURN;

    END_IF;

END_IF;

 

 

 

Network 9: P01 Run-Time and Re-Start

#M00.Enabled := "DI MAIN GLB".M00.AutoCmpltMa_run AND NOT #M00.FLT_ModuleStpSR;

IF #STEP.SEQ1_Running THEN

    IF "M00_Imp_10Hz" AND #M00.Enabled THEN

        #MoDA.RunTimeCntr_seq1 := #MoDA.RunTimeCntr_seq1 + 1;

    END_IF;

ELSE

    IF NOT #M00.Busy AND "DI MAIN GLB".M00.AutoCmpltMa_run THEN

        #STEP.SEQ1_Start := TRUE;

    END_IF;

END_IF;

 

 

 

Network 10: P01 SEQ1 busy

#M00.Busy :=

#STEP.SEQ1_Start AND #M00.SEQ1_Busy

OR #STEP.SEQ1_Running

OR #STEP.SEQ1_Done

OR #STEP.SEQ1_Write;

 

 

 

Network 11: P01 Assign signal

IF #M00.FLT_ModuleIS THEN

    #M00.FLT_ModuleStpSR := TRUE;

END_IF;

IF #M00.FLT_ModuleStpSR AND NOT #M00.FLT_ModuleStpACK THEN

    IF "DI MAIN GLB".M00.FLT_CmpltMaACK_Imp THEN

        #M00.FLT_ModuleStpACK := TRUE;

    END_IF;

ELSIF NOT #M00.FLT_ModuleIS AND #M00.FLT_ModuleStpACK THEN

    #M00.FLT_ModuleStpSR := #M00.FLT_ModuleStpACK := FALSE;

END_IF;

#M00.SLC_Lamp_RD := #M00.FLT_ModuleStpSR AND NOT #M00.FLT_ModuleStpACK AND "M00_Clock_1Hz" OR #M00.FLT_ModuleStpSR AND #M00.FLT_ModuleStpACK;