FB52 SEQ1 P03 : Stacker Crane SEQ1 (3/3) |
|
|
|
6: // M302 >HBS1 or M305 >HBS2, M303 >HBS1 or M305 >HBS2, or M304 >HBS1 or M305 >HBS2 IF #SSM.S.stepfc THEN // M305 >HBS2 and M302 >HBS1 "DI MAIN P03".MoDa.RunTimeSetP_seq1 := 280; "DI MAIN P03".MoDa.RunTimeCntrl_seq1 := 0; IF "DI OUT P03".M305_Box_Data.Info.Occupied AND "DI OUT P03".M302_Box_Data.Info.Occupied THEN // M302 >HBS1 #ExecuteCoordinate(INDEX_POS := "DI OUT P03".M302_Box_Data.Trgt_Storage.Place, REF_POS := "ModulDa".MaPa.HBS1.RefPos, PLACES_ON_X := "ModulDa".MaPa.HBS1.NoOf_Places_X, PLACES_ON_Y := "ModulDa".MaPa.HBS1.NoOf_Places_Y, GAP_FACTOR_X := "ModulDa".MaPa.HBS1.Gap.X, GAP_FACTOR_Y := "ModulDa".MaPa.HBS1.Gap.Y, TARGET_POS := "ModulDa".MaPa.HBS1.PlacingPos); #Distance_Xaxis_HBS1 := ABS(IN := "DI OUT P03".G120C_X.DRV.Support.ActPos - "ModulDa".MaPa.HBS1.PlacingPos.X); // M305 > HBS2 #ExecuteCoordinate(INDEX_POS := "DI OUT P03".M305_Box_Data.Trgt_Storage.Place, REF_POS := "ModulDa".MaPa.HBS2.RefPos, PLACES_ON_X := "ModulDa".MaPa.HBS2.NoOf_Places_X, PLACES_ON_Y := "ModulDa".MaPa.HBS2.NoOf_Places_Y, GAP_FACTOR_X := "ModulDa".MaPa.HBS2.Gap.X, GAP_FACTOR_Y := "ModulDa".MaPa.HBS2.Gap.Y, TARGET_POS := "ModulDa".MaPa.HBS2.PlacingPos); #Distance_Xaxis_HBS2 := ABS(IN := "DI OUT P03".G120C_X.DRV.Support.ActPos - "ModulDa".MaPa.HBS2.PlacingPos.X); // M305 > HBS2 IF #Distance_Xaxis_HBS2 < #Distance_Xaxis_HBS1 THEN #CurrentStoragePlace := "DI OUT P03".M305_Box_Data.Trgt_Storage.Place; "DI OUT P03".G120C_Z.DRV.MC_MoveAbsolute.Position := - "ModulDa".MaPa.HBS2.Gap.Z * "DI OUT P03".M305_Box_Data.Trgt_Storage.Depth; // -1 * instead - "DI OUT P03".G120C_Z.DRV.Support.SetVelo := "DI OUT P03".Manual.G120C_Z.TchInVelo_1; "DI OUT P03".HBS2.RdyToTakeIn_FrmNC := TRUE; IF "DI OUT P03".M305_Box_Data.Info.SizeTyp = 1 THEN "DI OUT P03".M305_Box_Data.Info.SmalBox := TRUE; ELSIF "DI OUT P03".M305_Box_Data.Info.SizeTyp = 2 THEN "DI OUT P03".M305_Box_Data.Info.LargeBox := TRUE; ELSE #SSM.S."1_FAULT_00_15".%X1 := TRUE; END_IF; // M302 > HBS1 ELSIF #Distance_Xaxis_HBS1 <= #Distance_Xaxis_HBS2 THEN #CurrentStoragePlace := "DI OUT P03".M302_Box_Data.Trgt_Storage.Place; "DI OUT P03".G120C_Z.DRV.MC_MoveAbsolute.Position := "ModulDa".MaPa.HBS1.Gap.Z * "DI OUT P03".M302_Box_Data.Trgt_Storage.Depth; "DI OUT P03".G120C_Z.DRV.Support.SetVelo := "DI OUT P03".Manual.G120C_Z.TchInVelo_1; "DI OUT P03".HBS1.RdyToTakeIn_FrmNC := TRUE; IF "DI OUT P03".M302_Box_Data.Info.SizeTyp = 1 THEN "DI OUT P03".M302_Box_Data.Info.SmalBox := TRUE; ELSIF "DI OUT P03".M302_Box_Data.Info.SizeTyp = 2 THEN "DI OUT P03".M302_Box_Data.Info.LargeBox := TRUE; ELSE #SSM.S."1_FAULT_00_15".%X1 := TRUE; END_IF; END_IF; // M305 > HBS2 and M303 > HBS1 ELSIF "DI OUT P03".M305_Box_Data.Info.Occupied AND "DI OUT P03".M303_Box_Data.Info.Occupied THEN // M303 > HBS1 #ExecuteCoordinate(INDEX_POS := "DI OUT P03".M303_Box_Data.Trgt_Storage.Place, REF_POS := "ModulDa".MaPa.HBS1.RefPos, PLACES_ON_X := "ModulDa".MaPa.HBS1.NoOf_Places_X, PLACES_ON_Y := "ModulDa".MaPa.HBS1.NoOf_Places_Y, GAP_FACTOR_X := "ModulDa".MaPa.HBS1.Gap.X, GAP_FACTOR_Y := "ModulDa".MaPa.HBS1.Gap.Y, TARGET_POS := "ModulDa".MaPa.HBS1.PlacingPos); #Distance_Xaxis_HBS1 := ABS(IN := "DI OUT P03".G120C_X.DRV.Support.ActPos - "ModulDa".MaPa.HBS1.PlacingPos.X); // M305 > HBS2 #ExecuteCoordinate(INDEX_POS := "DI OUT P03".M305_Box_Data.Trgt_Storage.Place, REF_POS := "ModulDa".MaPa.HBS2.RefPos, PLACES_ON_X := "ModulDa".MaPa.HBS2.NoOf_Places_X, PLACES_ON_Y := "ModulDa".MaPa.HBS2.NoOf_Places_Y, GAP_FACTOR_X := "ModulDa".MaPa.HBS2.Gap.X, GAP_FACTOR_Y := "ModulDa".MaPa.HBS2.Gap.Y, TARGET_POS := "ModulDa".MaPa.HBS2.PlacingPos); #Distance_Xaxis_HBS2 := ABS(IN := "DI OUT P03".G120C_X.DRV.Support.ActPos - "ModulDa".MaPa.HBS2.PlacingPos.X); // M305 > HBS2 IF #Distance_Xaxis_HBS2 < #Distance_Xaxis_HBS1 THEN #CurrentStoragePlace := "DI OUT P03".M305_Box_Data.Trgt_Storage.Place; "DI OUT P03".G120C_Z.DRV.MC_MoveAbsolute.Position := - "ModulDa".MaPa.HBS2.Gap.Z * "DI OUT P03".M305_Box_Data.Trgt_Storage.Depth; "DI OUT P03".G120C_Z.DRV.Support.SetVelo := "DI OUT P03".Manual.G120C_Z.TchInVelo_1; "DI OUT P03".HBS2.RdyToTakeIn_FrmNC := TRUE; IF "DI OUT P03".M305_Box_Data.Info.SizeTyp = 1 THEN "DI OUT P03".M305_Box_Data.Info.SmalBox := TRUE; ELSIF "DI OUT P03".M305_Box_Data.Info.SizeTyp = 2 THEN "DI OUT P03".M305_Box_Data.Info.LargeBox := TRUE; ELSE #SSM.S."1_FAULT_00_15".%X1 := TRUE; END_IF; // M303 > HBS1 ELSIF #Distance_Xaxis_HBS1 <= #Distance_Xaxis_HBS2 THEN #CurrentStoragePlace := "DI OUT P03".M303_Box_Data.Trgt_Storage.Place; "DI OUT P03".G120C_Z.DRV.MC_MoveAbsolute.Position := "ModulDa".MaPa.HBS1.Gap.Z * "DI OUT P03".M303_Box_Data.Trgt_Storage.Depth; "DI OUT P03".G120C_Z.DRV.Support.SetVelo := "DI OUT P03".Manual.G120C_Z.TchInVelo_1; "DI OUT P03".HBS1.RdyToTakeIn_FrmNC := TRUE; IF "DI OUT P03".M303_Box_Data.Info.SizeTyp = 1 THEN "DI OUT P03".M303_Box_Data.Info.SmalBox := TRUE; ELSIF "DI OUT P03".M303_Box_Data.Info.SizeTyp = 2 THEN "DI OUT P03".M303_Box_Data.Info.LargeBox := TRUE; ELSE #SSM.S."1_FAULT_00_15".%X1 := TRUE; END_IF; END_IF; // M305 > HBS2 and M304 > HBS1 ELSIF "DI OUT P03".M305_Box_Data.Info.Occupied AND "DI OUT P03".M304_Box_Data.Info.Occupied THEN // M304 > HBS1 #ExecuteCoordinate(INDEX_POS := "DI OUT P03".M304_Box_Data.Trgt_Storage.Place, REF_POS := "ModulDa".MaPa.HBS1.RefPos, PLACES_ON_X := "ModulDa".MaPa.HBS1.NoOf_Places_X, PLACES_ON_Y := "ModulDa".MaPa.HBS1.NoOf_Places_Y, GAP_FACTOR_X := "ModulDa".MaPa.HBS1.Gap.X, GAP_FACTOR_Y := "ModulDa".MaPa.HBS1.Gap.Y, TARGET_POS := "ModulDa".MaPa.HBS1.PlacingPos); #Distance_Xaxis_HBS1 := ABS(IN := "DI OUT P03".G120C_X.DRV.Support.ActPos - "ModulDa".MaPa.HBS1.PlacingPos.X); // M305 > HBS2 #ExecuteCoordinate(INDEX_POS := "DI OUT P03".M305_Box_Data.Trgt_Storage.Place, REF_POS := "ModulDa".MaPa.HBS2.RefPos, PLACES_ON_X := "ModulDa".MaPa.HBS2.NoOf_Places_X, PLACES_ON_Y := "ModulDa".MaPa.HBS2.NoOf_Places_Y, GAP_FACTOR_X := "ModulDa".MaPa.HBS2.Gap.X, GAP_FACTOR_Y := "ModulDa".MaPa.HBS2.Gap.Y, TARGET_POS := "ModulDa".MaPa.HBS2.PlacingPos); #Distance_Xaxis_HBS2 := ABS(IN := "DI OUT P03".G120C_X.DRV.Support.ActPos - "ModulDa".MaPa.HBS2.PlacingPos.X); // M305 > HBS2 IF #Distance_Xaxis_HBS2 < #Distance_Xaxis_HBS1 THEN #CurrentStoragePlace := "DI OUT P03".M305_Box_Data.Trgt_Storage.Place; "DI OUT P03".G120C_Z.DRV.MC_MoveAbsolute.Position := - "ModulDa".MaPa.HBS2.Gap.Z * "DI OUT P03".M305_Box_Data.Trgt_Storage.Depth; "DI OUT P03".G120C_Z.DRV.Support.SetVelo := "DI OUT P03".Manual.G120C_Z.TchInVelo_1; "DI OUT P03".HBS2.RdyToTakeIn_FrmNC := TRUE; IF "DI OUT P03".M305_Box_Data.Info.SizeTyp = 1 THEN "DI OUT P03".M305_Box_Data.Info.SmalBox := TRUE; ELSIF "DI OUT P03".M305_Box_Data.Info.SizeTyp = 2 THEN "DI OUT P03".M305_Box_Data.Info.LargeBox := TRUE; ELSE #SSM.S."1_FAULT_00_15".%X1 := TRUE; END_IF; // M304 > HBS1 ELSIF #Distance_Xaxis_HBS1 <= #Distance_Xaxis_HBS2 THEN #CurrentStoragePlace := "DI OUT P03".M304_Box_Data.Trgt_Storage.Place; "DI OUT P03".G120C_Z.DRV.MC_MoveAbsolute.Position := "ModulDa".MaPa.HBS1.Gap.Z * "DI OUT P03".M304_Box_Data.Trgt_Storage.Depth; "DI OUT P03".G120C_Z.DRV.Support.SetVelo := "DI OUT P03".Manual.G120C_Z.TchInVelo_1; "DI OUT P03".HBS1.RdyToTakeIn_FrmNC := TRUE; IF "DI OUT P03".M304_Box_Data.Info.SizeTyp = 1 THEN "DI OUT P03".M304_Box_Data.Info.SmalBox := TRUE; ELSIF "DI OUT P03".M304_Box_Data.Info.SizeTyp = 2 THEN "DI OUT P03".M304_Box_Data.Info.LargeBox := TRUE; ELSE #SSM.S."1_FAULT_00_15".%X1 := TRUE; END_IF; END_IF; END_IF; ELSE // M302 > HBS1 IF "DI OUT P03".HBS1.RdyToTakeIn_FrmNC THEN "POS REACHED"(START := #SSM.S.steplo OR NOT #SSM.S.stepa, TARGET_POS := "ModulDa".MaPa.HBS1.PlacingPos, VELO_X := "DI OUT P03".Manual.G120C_X.TchInVelo_1, VELO_Y := "DI OUT P03".Manual.G120C_Y.TchInVelo_1, ENABLE_X := "DI OUT P03".G120C_X.DRV.Support.Epos_Enabled, ENABLE_Y := "DI OUT P03".G120C_Y.DRV.Support.Epos_Enabled, WINDOW_RANGE := 1.0, MOV_TO_POS_X => "DI OUT P03".G120C_X.DRV.Support.Cmd_MovAbso, MOV_TO_POS_Y => "DI OUT P03".G120C_Y.DRV.Support.Cmd_MovAbso, TARGET_REACHED => "DI MAIN P03".M00.SEQ1_Busy); "DI OUT P03".G120C_Z.DRV.Support.Cmd_MovAbso := "DI OUT P03".G120C_Z.DRV.Support.Epos_Enabled AND "E03 GapCntrl HBS1" AND "DI MAIN P03".M00.SEQ1_Busy AND ("E03 M302 LimS21" OR #SSM.S.c1.done) AND #SSM.S.stepa; // G120C_Z MovAbso towing arm towards extended pos. HBS1 IF "DI OUT P03".G120C_Z.DRV.Support.InPos AND NOT ("E03 G120C_Z MiddleCntrl" OR #SSM.S.c1.done) THEN "DI OUT P03".G120C_Z.DRV.Support.Cmd_MovAbso := FALSE; #SSM.S.c1.start := TRUE; #SSM.S.c1.set := 10; "DI OUT P03".G120C_Z.DRV.MC_MoveAbsolute.Position := 0.0; // G120C_Z MovAbso towing arm towards middle pos. 0.0 ELSIF "DI OUT P03".G120C_Z.DRV.Support.InPos AND "E03 G120C_Z MiddleCntrl" THEN "DI MAIN P03".M00.SEQ1_Done := #BoxCommissionDone_HSB1; END_IF; // M305 > HBS2 ELSIF "DI OUT P03".HBS2.RdyToTakeIn_FrmNC THEN "POS REACHED"(START := #SSM.S.steplo OR NOT #SSM.S.stepa, TARGET_POS := "ModulDa".MaPa.HBS2.PlacingPos, VELO_X := "DI OUT P03".Manual.G120C_X.TchInVelo_1, VELO_Y := "DI OUT P03".Manual.G120C_Y.TchInVelo_1, ENABLE_X := "DI OUT P03".G120C_X.DRV.Support.Epos_Enabled, ENABLE_Y := "DI OUT P03".G120C_Y.DRV.Support.Epos_Enabled, WINDOW_RANGE := 1.0, MOV_TO_POS_X => "DI OUT P03".G120C_X.DRV.Support.Cmd_MovAbso, MOV_TO_POS_Y => "DI OUT P03".G120C_Y.DRV.Support.Cmd_MovAbso, TARGET_REACHED => "DI MAIN P03".M00.SEQ1_Busy); "DI OUT P03".G120C_Z.DRV.Support.Cmd_MovAbso := "DI OUT P03".G120C_Z.DRV.Support.Epos_Enabled AND "E03 GapCntrl HBS2" AND "DI MAIN P03".M00.SEQ1_Busy AND ("E03 M305 LimS52" OR #SSM.S.c1.done) AND #SSM.S.stepa; // G120C_Z MovAbso towing arm towards extended pos. HBS1 IF "DI OUT P03".G120C_Z.DRV.Support.InPos AND NOT ("E03 G120C_Z MiddleCntrl" OR #SSM.S.c1.done) THEN "DI OUT P03".G120C_Z.DRV.Support.Cmd_MovAbso := FALSE; #SSM.S.c1.start := TRUE; #SSM.S.c1.set := 10; "DI OUT P03".G120C_Z.DRV.MC_MoveAbsolute.Position := 0.0; ELSIF "DI OUT P03".G120C_Z.DRV.Support.InPos AND "E03 G120C_Z MiddleCntrl" THEN "DI MAIN P03".M00.SEQ1_Done := #BoxCommissionDone_HSB2; END_IF; END_IF; END_IF;
7: // MoveAbsolute STC to towards loading position IF #SSM.S.stepfc THEN "DI MAIN P03".MoDa.RunTimeSetP_seq1 := 300; #CurrentCommission := 0; "DI MAIN P03".MoDa.RunTimeCntrl_seq1 := 0; "DI OUT P03".G120C_X.DRV.MC_MoveAbsolute.Position := "DI OUT P03".Manual.Axis_XYZ.TrgtFixPos[1].X; // Fetch (scanner) loading position "DI OUT P03".G120C_Y.DRV.MC_MoveAbsolute.Position := "DI OUT P03".Manual.Axis_XYZ.TrgtFixPos[1].Y; // Fetch (scanner) loading position "DI OUT P03".G120C_Z.DRV.MC_MoveAbsolute.Position := "DI OUT P03".Manual.Axis_XYZ.TrgtFixPos[1].Z; // Fetch (scanner) loading position "DI OUT P03".G120C_X.DRV.Support.SetVelo := "DI OUT P03".Manual.G120C_X.TchInVelo_1; "DI OUT P03".G120C_Y.DRV.Support.SetVelo := "DI OUT P03".Manual.G120C_Y.TchInVelo_1; "DI OUT P03".G120C_Z.DRV.Support.SetVelo := "DI OUT P03".Manual.G120C_Z.TchInVelo_1; ELSE "DI OUT P03".G120C_X.DRV.Support.Cmd_MovAbso := "DI OUT P03".G120C_X.DRV.Support.Epos_Enabled AND #SSM.S.stepa; "DI OUT P03".G120C_Y.DRV.Support.Cmd_MovAbso := "DI OUT P03".G120C_Y.DRV.Support.Epos_Enabled AND #SSM.S.stepa; "DI OUT P03".G120C_Z.DRV.Support.Cmd_MovAbso := "DI OUT P03".G120C_Z.DRV.Support.Epos_Enabled AND #SSM.S.stepa; IF "DI OUT P03".G120C_X.DRV.Support.InPos AND "DI OUT P03".G120C_Y.DRV.Support.InPos AND "DI OUT P03".G120C_Z.DRV.Support.InPos AND NOT #SSM.S.steplo THEN #SSM.S.stepd := TRUE; "DI OUT P03".G120C_X.DRV.Support.Cmd_MovAbso := "DI OUT P03".G120C_Y.DRV.Support.Cmd_MovAbso := "DI OUT P03".G120C_Z.DRV.Support.Cmd_MovAbso := FALSE; END_IF; END_IF;
8: // Scanning during loading lift conveyor system IF #SSM.S.stepfc THEN #SSM.S.c2.set := 30; #SCANNER_ET200SP.Scanned_BoxData_A := #SCANNER_ET200SP.Scanned_BoxData_B := #SCANNER_ET200SP.Scanned_BoxData_C := #SCANNER_ET200SP.Scanned_BoxData_D := #SCANNER_ET200SP.Clear_BoxDat_00; "DI MAIN P03".MoDa.RunTimeSetP_seq1 := 600; "DI MAIN P03".MoDa.RunTimeCntrl_seq1 := 0; END_IF; IF "DI MAIN P03".SEQ1.SCANNER_ET200SP.Support_AT.%X2 THEN // Scanning done #SSM.S.c2.start := TRUE; END_IF; IF #SCANNER_ET200SP.LB_1 THEN #SSM.S.c1.act := 0; #SSM.S.c1.done := FALSE; ELSE #SSM.S.c1.set := 150; #SSM.S.c1.start := TRUE; END_IF; "DI OUT P03".M302.DRV.CmdExe_WP := "HMI KEY".P03.M302.F12_Enable_WP AND #SSM.S.stepa; "DI OUT P03".M303.DRV.CmdExe_WP := "HMI KEY".P03.M303.F12_Enable_WP AND #SSM.S.stepa; "DI OUT P03".M304.DRV.CmdExe_WP := "HMI KEY".P03.M304.F12_Enable_WP AND #SSM.S.stepa; "DI OUT P03".M305.DRV.CmdExe_WP := "HMI KEY".P03.M305.F12_Enable_WP AND #SSM.S.stepa; #tmp_llo := "DI OUT P03".M302.DRV.FdBack AND "DI OUT P03".M303.DRV.FdBack AND "DI OUT P03".M304.DRV.FdBack AND "DI OUT P03".M305.DRV.FdBack; #SCANNER_ET200SP(LADDR_HW_IO := 415, // Hw_SubModule PUFFER := "RCV_P2P_RS232".Scanned_Data[0], ENABLE := "E03 SCAN Enbl" AND NOT (#SSM.S.c2.start OR #SSM.S.c1.done AND "DI MAIN GLB".M00.AutoCmpltMa_run) AND #tmp_llo, LB_1 := "E03 SCAN Enbl" AND "E03 SCAN LimS_1", LB_2 := "E03 SCAN LimS_2", ERROR := #SSM.S."1_FAULT_00_15".%X0, ACK_FLT := "DI MAIN GLB".M00.FLT_CmpltMaACK_Imp); // Copy scanned BoxData to STC cache "DI OUT P03".M302_Box_Data := #SCANNER_ET200SP.Scanned_BoxData_A; "DI OUT P03".M303_Box_Data := #SCANNER_ET200SP.Scanned_BoxData_B; "DI OUT P03".M304_Box_Data := #SCANNER_ET200SP.Scanned_BoxData_C; "DI OUT P03".M305_Box_Data := #SCANNER_ET200SP.Scanned_BoxData_D; IF #SSM.S.c2.done THEN "DI OUT P03".M302.DRV.CmdExe_WP := "DI OUT P03".M303.DRV.CmdExe_WP := "DI OUT P03".M304.DRV.CmdExe_WP := "DI OUT P03".M305.DRV.CmdExe_WP := FALSE; "DI MAIN P03".M00.SEQ1_Done := #STCtoLoadPosDone := TRUE; END_IF; END_CASE; |
|
FB52 SEQ1 3/3 |
|
back.. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|