
(* 2x1 flyways 2 xbots (actual physical) - ZoneCtrl *)
FUNCTION_BLOCK Example28a_zoneunloading
	IF NOT(Execute) THEN
		UserFinishedRemovingXbot := FALSE;
	END_IF; 

	(*move to starting position*)
	xbotid_array78[0] := 1; xbotid_array78[1] := 2;
	posx_array78[0] := 0.06;posx_array78[1] := 0.18;
	posy_array78[0] := 0.06;posy_array78[1] := 0.06;
	PMC_AutoDrivingMotion1(PM_Controller := PM_Controller,Execute := Execute,nXbots := 2,RoutingType := 0,ZoneID := 0,XbotID := xbotid_array78,PosX := posx_array78,PosY := posy_array78);

	(*move xbot 2 into zone 2 (flyway 2)*)
	PMC_XYMotion1(PM_Controller := PM_Controller,Execute := PMC_AutoDrivingMotion1.Done,cmdLB := 2,XbotID := 2,Mode := 0,Type_ := 0,PosX := 0.36,PosY := 0.12,EndVel := 0,MaxVel := 1,MaxAcc := 10);

	(*deactivate zone 2 (flyway 2)*)
	PMC_Zone_ZoneCtrl1(PM_Controller := PM_Controller,PM_Controller := PM_Controller,Execute := PMC_XYMotion1.Done,ZoneID := 2,Level := 0);

	(*tell user that they can remove the xbot in the zone*)
	UserCanRemoveXbot := PMC_Zone_ZoneCtrl1.Done;

	(*activate zone once user says they are done removing the xbot*)
	PMC_Zone_ZoneCtrl2(PM_Controller := PM_Controller,PM_Controller := PM_Controller,Execute := UserFinishedRemovingXbot AND PMC_Zone_ZoneCtrl1.Done,ZoneID := 2,Level := 1);

	Done := PMC_Zone_ZoneCtrl2.Done;
END_FUNCTION_BLOCK
