
(* 4x3 flyways, 4 xbots - get xbot prop, set xbot prop, sync move *)
FUNCTION_BLOCK Example06_sync
	(*async move to 60,60 300,60 540,60 780,60*)
	xbotID_array78[0] := 1;xbotID_array78[1] := 2;xbotID_array78[2] := 3;xbotID_array78[3] := 4;
	PosX_array78[0] := 0.060;PosX_array78[1] := 0.300;PosX_array78[2] := 0.540;PosX_array78[3] := 0.780;
	PosY_array78[0] := 0.060;PosY_array78[1] := 0.060;PosY_array78[2] := 0.060;PosY_array78[3] := 0.060;
	PMC_AutoDrivingMotion1(PM_Controller := PM_Controller,Execute := Execute,nXbots := 4,RoutingType := 0,ZoneID := 0,XbotID := xbotID_array78,PosX := PosX_array78,PosY := PosY_array78,PM_Controller := PM_Controller);

	(*sync move all xbots to top of flyways*)
	xbotID_array4[0] := 1;xbotID_array4[1] := 2;xbotID_array4[2] := 3;xbotID_array4[3] := 4;
	endvel_4[0] := 0.0;endvel_4[1] := 0.0;endvel_4[2] := 0.0;endvel_4[3] := 0.0;
	posx_4[0] := 0.06;posx_4[1] := 0.30;posx_4[2] := 0.54;posx_4[3] := 0.78;
	posy_4[0] := 0.66;posy_4[1] := 0.66;posy_4[2] := 0.66;posy_4[3] := 0.66;
	maxacc_4[0] := 10;maxacc_4[1] := 10;maxacc_4[2] := 20;maxacc_4[3] := 20;
	maxvel_4[0] := 1;maxvel_4[1] := 1;maxvel_4[2] := 2;maxvel_4[3] := 2;
	PMC_SyncMotion1(PM_Controller := PM_Controller,Execute := PMC_AutoDrivingMotion1.Done,nXbots := 4,XbotID := xbotID_array4,PosX := posx_4,PosY := posy_4,EndVel := endvel_4,MaxVel := maxvel_4,MaxAcc := maxacc_4,PM_Controller := PM_Controller);

	(*sync move all xbots to bottom of flyways*)
	xbotID_array4[0] := 1;xbotID_array4[1] := 2;xbotID_array4[2] := 3;xbotID_array4[3] := 4;
	endvel_4[0] := 0.0;endvel_4[1] := 0.0;endvel_4[2] := 0.0;endvel_4[3] := 0.0;
	posx_4[0] := 0.06;posx_4[1] := 0.30;posx_4[2] := 0.54;posx_4[3] := 0.78;
	posy_4[0] := 0.06;posy_4[1] := 0.06;posy_4[2] := 0.06;posy_4[3] := 0.06;
	maxacc_4[0] := 20;maxacc_4[1] := 20;maxacc_4[2] := 10;maxacc_4[3] := 10;
	maxvel_4[0] := 2;maxvel_4[1] := 2;maxvel_4[2] := 1;maxvel_4[3] := 1;
	PMC_SyncMotion2(PM_Controller := PM_Controller,Execute := PMC_SyncMotion1.Done,nXbots := 4,XbotID := xbotID_array4,PosX := posx_4,PosY := posy_4,EndVel := endvel_4,MaxVel := maxvel_4,MaxAcc := maxacc_4,PM_Controller := PM_Controller);

	Done := PMC_SyncMotion2.Done;
END_FUNCTION_BLOCK
