FB50 MAIN P03 Main programme management

[hit  <- on your browser to return]

 

 

 

Netzwerk 1: P03 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".P03.CrntModule := 103;

    END_IF;

END_IF;

 

 

 

Netzwerk 2: P03 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".P03.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();

 

 

 

Netzwerk 3: P03 SEQ1 start, stop, hold

#SEQ1.SSM.S.steph := NOT ("DI MAIN GLB".M00.AutoCmpltMa_run OR "DI MAIN GLB".M00.InchCmpltMa_run) AND #M00.SEQ1_Start;

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

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

#SEQ1();

 

 

 

Netzwerk 4: P03 FLT faults monitoring

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

 

 

 

Netzwerk 5: P03 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

        #STEP_BITS := 0;

        #STEP.SEQ1_Running := TRUE;

    END_IF;

END_IF;

 

 

 

Netzwerk 6: P03 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;

 

 

 

Netzwerk 7: P03 STEP.Done

IF #STEP.SEQ1_Done THEN

    #M00.SEQ1_Done := FALSE;

    #STEP_BITS := 0;

    #STEP.SEQ1_Write := TRUE;

    // Save current data

    "ModulDa".P03.STS.RunTimeCntr_seq := #MoDa.RunTimeCntrl_seq1;

    "ModulDa".P03.STS.WPC_Ok := #M00.SEQ1_DoWP1 AND #M00.SEQ1_WP1_DnNOK;

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

    "ModulDa".P03.TrgtModule := 104;

    // if necessary, change drive direction oto module 105

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

        "ModulDa".P03.TrgtModule := 105;

    END_IF;

    IF "DI OUT P03".HBS1.RdyToTakeIn_FrmNC THEN

        "ModulDa".BoxData := "DI OUT P03".HBS1_Box_Data; // BLK_MOV

    ELSIF "DI OUT P03".HBS2.RdyToTakeIn_FrmNC THEN

        "ModulDa".BoxData := "DI OUT P03".HBS2_Box_Data; // BLK_MOV

    END_IF;

    "AdminPC".P03 := "ModulDa".P03; // BLK_MOV to admin PC

END_IF;

 

After each box transfer whether it is to HBS1 or to HBS2, the PLC sends a message in reply to the MFC that transfer is done.

 

Netzwerk 8: P03 STEP.Write

IF #STEP.SEQ1_Write THEN

    #M00.SEQ1_WP1_DnOK := FALSE;

    #M00.TCPIP_Wrt_start := #SEQ1.DlyOnCommissionDone.Q;

    IF #M00.TCPIP_Wrt_done THEN

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

        IF NOT #M00.RdyToStart THEN

            "DI MAIN GLB".M00.AutoCmpltMa_run := FALSE;

        END_IF;

        #STEP_BITS := 0;

        "DI OUT P03".HBS1.RdyToTakeIn_FrmNC := "DI OUT P03".HBS2.RdyToTakeIn_FrmNC := FALSE;

        "DI OUT P03".HBS1_Box_Data := "DI OUT P03".HBS2_Box_Data := #tmp_del_hbs_box_data;

        RETURN;

    END_IF;

END_IF;

 

 

 

Netzwerk 9: P03 Run-Time

#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

        "ModulDa".P03.STS.RunTimeCntr_seq := #MoDa.RunTimeCntrl_seq1 := #MoDa.RunTimeCntrl_seq1 + 1;

    END_IF;

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

    #STEP.SEQ1_Start := TRUE;

END_IF;

 

 

 

Netzwerk 10: P03 SEQ1 busy

#M00.Busy :=

#STEP.SEQ1_Start AND #M00.SEQ1_Busy

OR #STEP.SEQ1_Running

OR #STEP.SEQ1_Done

OR #STEP.SEQ1_Write;

 

 

 

Netzwerk 11: P03 Assign signal light column (modular signal tower)

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;