FB52 SEQ1 P03 : Two Aisle Automated Small Parts Storage |
|
The stacker crane (STC) determinate the shortest distance to target position by factoring out the place number stored in the data-box. Hereby, the y-axis more specifically the x-axis factor witch is then used to calculate the distance to target position on x-axis to HBS1 or HBS2. The code section shown below determinates the absolute distance of x-axis targeted in HBS1 or HBS2. If the shortest distance is the one in HBS1, the stacker crane will first travel to the storage place in HBS1, otherwise to HBS2 |
|
Netzwerk 1: Pre-Setting #BoxCommissionDone_HSB1 := "DI OUT P03".HBS1.RdyToTakeIn_FrmNC AND "E03 G120C_Z MiddleCntrl" AND NOT ("HMI KEY".P03.M303.F15_Actor_On_HP OR "HMI KEY".P03.M304.F15_Actor_On_HP OR "HMI KEY".P03.M305.F15_Actor_On_HP); #BoxCommissionDone_HSB2 := "DI OUT P03".HBS2.RdyToTakeIn_FrmNC AND "E03 G120C_Z MiddleCntrl" AND NOT ("HMI KEY".P03.M302.F16_Actor_On_WP OR "HMI KEY".P03.M303.F16_Actor_On_WP OR "HMI KEY".P03.M304.F16_Actor_On_WP); #DlyOnCommissionDone(IN := #BoxCommissionDone_HSB1 OR #BoxCommissionDone_HSB2 OR #STCtoLoadPosDone, PT := t#800ms); |
|
|
|
Netzwerk 2: Define SSM last step #SSM(LAST_STEP := 8); |
|
Checking if the stacker crane is ready to go or if its charge distribution is fully completed. If it is ready to go, it forms a bit pattern in witch it reads which conveyor is occupied. If the data is valid, it create a precedence order called current commission. |
|
CASE #SSM.S.stepact OF 0: // Waiting for sequencer programme to start "DI MAIN P03".M00.SEQ1_Busy := FALSE; #SSM.S.stepd := #SSM.S.steps;
1: // Query box data for next destination "DI OUT P03".M302_Box_Data.Info.Occupied := "DI OUT P03".M302_Box_Data.BoxCode <> 16#F000_0000; "DI OUT P03".M303_Box_Data.Info.Occupied := "DI OUT P03".M303_Box_Data.BoxCode <> 16#F000_0000; "DI OUT P03".M304_Box_Data.Info.Occupied := "DI OUT P03".M304_Box_Data.BoxCode <> 16#F000_0000; "DI OUT P03".M305_Box_Data.Info.Occupied := "DI OUT P03".M305_Box_Data.BoxCode <> 16#F000_0000; "DI MAIN P03".M00.RdyToStart := "DI OUT P03".M302_Box_Data.Info.Occupied OR "DI OUT P03".M303_Box_Data.Info.Occupied OR "DI OUT P03".M304_Box_Data.Info.Occupied OR "DI OUT P03".M305_Box_Data.Info.Occupied; IF #SSM.S.stepfc AND NOT "DI MAIN P03".M00.RdyToStart THEN "DI MAIN P03".M00.SEQ1_Busy := TRUE; #SSM.S.stepnew := 7; #SSM.S.stepd := TRUE; ELSE #STCtoLoadPosDone := FALSE; // If HSB >1 then = HSB2, else 0 = HSB1 #Load_HBS12.%X0 := "DI OUT P03".M302_Box_Data.Trgt_Storage.HBS > 1 AND NOT ("DI OUT P03".M302_Box_Data.Trgt_Storage.HBS = 0); #Load_HBS12.%X1 := "DI OUT P03".M303_Box_Data.Trgt_Storage.HBS > 1 AND NOT ("DI OUT P03".M303_Box_Data.Trgt_Storage.HBS = 0); #Load_HBS12.%X2 := "DI OUT P03".M304_Box_Data.Trgt_Storage.HBS > 1 AND NOT ("DI OUT P03".M304_Box_Data.Trgt_Storage.HBS = 0); #Load_HBS12.%X3 := "DI OUT P03".M305_Box_Data.Trgt_Storage.HBS > 1 AND NOT ("DI OUT P03".M305_Box_Data.Trgt_Storage.HBS = 0); // Target destination order of perecedence. "PRECEDENCE ORDER"(LOAD_HBS12 := #Load_HBS12, BOXDATA1_OCCUPIED := "DI OUT P03".M302_Box_Data.Info.Occupied, BOXDATA2_OCCUPIED := "DI OUT P03".M303_Box_Data.Info.Occupied, BOXDATA3_OCCUPIED := "DI OUT P03".M304_Box_Data.Info.Occupied, BOXDATA4_OCCUPIED := "DI OUT P03".M305_Box_Data.Info.Occupied, COMMISSION_POINTER => #CurrentCommission, GOTO_STEP := #SSM.S.stepnew); IF #SSM.S.stepnew >= 2 AND #CurrentCommission >= 1 THEN #SSM.S.stepd := TRUE; ELSIF NOT #SSM.S.steplo THEN #SSM.S."1_FAULT_00_15".%X2 := TRUE; END_IF; END_IF;
2: // M302 > HBS1, M303 > HBS1, M304 > HBS1, M305 > HBS1 IF #SSM.S.stepfc THEN // M302 > HBS1 "DI MAIN P03".MoDa.RunTimeSetP_seq1 := 350; "DI MAIN P03".MoDa.RunTimeCntrl_seq1 := 0; IF "DI OUT P03".M302_Box_Data.Info.Occupied THEN #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); #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; // M303 > HBS1 ELSIF "DI OUT P03".M303_Box_Data.Info.Occupied THEN #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); #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; // M304 > HBS1 ELSIF "DI OUT P03".M304_Box_Data.Info.Occupied THEN #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); #CurrentStoragePlace := "DI OUT P03".M304_Box_Data.Trgt_Storage.Place; "DI OUT P03".G120C_Z.DRV.Support.SetVelo := "ModulDa".MaPa.HBS1.Gap.Z * "DI OUT P03".HBS2_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; ELSE // M305 > HBS1 #ExecuteCoordinate(INDEX_POS := "DI OUT P03".M305_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); #CurrentStoragePlace := "DI OUT P03".M305_Box_Data.Trgt_Storage.Place; "DI OUT P03".G120C_Z.DRV.MC_MoveAbsolute.Position := "ModulDa".MaPa.HBS1.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".HBS1.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; END_IF; ELSE // Move STC to TargetPos HBS1 "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 #SSM.S.c2.start := #BoxCommissionDone_HSB1; #SSM.S.c2.set := 25; "DI MAIN P03".M00.SEQ1_Done := #SSM.S.c2.done; END_IF; END_IF;
3: // M305 > HBS2, M304 > HBS2, M303 > HBS2, M302 > HBS2 IF #SSM.S.stepfc THEN // M305 > HBS2 "DI MAIN P03".MoDa.RunTimeSetP_seq1 := 380; "DI MAIN P03".MoDa.RunTimeCntrl_seq1 := 0; IF "DI OUT P03".M305_Box_Data.Info.Occupied THEN #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); #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 > HBS2 ELSIF "DI OUT P03".M304_Box_Data.Info.Occupied THEN #ExecuteCoordinate(INDEX_POS := "DI OUT P03".M304_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); #CurrentStoragePlace := "DI OUT P03".M304_Box_Data.Trgt_Storage.Place; "DI OUT P03".G120C_Z.DRV.MC_MoveAbsolute.Position := - "ModulDa".MaPa.HBS2.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".HBS2.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; // M303 > HBS2 ELSIF "DI OUT P03".M303_Box_Data.Info.Occupied THEN #ExecuteCoordinate(INDEX_POS := "DI OUT P03".M303_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); #CurrentStoragePlace := "DI OUT P03".M303_Box_Data.Trgt_Storage.Place; "DI OUT P03".G120C_Z.DRV.MC_MoveAbsolute.Position := - "ModulDa".MaPa.HBS2.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".HBS2.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; ELSE // M302 > HBS2 #ExecuteCoordinate(INDEX_POS := "DI OUT P03".M302_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); #CurrentStoragePlace := "DI OUT P03".M302_Box_Data.Trgt_Storage.Place; "DI OUT P03".G120C_Z.DRV.MC_MoveAbsolute.Position := - "ModulDa".MaPa.HBS2.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".HBS2.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; ELSE // Move STC to TartePos HBS2 "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. HBS2 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 #SSM.S.c2.start := #BoxCommissionDone_HSB2; #SSM.S.c2.set := 25; "DI MAIN P03".M00.SEQ1_Done := #SSM.S.c2.done; END_IF; END_IF; |
|
FB52 SEQ1 1/3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|