FB70 MAIN P05 : Guid rail control - main module program (master)

[hit  <- on your browser to return]

 

 

 

Netzwerk 1: P05 Initialisation

 

IF "M05 Init" OR NOT "M00 OB1 FirstCycle" THEN

    "M05 MW78" := #STEP_BITS := 0;

    IF "M05 Init" THEN

        "M05 MD70" :=

        "M05 MD74" := 0;

        "M05 RunHomPos" := TRUE;

        "DatOfMod".P05.CrntModule := 105;

    END_IF;

END_IF;

 

 

 

Netzwerk 2: P05 SET execute home position

 

IF "M05 RunHomPos" AND #SET.SET.S.step0 THEN

    #SET.SET.S.steps := TRUE;

END_IF;

 

IF NOT "M05 RunHomPos" OR "HMI KEY".SYS.GLB.F8_Stop OR "HMI KEY".P05.GLB.F8_Stop THEN

    #SET.SET.S.steps := "M05 RunHomPos" := FALSE;

END_IF;

 

#SET.SET.S.steph := "M05 FLT ModuStp";

 

#SET(ACT_STEP => #SET.STEP_NO);

 

 

 

Netzwerk 3: P05 SEQ1 start, stop, hold

 

#SEQ1.SSM1.S.steph := "M05 SEQ1 Start" AND NOT "M00 AutoCmpltMa run";

#SEQ1.SSM1.S.steps := NOT "M05 RunHomPos" AND "M05 SEQ1 Start";

 

#SEQ1(ACT_STEP => #SEQ1.STEP_NO);

 

 

 

Netzwerk 4: P05 FLT faults monitoring

 

#FLT(FLT_MODULE := "M05 FLT ModuStp");

 

 

 

Netzwerk 5: P05 STEP.SEQ1_Start

 

IF "M00 TrnsSysRun Imp" AND "M00 AutoCmpltMa run" THEN

    #STEP.SEQ1_Start := TRUE;

    RETURN;

ELSIF #STEP.SEQ1_Start THEN

    IF NOT "M05 RunHomPos" AND NOT "M05 SEQ1 Active" THEN

        "M05 SEQ1 Start" := TRUE;

    ELSIF "M05 SEQ1 Active" THEN

        #STEP_BITS := 0;

        #STEP.SEQ1_Running := TRUE;

        #MaDa.RunTimeCntrl_seq1 := 0;

        "M05 SEQ1 WP1 DnOK" := "M05 SEQ1 DoWP1" := FALSE;

    END_IF;

END_IF;

 

 

 

Netzwerk 6: P05 STEP.SEQ1_Running

 

IF #STEP.SEQ1_Running THEN

    IF "M05 SEQ1 Done" THEN

        "M05 SEQ1 Active" := "M05 SEQ1 Start" := FALSE;

        #STEP_BITS := 0;

        #STEP.SEQ1_Done := TRUE;

        RETURN;

    END_IF;

END_IF;

 

 

 

Netzwerk 7: P05 STEP.Done

 

IF #STEP.SEQ1_Done THEN

    "M05 SEQ1 Done" := FALSE;

    #STEP_BITS := 0;

    #STEP.SEQ1_Write := TRUE;

    // Save actual data   

    "DatOfMod".P05.STS.RunTimeCntr_seq1 := #MaDa.RunTimeCntr_seq1;

    "DatOfMod".P05.STS.WPC_ok := "M05 SEQ1 DoWP1" AND "M05 SEQ1 WP1 DnOK";

    "DatOfMod".P05.STS.CrntWP_ok := "M05 SEQ1 WP1 DnOK" AND NOT "M05 SEQ1 WP1 DnNOK";

   

    "DatOfMod".P05.TrgtModule := 101;

    // If necessary, changing drive direction to module 106   

    IF NOT "DatOfMod".P05.STS.CrntWP_ok THEN

        "DatOfMod".P05.TrgtModule := 106;

    END_IF;

    "DatOfPLC".P05 := "DatOfMod".P05; // Block move

END_IF;

 

 

 

Netzwerk 8: P05 STEP.Write

 

IF #STEP.SEQ1_Write THEN

    "M05 TCP/IP Wrt start" := TRUE;

   

    IF "M05 TCP/IP Wrt done" THEN

        #STEP.SEQ1_Write :=

        "M05 TCP/IP Wrt start" := "M05 TCP/IP Wrt done" := FALSE;

    END_IF;

END_IF;

 

 

 

Netzwerk 9: P05 Run-Time

 

IF #STEP.SEQ1_Running THEN

    IF "M00 Imp 10Hz" AND "M05 Enabled" THEN

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

    END_IF;

ELSE

    IF NOT "M05 Active" AND ("M00 ManuCmpltMa run" AND "HMI KEY".P05.GLB.F19_GoToStep OR "M00 AutoCmpltMa run") THEN

        #STEP.SEQ1_Start := TRUE;

    END_IF;

END_IF;

 

 

 

Netzwerk 10: P05 SEQ1 active

 

"M05 Active" :=

#STEP.SEQ1_Start AND "M05 SEQ1 Active"

OR #STEP.SEQ1_Running

OR #STEP.SEQ1_Done

OR #STEP.SEQ1_Write;

 

 

 

Netzwerk 11: P05 Assign signal

 

IF "M05 FLT ModuStpIS" THEN

    "M05 FLT ModuStpSR" := true;

END_IF;

 

IF "M05 FLT ModuStpSR" AND NOT "M05 FLT ModuStp ACK" THEN

    IF "M00 ACK Imp" THEN

        "M05 FLT ModuStp ACK" := TRUE;

    END_IF;

ELSIF NOT "M05 FLT ModuStpIS" AND "M05 FLT ModuStp ACK" THEN

    "M05 FLT ModuStpSR" := "M05 FLT ModuStp ACK" := FALSE;

END_IF;

#tmp_lamp_SigRD := "M05 FLT ModuStpSR" AND NOT "M05 FLT ModuStp ACK" AND "M00 Clock_1Hz" OR "M05 FLT ModuStpSR" AND "M05 FLT ModuStp ACK";

#tmp_lamp_SigGN := NOT "M05 FLT ModuStpSR" AND ("M00 AutoCmpltMa run" AND "M05 SEQ1 Active" OR "M00 Clock_1Hz" AND NOT "M00 AutoCmpltMa run" AND "M05 SEQ1 Active");

#tmp_lamp_SigYE := "M00 ManuCmpltMa run" AND "M00 Clock_1Hz" OR NOT "M00 AutoCmpltMa run" AND NOT "M00 ManuCmpltMa run";

 

 

FB61 SET P05: Spring winding point inspection - move to home position (slave 4)

 

 

 

Netzwerk 1: SET query home position

"M05 HomPos" :=

"E05 Z10 BoxInPos"

AND "DI OUT P05".Z08.FB_HP

AND "DI OUT P05".Z10.FB_HP

AND ("DI OUT P05".Z11.FB_HP OR "DI OUT P05".Z11.FB_WP)

AND ("DI OUT P05".Z12.FB_HP OR "DI OUT P05".Z12.FB_WP)

AND "DI OUT P05".Z13.FB_HP

AND "DI OUT P05".Z14.FB_HP

AND "DI OUT P05".Z15.FB_HP;

#tmp_llo:=

"DI OUT P05".M01.DRV.LampHP

AND "DI OUT P05".M02.DRV.LampHP

AND "DI OUT P05".M03.DRV.LampHP

AND "DI OUT P05".M05.DRV.LampHP

AND "DI OUT P05".M06.DRV.LampHP;

// Pre-Setting

"M05 MW78" := 0;

 

 

 

Netzwerk 2: SET execute home position

 

#SET(MAX_STEP := 7);

#ACT_STEP := #SET.S.stepact;

#SET.S.DlyStart.PT := t#200ms;

 

 

 

Netzwerk 3: Step jump distributor

 

CASE #SET.S.stepact OF

    0: // Waiting for enable

        #SET.S.stepd := #SET.S.steps;

       

    1: // Stop transport system

        "DI OUT P05".M01.DRV.CmdExe_WP :=

        "DI OUT P05".M02.DRV.CmdExe_WP :=

        "DI OUT P05".M03.DRV.CmdExe_WP :=

        "DI OUT P05".M04.DRV.CmdExe_WP :=

        "DI OUT P05".M06.DRV.CmdExe_WP := FALSE;

        #SET.S.stepd :=

        "DI OUT P05".M01.DRV.LampHP

        AND "DI OUT P05".M02.DRV.LampHP

        AND "DI OUT P05".M03.DRV.LampHP

        AND "DI OUT P05".M01.DRV.LampHP

        AND "DI OUT P05".M06.DRV.LampHP;

       

    2: // Stoppers Z13 HP

        "DI OUT P05".Z13.VLV.CmdExe_WP := FALSE;

        "DI OUT P05".Z13.VLV.CmdExe_HP := "HMI KEY".P05.Z13.F11_Enable_HP;

        #SET.S.stepd := "DI OUT P05".Z13.FB_HP;

       // Stopper Z14 HP

        "DI OUT P05".Z14.VLV.CmdExe_WP := FALSE;

        "DI OUT P05".Z14.VLV.CmdExe_HP := "HMI KEY".P05.Z14.F11_Enable_HP;

        #SET.S.stepd := "DI OUT P05".Z14.FB_HP;

       // Stopper Z15 HP

        "DI OUT P05".Z15.VLV.CmdExe_WP := FALSE;

        "DI OUT P05".Z15.VLV.CmdExe_HP := "HMI KEY".P05.Z15.F11_Enable_HP;

        #SET.S.stepd := "DI OUT P05".Z15.FB_HP;

       

    3: // Z08 Guide-rail clamp cylinder HP

        "DI OUT P05".Z08.VLV.CmdExe_WP := FALSE;

        "DI OUT P05".Z08.VLV.CmdExe_HP := "HMI KEY".P05.Z08.F11_Enable_HP;

        #SET.S.stepd := "DI OUT P05".Z08.FB_HP;

       

    4: // Z10 Guid-rail cylinder HP

        "DI OUT P05".Z10.VLV.CmdExe_WP := FALSE;

        "DI OUT P05".Z10.VLV.CmdExe_HP := "HMI KEY".P05.Z10.F11_Enable_HP;

        #SET.S.stepd := "DI OUT P05".Z10.FB_HP;

       

    5: // Z11 NOK picking flap cylinder HP

        "DI OUT P05".Z11.VLV.CmdExe_WP := FALSE;

        "DI OUT P05".Z11.VLV.CmdExe_HP := "HMI KEY".P05.Z11.F11_Enable_HP;

        #SET.S.stepd := "DI OUT P05".Z11.FB_HP;

       

    6: // Z12 OK picking flap cylinder HP

        "DI OUT P05".Z12.VLV.CmdExe_WP := FALSE;

        "DI OUT P05".Z12.VLV.CmdExe_HP := "HMI KEY".P05.Z12.F11_Enable_HP;

        #SET.S.stepd := "DI OUT P05".Z12.FB_HP;

       

    7: // Query module at home position

        "M05 RunHomPos" := NOT ("M05 HomPos" AND #tmp_llo);

END_CASE;