FB31 SET P01 Move CAM_DISC axis towards home position

 

 

 

Network 1: Query home position

"DI MAIN P01".M00.HomPosIS :=

"DI OUT P01".G120_M.DRV.Support.HomeDone

AND "DI OUT P01".G120C_S.DRV.Support.HomeDone

AND "DI OUT P01".S120_M1.DRV.Support.HomeDone

AND "DI OUT P01".S120_S1.DRV.Support.HomeDone

AND "DI OUT P01".S120_M2.DRV.Support.HomeDone

AND "DI OUT P01".S120_S2.DRV.Support.HomeDone

AND "DI OUT P01".S210_M4.DRV.Support.HomeDone

AND "DI OUT P01".S210_S4.DRV.Support.HomeDone

AND "DI OUT P01".G120_M.DRV.Support.LampOFF

AND "DI OUT P01".G120C_S.DRV.Support.LampOFF

AND "DI OUT P01".S120_M1.DRV.Support.LampOFF

AND "DI OUT P01".S120_M2.DRV.Support.LampOFF

AND "DI OUT P01".S210_M4.DRV.Support.LampOFF

AND NOT "DI OUT P01".G120_M.DRV.Support.EndLim_Min

AND NOT "DI OUT P01".G120C_S.DRV.Support.EndLim_Min

AND "DI OUT P01".S120_S1.DRV.MC_GearIn.InGear AND "DI OUT P01".S120_S2.DRV.MC_GearIn.InGear AND "DI OUT P01".S210_S4.DRV.MC_GearIn.InGear

AND "DI OUT P01".Y100.FB_HP AND "DI OUT P01".Y101.FB_HP;

 

 

 

Network 2: Define last step

#SSM(LAST_STEP := 21);

 

 

 

Network 3: Step Switching Mechanism (SSM)

CASE #SSM.S.stepact OF

    0: // Waiting for SET to start

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

       

    1: // Pre-Setting

        IF #SSM.S.stepfc THEN

            #SSM.S.c1.set := 25;

            #SSM.S.c1.start := TRUE;

            "DI OUT P01".CAM_DISC.CAM.Support.Cam.Current_Position := #tmp_del_pos;

            "DI OUT P01".G120_M.DRV.Support.SetVelo := "HMI KEY".SetValues.Linear_Axis_Fast;

            "DI OUT P01".G120C_S.DRV.Support.SetVelo := "HMI KEY".SetValues.Linear_Axis_Middle;

            "DI OUT P01".S210_M4.DRV.Support.SetVelo :=

            "DI OUT P01".S120_M2.DRV.Support.SetVelo :=

            "DI OUT P01".S120_M1.DRV.Support.SetVelo := "HMI KEY".SetValues.Rotary_Axis_Middle;

            "DI OUT P01".CAM_DISC.CAM.Support.Write_Index := "DI OUT P01".CAM_DISC.CAM.Support.Read_Index := "DI OUT P01".CAM_DISC.CAM.Support.Output_Index := 0;

            #Enable_MC_Power_Mode3 := TRUE;

        ELSE

            "HMI KEY".P01.S120_S1.F21_Halt := "HMI KEY".P01.S120_S2.F21_Halt := "HMI KEY".P01.S210_S4.F21_Halt := NOT #SSM.S.c1.done;

            #SSM.S.stepd := NOT ("DI OUT P01".S120_S1.DRV.MC_GearIn.InGear OR "DI OUT P01".S120_S2.DRV.MC_GearIn.InGear OR "DI OUT P01".S210_S4.DRV.MC_GearIn.InGear)

            AND #SSM.S.c1.done;

        END_IF;

       

    2: // G120C_S Master Mold Silicon Sprayer MoveJog towards 0.0 position

        IF "DI OUT P01".G120C_S.DRV.Support.ActPos <= 7.0 THEN

            "DI OUT P01".G120C_S.DRV.Support.SetVelo := 1.0;

            #SSM.S.c1.start := TRUE;

            #SSM.S.c1.set := 25;

            "DI OUT P01".G120C_S.DRV.Support.Cmd_MoveJogHP := FALSE;

            "DI OUT P01".G120C_S.DRV.Support.Cmd_MoveJogWP := "HMI KEY".P01.G120C_S.F12_Enable_WP AND #SSM.S.stepa AND #SSM.S.c1.done;

            IF "DI OUT P01".G120C_S.DRV.Support.ActPos >= 0.0 THEN

                "DI OUT P01".G120C_S.DRV.Support.Cmd_MoveJogHP := "DI OUT P01".G120C_S.DRV.Support.Cmd_MoveJogWP := FALSE;

                #SSM.S.stepd := "DI OUT P01".G120C_S.DRV.Support.LampOFF;

            END_IF;

        ELSIF "DI OUT P01".G120C_S.DRV.Support.ActPos > 7.0 THEN

            "DI OUT P01".G120C_S.DRV.Support.SetVelo := "HMI KEY".SetValues.Rotary_Axis_Middle;

            "DI OUT P01".G120C_S.DRV.Support.Cmd_MoveJogWP := FALSE;

            "DI OUT P01".G120C_S.DRV.Support.Cmd_MoveJogHP := "HMI KEY".P01.G120C_S.F11_Enable_HP AND #SSM.S.stepa AND NOT #SSM.S.steplo;

        END_IF;

       

    3: // G120C_S Master Mold Silicon Sprayer MoveJog towards WindowRange

        IF "DI OUT P01".G120C_S.DRV.Support.ActPos <= "DI OUT P01".G120C_S.DRV.Support.WindowRange THEN

            "DI OUT P01".G120C_S.DRV.Support.Cmd_MoveJogHP := "DI OUT P01".G120C_S.DRV.Support.Cmd_MoveJogWP := FALSE;

            #SSM.S.stepd := "DI OUT P01".G120C_S.DRV.Support.LampOFF AND "E01 G120C_S EndLimMin";

        ELSIF "DI OUT P01".G120C_S.DRV.Support.ActPos > "DI OUT P01".G120C_S.DRV.Support.WindowRange THEN

            "DI OUT P01".G120C_S.DRV.Support.SetVelo := 0.5;

            "DI OUT P01".G120C_S.DRV.Support.Cmd_MoveJogWP := FALSE;

            "DI OUT P01".G120C_S.DRV.Support.Cmd_MoveJogHP := "HMI KEY".P01.G120C_S.F12_Enable_WP AND NOT #SSM.S.steplo;

        END_IF;

       

    4: // Query G120C_S Master Mold Silicon Sprayer HomDone

        #SSM.S.c1.start := "HMI KEY".P01.G120C_S.F5_Set_Ref_Point := NOT "DI OUT P01".G120C_S.DRV.Support.HomeDone;

        #SSM.S.c1.set := 8;

        #SSM.S.stepd := "DI OUT P01".G120C_S.DRV.Support.HomeDone AND (#SSM.S.c1.done OR NOT (#SSM.S.steplo OR #SSM.S.c1.done));

       

    5: // G120C_S Master Mold Silicon Sprayer MoveAbsolute towards HomPos

        "DI OUT P01".G120C_S.DRV.MC_MoveAbsolute.Position := 0.0;

        #SSM.S.stepd := "DI OUT P01".G120C_S.DRV.Support.InPos AND NOT #SSM.S.steplo;

        "DI OUT P01".G120C_S.DRV.Support.Cmd_MoveAbsolute := "DI OUT P01".G120C_S.DRV.Support.Epos_Enabled AND NOT #SSM.S.stepd AND #SSM.S.stepa;

       

    6: // S120_M1 Pick & Place Master Articulated Arm A1 MoveJog towards 0.0 position

        "DI OUT P01".S120_M1.DRV.Support.Cmd_MoveJogWP := "HMI KEY".P01.S120_M1.F12_Enable_WP AND "DI OUT P01".S120_M1.DRV.Support.ActPos <= 0.0 AND #SSM.S.stepa;

        "DI OUT P01".S120_M1.DRV.Support.Cmd_MoveJogHP := "HMI KEY".P01.S120_M1.F11_Enable_HP AND "DI OUT P01".S120_M1.DRV.Support.ActPos >= 0.0 AND #SSM.S.stepa;

        IF ABS("DI OUT P01".S120_M1.DRV.Support.ActPos) <= 20.0 THEN

            #SSM.S.stepd := TRUE;

        END_IF;

       

    7: // S120_M1 Pick & Place Master Articulated Arm A1 MoveJog towards 0.0 position

        IF "E01 S120_M1 Ref.punkt" THEN

            #SSM.S.c1.start := TRUE;

            #SSM.S.c1.set := 25;

            "DI OUT P01".Y100.VLV_O.CmdExe_WP := FALSE;

            "DI OUT P01".S120_M1.DRV.Support.Cmd_MoveJogHP := "DI OUT P01".S120_M1.DRV.Support.Cmd_MoveJogWP := FALSE;

            #SSM.S.stepd := "DI OUT P01".S120_M1.DRV.Support.LampOFF AND #SSM.S.c1.done;

            RETURN;

        END_IF;

        IF "DI OUT P01".S120_M1.DRV.Support.ActPos >= 0.0 THEN

            "DI OUT P01".S120_M1.DRV.Support.SetVelo := "HMI KEY".SetValues.Rotary_Axis_Slow;

            "DI OUT P01".S120_M1.DRV.Support.Cmd_MoveJogHP := "HMI KEY".P01.S120_M1.F11_Enable_HP AND #SSM.S.stepa;

        ELSIF "DI OUT P01".S120_M1.DRV.Support.ActPos < 0.0 THEN

            "DI OUT P01".S120_M1.DRV.Support.SetVelo := "HMI KEY".SetValues.Rotary_Axis_Slow;

            "DI OUT P01".S120_M1.DRV.Support.Cmd_MoveJogWP := "HMI KEY".P01.S120_M1.F12_Enable_WP AND #SSM.S.stepa;

        END_IF;

       

    8: // Query S120_M1 Pick & Place Master Articulated Arm A1 query HomeDone

        #SSM.S.c1.start := TRUE;

        #SSM.S.c2.set := #SSM.S.c1.set := 8;

        "HMI KEY".P01.S120_M1.F5_Set_Ref_Point := NOT #SSM.S.c1.done;

        #SSM.S.c2.start :=

        "DI OUT P01".S120_M1.DRV.Support.HomeDone AND NOT #SSM.S.c2.done;

        #SSM.S.stepd := #SSM.S.c2.done;

       

    9: // S210_M4 Pick & Place Swivel Vacuum Gripper A4 MoveJog towards 0.0 position

        "DI OUT P01".S210_M4.DRV.Support.Cmd_MoveJogHP := "HMI KEY".P01.S210_M4.F11_Enable_HP AND "DI OUT P01".S210_M4.DRV.Support.ActPos >= 1.0 AND #SSM.S.stepa;

        IF ABS("DI OUT P01".S210_M4.DRV.Support.ActPos) <= 5.0 THEN

            #SSM.S.stepd := TRUE;

        END_IF;

       

    10: // S210_M4 Pick & Place Rotary Vacuum Gripper A4 MoveJog towards 0.0 position

        IF "E01 S210_M4 Ref.punkt" THEN

            #SSM.S.c1.start := TRUE;

            #SSM.S.c1.set := 8;

            "DI OUT P01".S210_M4.DRV.Support.Cmd_MoveJogHP := "DI OUT P01".S210_M4.DRV.Support.Cmd_MoveJogWP := FALSE;

            #SSM.S.stepd := "DI OUT P01".S210_M4.DRV.Support.LampOFF AND #SSM.S.c1.done;

            RETURN;

        END_IF;

        IF "DI OUT P01".S210_M4.DRV.Support.ActPos >= 0.0 THEN

            "DI OUT P01".S210_M4.DRV.Support.SetVelo := "HMI KEY".SetValues.Rotary_Axis_Slow;

            "DI OUT P01".S210_M4.DRV.Support.Cmd_MoveJogWP := "HMI KEY".P01.S210_M4.F12_Enable_WP AND #SSM.S.stepa;

        END_IF;

       

    11: // S210_M4 Pick & Place Rotary Vacuum Gripper A4 query HomeDone

        #SSM.S.c1.start := TRUE;

        #SSM.S.c2.set := #SSM.S.c1.set := 8;

        "HMI KEY".P01.S210_M4.F5_Set_Ref_Point := NOT #SSM.S.c1.done;

        #SSM.S.c2.start :=

        "DI OUT P01".S210_M4.DRV.Support.HomeDone AND NOT #SSM.S.c2.done;

        #SSM.S.stepd := #SSM.S.c2.done;

       

    12: // S120_M2 Pick & Place Master Articulated Arm A1 MoveJog towards 0.0 position

        "DI OUT P01".S120_M2.DRV.Support.Cmd_MoveJogWP := "HMI KEY".P01.S120_M2.F12_Enable_WP AND "DI OUT P01".S120_M2.DRV.Support.ActPos <= 0.0 AND #SSM.S.stepa;

        "DI OUT P01".S120_M2.DRV.Support.Cmd_MoveJogHP := "HMI KEY".P01.S120_M2.F11_Enable_HP AND "DI OUT P01".S120_M2.DRV.Support.ActPos >= 0.0 AND #SSM.S.stepa;

        IF ABS("DI OUT P01".S120_M2.DRV.Support.ActPos) <= 20.0 THEN

            #SSM.S.stepd := TRUE;

        END_IF;

       

    13: // S120_M2 Pick & Place Master Articulated Arm A1 MoveJog towards 0.0 position

        IF "E01 S120_M2 Ref.punkt" THEN

            #SSM.S.c1.start := TRUE;

            #SSM.S.c1.set := 25;

            "DI OUT P01".S120_M2.DRV.Support.Cmd_MoveJogHP := "DI OUT P01".S120_M2.DRV.Support.Cmd_MoveJogWP := FALSE;

            #SSM.S.stepd := "DI OUT P01".S120_M2.DRV.Support.LampOFF AND #SSM.S.c1.done;

            RETURN;

        END_IF;

        IF "DI OUT P01".S120_M2.DRV.Support.ActPos >= 0.0 THEN

            "DI OUT P01".S120_M2.DRV.Support.SetVelo := "HMI KEY".SetValues.Rotary_Axis_Slow;

            "DI OUT P01".S120_M2.DRV.Support.Cmd_MoveJogHP := "HMI KEY".P01.S120_M2.F11_Enable_HP AND #SSM.S.stepa;

        ELSIF "DI OUT P01".S120_M2.DRV.Support.ActPos < 0.0 THEN

            "DI OUT P01".S120_M2.DRV.Support.SetVelo := "HMI KEY".SetValues.Rotary_Axis_Slow;

            "DI OUT P01".S120_M2.DRV.Support.Cmd_MoveJogWP := "HMI KEY".P01.S120_M2.F12_Enable_WP AND #SSM.S.stepa;

        END_IF;

       

    14: // Query S120_M2 Pick & Place Master Articulated Arm A1 query HomeDone

        #SSM.S.c1.start := TRUE;

        #SSM.S.c2.set := #SSM.S.c1.set := 8;

        "HMI KEY".P01.S120_M2.F5_Set_Ref_Point := NOT #SSM.S.c1.done;

        #SSM.S.c2.start :=

        "DI OUT P01".S120_M2.DRV.Support.HomeDone AND NOT #SSM.S.c2.done;

        #SSM.S.stepd := #SSM.S.c2.done;

       

    15: // S120_S1, S120_S2, S210_S4 activate GearIn

        IF #SSM.S.stepfc THEN

            #SSM.S.c1.set := 25;

            #SSM.S.c1.start := TRUE;

            #Enable_MC_Power_Mode3 := FALSE;

        ELSE

            "HMI KEY".P01.S120_S1.F22_Start_Gearing := "HMI KEY".P01.S120_S2.F22_Start_Gearing := "HMI KEY".P01.S210_S4.F22_Start_Gearing := NOT #SSM.S.c1.done;

            #SSM.S.stepd := "DI OUT P01".S120_S1.DRV.MC_GearIn.InGear AND "DI OUT P01".S120_S2.DRV.MC_GearIn.InGear AND "DI OUT P01".S210_S4.DRV.MC_GearIn.InGear

            AND #SSM.S.c1.done;

        END_IF;

       

    16: // S120_S1, S120_S2, S210_S4 Set Ref.P

        #SSM.S.c1.set := 10;

        #SSM.S.c1.start := TRUE;

        "HMI KEY".P01.S120_S1.F5_Set_Ref_Point := "HMI KEY".P01.S120_S2.F5_Set_Ref_Point := "HMI KEY".P01.S210_S4.F5_Set_Ref_Point := NOT #SSM.S.c1.done;

        #SSM.S.stepd := "DI OUT P01".S120_S1.DRV.Support.HomeDone AND "DI OUT P01".S120_S2.DRV.Support.HomeDone AND "DI OUT P01".S210_S4.DRV.Support.HomeDone

        AND #SSM.S.c1.done;

       

    17: // G120_M Convex master mold back and forth carrier Move towards 0.0 position

        IF "DI OUT P01".G120_M.DRV.Support.ActPos <= 60.0 THEN

            "DI OUT P01".G120_M.DRV.Support.SetVelo := 2.0;

        END_IF;

        "DI OUT P01".G120_M.DRV.Support.Cmd_MoveJogHP := "HMI KEY".P01.G120_M.F11_Enable_HP AND NOT "E01 G120_M EndLimMin" AND #SSM.S.stepa;

        #SSM.S.stepd := "E01 G120_M EndLimMin" AND "DI OUT P01".G120_M.DRV.Support.LampOFF AND NOT #SSM.S.steplo;

       

    18: // G120_M Convex master mold back and forth carrier query HomeDone  

        IF "DI OUT P01".G120_M.DRV.Support.HomeDone THEN

            #SSM.S.stepd := TRUE;

            "HMI KEY".P01.G120_M.F5_Set_Ref_Point := FALSE;

        ELSE

            #SSM.S.c1.set := 8;

            #SSM.S.c1.start := TRUE;

            "HMI KEY".P01.G120_M.F5_Set_Ref_Point := NOT #SSM.S.c1.done AND #SSM.S.stepa;

        END_IF;

       

    19: // G120_M Convex master mold back and forth carrier MoveAbsolute towards 0.0 position

        "DI OUT P01".G120_M.DRV.MC_MoveAbsolute.Position := 0.0;

        #SSM.S.stepd := "DI OUT P01".G120_M.DRV.Support.InPos AND NOT #SSM.S.steplo;

        "DI OUT P01".G120_M.DRV.Support.Cmd_MoveAbsolute := "DI OUT P01".G120_M.DRV.Support.Epos_Enabled AND NOT #SSM.S.stepd AND #SSM.S.stepa;

       

    20: // Query P01 home position

        #SSM.S.stepd := "DI MAIN P01".M00.HomPosIS;

       

    21: // SCARA_3D MoveDirectRelative MCS (Machine Coordinate System)

        IF #SSM.S.steplo THEN

            "DI MAIN P01".SEQ1.Pos_No := 0;

            "DI OUT P01".SCARA_3D.KIN.MC_MoveDirectRelative.Distance := "HMI KEY".MoveDirectPos["DI MAIN P01".SEQ1.Pos_No].WCS;

            "DI OUT P01".SCARA_3D.KIN.MC_MoveDirectRelative.VelocityFactor := "HMI KEY".SetValues.SCARA_3D_VelocityFactor_Middle;

            "DI OUT P01".SCARA_3D.KIN.MC_MoveDirectRelative.CoordSystem := 100;

            "DI OUT P01".SCARA_3D.KIN.Support.InPos := FALSE;

        ELSE

            "DI MAIN P01".M00.HomPosRun := NOT "DI OUT P01".SCARA_3D.KIN.Support.InPos OR #SSM.S.steplo;

            "DI OUT P01".SCARA_3D.KIN.Support.Cmd_MoveDirect_Relative := NOT "DI OUT P01".SCARA_3D.KIN.Support.InPos

            AND "DI OUT P01".SCARA_3D.KIN.Support.KINpos_Enabled AND #SSM.S.stepa;

        END_IF;

    END_CASE;

 

 

Home

 

Erfahrung

 

Referenzen

 

Sondermaschinen

 

MSR-Maschinen

 

SPS-Programmierung

 

Visualisierung HMI

 

Elektro CAD

 

Leistungsprofil

 

Personalia

 

SW-Development

 

Dokumentation

 

 

 

Impressum & DSGVO