
(* 4x3 flyways 1 xbots - get xbot status, wait until delay *)
FUNCTION_BLOCK Example10_waituntiltime
	(*get xbot 1 status*)
	PMC_GetXbotStatus1(PM_Controller := PM_Controller,Execute := Execute,XbotID := 1,FeedbackType := 0);
	xbot_state := PMC_GetXbotStatus1.State;
	cmdlb := PMC_GetXbotStatus1.CmdLb;
	posX := PMC_GetXbotStatus1.PosX;
	posY := PMC_GetXbotStatus1.PosY;
	posZ := PMC_GetXbotStatus1.PosZ;
	posRx := PMC_GetXbotStatus1.PosRx;
	posRy := PMC_GetXbotStatus1.PosRy;
	posRz := PMC_GetXbotStatus1.PosRz;

	(*block xbot 1 buffer*)
	PMC_MotionBufferCtrl1(PM_Controller := PM_Controller,Execute := PMC_GetXbotStatus1.Valid,Level := 0,XbotID := 1);

	(*load move to 900,60*)
	PMC_XYMotion1(PM_Controller := PM_Controller,Execute := PMC_MotionBufferCtrl1.Done,cmdLB := 3,XbotID := 1,Mode := 0,Type_ := 0,PosX := 0.9,PosY := 0.06,EndVel := 0,MaxVel := 1,MaxAcc := 10);

	(*load wait for 5 seconds*)
	PMC_WaitUntilTimeDelay1(PM_Controller := PM_Controller,Execute := PMC_XYMotion1.Ack,cmdLB := 4,XbotID := 1,Delay := 5.0);

	(*load move to 60,60*)
	PMC_XYMotion2(PM_Controller := PM_Controller,Execute := PMC_WaitUntilTimeDelay1.Ack,cmdLB := 5,XbotID := 1,Mode := 0,Type_ := 0,PosX := 0.06,PosY := 0.06,EndVel := 0,MaxVel := 1,MaxAcc := 10);

	(*load wait for 5 seconds*)
	PMC_WaitUntilTimeDelay2(PM_Controller := PM_Controller,Execute := PMC_XYMotion2.Ack,cmdLB := 6,XbotID := 1,Delay := 5.0);

	(*release xbot 1 buffer*)
	PMC_MotionBufferCtrl2(PM_Controller := PM_Controller,Execute := PMC_WaitUntilTimeDelay2.Ack,Level := 1,XbotID := 1);

	Done := PMC_WaitUntilTimeDelay2.Done;
END_FUNCTION_BLOCK
