
(* 4x3 flyways 1 xbot - waituntil DI, config DI as trigger *)
FUNCTION_BLOCK Example13_waituntilDI
	(*move xbot 1 to 60,60*)
	PMC_XYMotion1(PM_Controller := PM_Controller,Execute := Execute,cmdLB := 1,XbotID := 1,Mode := 0,Type_ := 0,PosX := 0.06,PosY := 0.06,EndVel := 0,MaxVel := 1,MaxAcc := 10);

	(*set DI 1 as trigger source*)
	DI_ID_array22[0] := 1;
	PMC_ConfigDI2Trigger1(PM_Controller := PM_Controller,Execute := PMC_XYMotion1.Done,nDI := 1,DiID := DI_ID_array22);

	(*xbot 1 wait until DI1 rising edge*)
	PMC_WaitUntilFBDI1(PM_Controller := PM_Controller,Execute := PMC_ConfigDI2Trigger1.Done,cmdLB := 3,XbotID := 1,TriggerDI := 1,TriggerType := 0);

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

	(*load xbot 1 move to 900,660*)
	PMC_XYMotion3(PM_Controller := PM_Controller,Execute := PMC_XYMotion2.Ack,cmdLB := 5,XbotID := 1,Mode := 0,Type_ := 0,PosX := 0.9,PosY := 0.66,EndVel := 0,MaxVel := 1,MaxAcc := 10);

	Delay1(Execute := PMC_XYMotion3.Ack,Cycles := 2000);

	(*set DI 1 to 0*)
	PMC_SendDigitalSignalToPMC1(PM_Controller := PM_Controller,Enable := Delay1.Done,DoID := 1,Level := FALSE);

	Delay2(Execute := PMC_SendDigitalSignalToPMC1.Valid,Cycles := 1);

	(*set DI 1 to 1*)
	PMC_SendDigitalSignalToPMC2(PM_Controller := PM_Controller,Enable := Delay2.Done,DoID := 1,Level := TRUE);

	Done := PMC_XYMotion3.Done;
END_FUNCTION_BLOCK
