
(* 2x1 flyways 1 xbot - LevitationLandw/Speed *)
FUNCTION_BLOCK Example27_levitatelandspeed
	IF(Execute = TRUE)THEN
		time_count := time_count + 1;
	ELSE
		time_count := 0;
	END_IF;

	(*Land in 1.6s*)
	PMC_LevitationCtrlSpeed1(PM_Controller := PM_Controller,Execute := Execute,XbotID := 1,Level := 0,Speed := 0);
	IF(PMC_LevitationCtrlSpeed1.Done = TRUE AND PMC_LevitationCtrlSpeed2.Execute = FALSE)THEN
		levland_times[0] := time_count;
	END_IF;

	(*Levitate in 1.6s*)
	PMC_LevitationCtrlSpeed2(PM_Controller := PM_Controller,Execute := PMC_LevitationCtrlSpeed1.Done,XbotID := 1,Level := 1,Speed := 0);
	IF(PMC_LevitationCtrlSpeed2.Done = TRUE AND PMC_LevitationCtrlSpeed3.Execute = FALSE)THEN
		levland_times[1] := time_count;
	END_IF;

	(*Land in 0.8s*)
	PMC_LevitationCtrlSpeed3(PM_Controller := PM_Controller,Execute := PMC_LevitationCtrlSpeed2.Done,XbotID := 1,Level := 0,Speed := 1);
	IF(PMC_LevitationCtrlSpeed3.Done = TRUE AND PMC_LevitationCtrlSpeed4.Execute = FALSE)THEN
		levland_times[2] := time_count;
	END_IF;

	(*Levitate in 0.8s*)
	PMC_LevitationCtrlSpeed4(PM_Controller := PM_Controller,Execute := PMC_LevitationCtrlSpeed3.Done,XbotID := 1,Level := 1,Speed := 1);
	IF(PMC_LevitationCtrlSpeed4.Done = TRUE AND PMC_LevitationCtrlSpeed5.Execute = FALSE)THEN
		levland_times[3] := time_count;
	END_IF;

	(*Land in 0.4s*)
	PMC_LevitationCtrlSpeed5(PM_Controller := PM_Controller,Execute := PMC_LevitationCtrlSpeed4.Done,XbotID := 1,Level := 0,Speed := 2);
	IF(PMC_LevitationCtrlSpeed5.Done = TRUE AND PMC_LevitationCtrlSpeed6.Execute = FALSE)THEN
		levland_times[4] := time_count;
	END_IF;

	(*Levitate in 0.4s*)
	PMC_LevitationCtrlSpeed6(PM_Controller := PM_Controller,Execute := PMC_LevitationCtrlSpeed5.Done,XbotID := 1,Level := 1,Speed := 2);
	IF(PMC_LevitationCtrlSpeed6.Done = TRUE AND PMC_LevitationCtrlSpeed7.Execute = FALSE)THEN
		levland_times[5] := time_count;
	END_IF;

	(*Land in 0.2s*)
	PMC_LevitationCtrlSpeed7(PM_Controller := PM_Controller,Execute := PMC_LevitationCtrlSpeed6.Done,XbotID := 1,Level := 0,Speed := 3);
	IF(PMC_LevitationCtrlSpeed7.Done = TRUE AND PMC_LevitationCtrlSpeed8.Execute = FALSE)THEN
		levland_times[6] := time_count;
	END_IF;

	(*Levitate in 0.2s*)
	PMC_LevitationCtrlSpeed8(PM_Controller := PM_Controller,Execute := PMC_LevitationCtrlSpeed7.Done,XbotID := 1,Level := 1,Speed := 3);
	IF(PMC_LevitationCtrlSpeed8.Done = TRUE AND PMC_LevitationCtrlSpeed9.Execute = FALSE)THEN
		levland_times[7] := time_count;
	END_IF;

	(*Land in 0.1s*)
	PMC_LevitationCtrlSpeed9(PM_Controller := PM_Controller,Execute := PMC_LevitationCtrlSpeed8.Done,XbotID := 1,Level := 0,Speed := 4);
	IF(PMC_LevitationCtrlSpeed9.Done = TRUE AND PMC_LevitationCtrlSpeed10.Execute = FALSE)THEN
		levland_times[8] := time_count;
	END_IF;

	(*Levitate in 0.1s*)
	PMC_LevitationCtrlSpeed10(PM_Controller := PM_Controller,Execute := PMC_LevitationCtrlSpeed9.Done,XbotID := 1,Level := 1,Speed := 4);
	IF(PMC_LevitationCtrlSpeed10.Done = TRUE AND Done = FALSE)THEN
		levland_times[9] := time_count;
	END_IF;

	Done := PMC_LevitationCtrlSpeed10.Done;
END_FUNCTION_BLOCK
