PROGRAM Main
VAR
//declare motion stage objects to connect with io
{attribute 'pytmc' := 'pv: HXX:HXSS:ROV:MMS:ALL_H'}
{attribute 'TcLinkTo' := '.bLimitForwardEnable := TIID^Device 1 (EtherCAT)^Term 1 (EK1200)^E2 (EL1088)^Channel 1^Input;
.bLimitBackwardEnable := TIID^Device 1 (EtherCAT)^Term 1 (EK1200)^E2 (EL1088)^Channel 3^Input
'}
M1 : DUT_MotionStage;
{attribute 'pytmc' := 'pv: HXX:HXSS:ROV:MMS:ALL_V'}
{attribute 'TcLinkTo' := '.bLimitForwardEnable := TIID^Device 1 (EtherCAT)^Term 1 (EK1200)^E2 (EL1088)^Channel 2^Input;
.bLimitBackwardEnable := TIID^Device 1 (EtherCAT)^Term 1 (EK1200)^E2 (EL1088)^Channel 4^Input
'}
M2 : DUT_MotionStage;
{attribute 'pytmc' := 'pv: HXX:HXSS:ROV:MMS:XTAL_TH'}
{attribute 'TcLinkTo' := '.bLimitForwardEnable := TIID^Device 1 (EtherCAT)^Term 1 (EK1200)^E5 (EL1088)^Channel 1^Input;
.bLimitBackwardEnable := TIID^Device 1 (EtherCAT)^Term 1 (EK1200)^E5 (EL1088)^Channel 3^Input
'}
M3 : DUT_MotionStage;
{attribute 'pytmc' := 'pv: HXX:HXSS:ROV:MMS:XTAL_TTH'}
{attribute 'TcLinkTo' := '.bLimitForwardEnable := TIID^Device 1 (EtherCAT)^Term 1 (EK1200)^E5 (EL1088)^Channel 2^Input;
.bLimitBackwardEnable := TIID^Device 1 (EtherCAT)^Term 1 (EK1200)^E5 (EL1088)^Channel 4^Input
'}
M4 : DUT_MotionStage;
{attribute 'pytmc' := 'pv: HXX:HXSS:ROV:MMS:XTAL_H'}
{attribute 'TcLinkTo' := '.bLimitForwardEnable := TIID^Device 1 (EtherCAT)^Term 1 (EK1200)^E8 (EL1088)^Channel 1^Input;
.bLimitBackwardEnable := TIID^Device 1 (EtherCAT)^Term 1 (EK1200)^E8 (EL1088)^Channel 3^Input
'}
M5 : DUT_MotionStage;
{attribute 'pytmc' := 'pv: HXX:HXSS:ROV:MMS:XTAL_V'}
{attribute 'TcLinkTo' := '.bLimitForwardEnable := TIID^Device 1 (EtherCAT)^Term 1 (EK1200)^E8 (EL1088)^Channel 2^Input;
.bLimitBackwardEnable := TIID^Device 1 (EtherCAT)^Term 1 (EK1200)^E8 (EL1088)^Channel 4^Input
'}
M6 : DUT_MotionStage;
{attribute 'pytmc' := 'pv: HXX:HXSS:ROV:MMS:DET_H'}
{attribute 'TcLinkTo' := '.bLimitForwardEnable := TIID^Device 1 (EtherCAT)^Term 1 (EK1200)^E11 (EL1088)^Channel 1^Input;
.bLimitBackwardEnable := TIID^Device 1 (EtherCAT)^Term 1 (EK1200)^E11 (EL1088)^Channel 3^Input
'}
M7 : DUT_MotionStage;
{attribute 'pytmc' := 'pv: HXX:HXSS:ROV:MMS:DET_V'}
{attribute 'TcLinkTo' := '.bLimitForwardEnable := TIID^Device 1 (EtherCAT)^Term 1 (EK1200)^E11 (EL1088)^Channel 2^Input;
.bLimitBackwardEnable := TIID^Device 1 (EtherCAT)^Term 1 (EK1200)^E11 (EL1088)^Channel 4^Input
'}
M8 : DUT_MotionStage;
//declare axes
fbMotion1 : FB_MotionStage;
fbMotion2 : FB_MotionStage;
fbMotion3 : FB_MotionStage;
fbMotion4 : FB_MotionStage;
fbMotion5 : FB_MotionStage;
fbMotion6 : FB_MotionStage;
fbMotion7 : FB_MotionStage;
fbMotion8 : FB_MotionStage;
END_VAR
//invoke axes
fbMotion1(stMotionStage:=M1);
fbMotion2(stMotionStage:=M2);
fbMotion3(stMotionStage:=M3);
fbMotion4(stMotionStage:=M4);
fbMotion5(stMotionStage:=M5);
fbMotion6(stMotionStage:=M6);
fbMotion7(stMotionStage:=M7);
fbMotion8(stMotionStage:=M8);
//.bHardwareEnable
M1.bHardwareEnable:=TRUE;
M2.bHardwareEnable:=TRUE;
M3.bHardwareEnable:=TRUE;
M4.bHardwareEnable:=TRUE;
M5.bHardwareEnable:=TRUE;
M6.bHardwareEnable:=TRUE;
M7.bHardwareEnable:=TRUE;
M8.bHardwareEnable:=TRUE;
//.bPowerSelf
M1.bPowerSelf:=TRUE;
M2.bPowerSelf:=TRUE;
M3.bPowerSelf:=TRUE;
M4.bPowerSelf:=TRUE;
M5.bPowerSelf:=TRUE;
M6.bPowerSelf:=TRUE;
M7.bPowerSelf:=TRUE;
M8.bPowerSelf:=TRUE;
//Limit switches
M3.bLimitBackwardEnable:=TRUE;
M3.bLimitForwardEnable:=TRUE;
M4.bLimitBackwardEnable:=TRUE;
M4.bLimitForwardEnable:=TRUE;
END_PROGRAM