DUTs
E_HomeState
TYPE E_HomeState :
(
H_READY,
H_INIT,
H_RESET_LL,
H_RESET_HL,
H_ENABLE,
H_MOVING,
H_KEEP_MOVING,
H_CHECK,
H_RESET,
H_SET_POS,
H_ERROR,
H_WRITE_LL,
H_WRITE_HL,
H_DONE
) UDINT;
END_TYPE
- Related:
GVLs
Main
{attribute 'qualified_only'}
VAR_GLOBAL
// ATM: 2 Axes
{attribute 'pytmc' := 'pv: MFX:ATM:MMS:Y'}
//{attribute 'TcLinkTo' := '.bLimitForwardEnable := TIIB[MFX-ATM-EL7041-E1]^STM Status^Status^Digital input 1;
// .bLimitBackwardEnable := TIIB[MFX-ATM-EL7041-E1]^STM Status^Status^Digital input 2;
// .bBrakeRelease := TIIB[MFX-ATM-EL2004-E4]^Channel 1^Output;
// .nRawEncoderULINT := TIIB[MFX-ATM-EL5042-E3]^FB Inputs Channel 1^Position'}
{attribute 'TcLinkTo' := '.bLimitForwardEnable := TIIB[MFX-ATM-EL7041-E1]^STM Status^Status^Digital input 1;
.bLimitBackwardEnable := TIIB[MFX-ATM-EL7041-E1]^STM Status^Status^Digital input 2;
.nRawEncoderULINT := TIIB[MFX-ATM-EL5042-E3]^FB Inputs Channel 1^Position'}
M1: DUT_MotionStage := (sName := 'MFX:ATM:MMS:Y');
{attribute 'pytmc' := 'pv: MFX:ATM:MMS:X'}
{attribute 'TcLinkTo' := '.nRawEncoderULINT := TIIB[MFX-ATM-EL5042-E3]^FB Inputs Channel 2^Position'}
M2: DUT_MotionStage := (sName := 'MFX:ATM:MMS:X');
// LIB-: 4 Axes
{attribute 'pytmc' := 'pv: MFX:LIB:MMS:01'}
{attribute 'TcLinkTo' := '.bLimitForwardEnable := TIIB[MFX-LIB-EL1088-E5]^Channel 1^Input;
.bLimitBackwardEnable := TIIB[MFX-LIB-EL1088-E5]^Channel 2^Input'}
M3: DUT_MotionStage := (sName := 'MFX:LIB:MMS:01');
{attribute 'pytmc' := 'pv: MFX:LIB:MMS:02'}
{attribute 'TcLinkTo' := '.bLimitForwardEnable := TIIB[MFX-LIB-EL1088-E5]^Channel 3^Input;
.bLimitBackwardEnable := TIIB[MFX-LIB-EL1088-E5]^Channel 4^Input'}
M4: DUT_MotionStage := (sName := 'MFX:LIB:MMS:02');
{attribute 'pytmc' := 'pv: MFX:LIB:MMS:03'}
{attribute 'TcLinkTo' := '.bLimitForwardEnable := TIIB[MFX-LIB-EL1088-E5]^Channel 5^Input;
.bLimitBackwardEnable := TIIB[MFX-LIB-EL1088-E5]^Channel 6^Input'}
M5: DUT_MotionStage := (sName := 'MFX:LIB:MMS:03');
{attribute 'pytmc' := 'pv: MFX:LIB:MMS:04'}
{attribute 'TcLinkTo' := '.bLimitForwardEnable := TIIB[MFX-LIB-EL1088-E5]^Channel 7^Input;
.bLimitBackwardEnable := TIIB[MFX-LIB-EL1088-E5]^Channel 8^Input'}
M6: DUT_MotionStage := (sName := 'MFX:LIB:MMS:04');
// LJ-: 8 Axes
{attribute 'pytmc' := 'pv: MFX:LJH:JET:X'}
{attribute 'TcLinkTo' := '.bLimitForwardEnable := TIIB[MFX-LJ-EL1088-E3]^Channel 2^Input;
.bLimitBackwardEnable := TIIB[MFX-LJ-EL1088-E3]^Channel 1^Input'}
M7: DUT_MotionStage := (sName := 'MFX:LJH:JET:X');
{attribute 'pytmc' := 'pv: MFX:LJH:JET:Y'}
{attribute 'TcLinkTo' := '.bLimitForwardEnable := TIIB[MFX-LJ-EL1088-E3]^Channel 3^Input;
.bLimitBackwardEnable := TIIB[MFX-LJ-EL1088-E3]^Channel 4^Input'}
M8: DUT_MotionStage := (sName := 'MFX:LJH:JET:Y');
{attribute 'pytmc' := 'pv: MFX:LJH:JET:Z'}
{attribute 'TcLinkTo' := '.bLimitForwardEnable := TIIB[MFX-LJ-EL1088-E8]^Channel 1^Input;
.bLimitBackwardEnable := TIIB[MFX-LJ-EL1088-E8]^Channel 2^Input'}
M9: DUT_MotionStage := (sName := 'MFX:LJH:JET:Z');
{attribute 'pytmc' := 'pv: MFX:LJH:DET:X'}
{attribute 'TcLinkTo' := '.bLimitForwardEnable := TIIB[MFX-LJ-EL1088-E8]^Channel 4^Input;
.bLimitBackwardEnable := TIIB[MFX-LJ-EL1088-E8]^Channel 3^Input'}
M10: DUT_MotionStage := (sName := 'MFX:LJH:DET:X');
{attribute 'pytmc' := 'pv: MFX:LJH:SS:TOP_X'}
{attribute 'TcLinkTo' := '.bLimitForwardEnable := TIIB[MFX-LJ-EL1088-E12]^Channel 1^Input;
.bLimitBackwardEnable := TIIB[MFX-LJ-EL1088-E12]^Channel 2^Input'}
M11: DUT_MotionStage := (sName := 'MFX:LJH:SS:TOP_X');
{attribute 'pytmc' := 'pv: MFX:LJH:SS:TOP_Y'}
{attribute 'TcLinkTo' := '.bLimitForwardEnable := TIIB[MFX-LJ-EL1088-E12]^Channel 3^Input;
.bLimitBackwardEnable := TIIB[MFX-LJ-EL1088-E12]^Channel 4^Input'}
M12: DUT_MotionStage := (sName := 'MFX:LJH:SS:TOP_Y');
{attribute 'pytmc' := 'pv: MFX:LJH:SS:BOT_X'}
{attribute 'TcLinkTo' := '.bLimitForwardEnable := TIIB[MFX-LJ-EL1088-E12]^Channel 5^Input;
.bLimitBackwardEnable := TIIB[MFX-LJ-EL1088-E12]^Channel 6^Input'}
M13: DUT_MotionStage := (sName := 'MFX:LJH:SS:BOT_X');
{attribute 'pytmc' := 'pv: MFX:LJH:SS:BOT_Y'}
{attribute 'TcLinkTo' := '.bLimitForwardEnable := TIIB[MFX-LJ-EL1088-E12]^Channel 7^Input;
.bLimitBackwardEnable := TIIB[MFX-LJ-EL1088-E12]^Channel 8^Input'}
M14: DUT_MotionStage := (sName := 'MFX:LJH:SS:BOT_Y');
// SPEC-: 22 Axes
{attribute 'pytmc' := 'pv: MFX:SPEC:C1:X'}
{attribute 'TcLinkTo' := '.bLimitForwardEnable := TIIB[MFX-SPEC1-EL1088-E4]^Channel 1^Input;
.bLimitBackwardEnable := TIIB[MFX-SPEC1-EL1088-E4]^Channel 2^Input'}
M15: DUT_MotionStage := (sName := 'MFX:SPEC:C1:X');
{attribute 'pytmc' := 'pv: MFX:SPEC:C1:ROT'}
{attribute 'TcLinkTo' := '.bLimitForwardEnable := TIIB[MFX-SPEC1-EL1088-E4]^Channel 3^Input;
.bLimitBackwardEnable := TIIB[MFX-SPEC1-EL1088-E4]^Channel 4^Input'}
M16: DUT_MotionStage := (sName := 'MFX:SPEC:C1:ROT');
{attribute 'pytmc' := 'pv: MFX:SPEC:C1:TILT'}
{attribute 'TcLinkTo' := '.bLimitForwardEnable := TIIB[MFX-SPEC1-EL1088-E4]^Channel 5^Input;
.bLimitBackwardEnable := TIIB[MFX-SPEC1-EL1088-E4]^Channel 6^Input'}
M17: DUT_MotionStage := (sName := 'MFX:SPEC:C1:TILT');
{attribute 'pytmc' := 'pv: MFX:SPEC:C2:X'}
{attribute 'TcLinkTo' := '.bLimitForwardEnable := TIIB[MFX-SPEC1-EL1088-E4]^Channel 7^Input;
.bLimitBackwardEnable := TIIB[MFX-SPEC1-EL1088-E4]^Channel 8^Input'}
M18: DUT_MotionStage := (sName := 'MFX:SPEC:C2:X');
{attribute 'pytmc' := 'pv: MFX:SPEC:C2:ROT'}
{attribute 'TcLinkTo' := '.bLimitForwardEnable := TIIB[MFX-SPEC1-EL1088-E11]^Channel 1^Input;
.bLimitBackwardEnable := TIIB[MFX-SPEC1-EL1088-E11]^Channel 2^Input'}
M19: DUT_MotionStage := (sName := 'MFX:SPEC:C2:ROT');
{attribute 'pytmc' := 'pv: MFX:SPEC:C2:TILT'}
{attribute 'TcLinkTo' := '.bLimitForwardEnable := TIIB[MFX-SPEC1-EL1088-E11]^Channel 3^Input;
.bLimitBackwardEnable := TIIB[MFX-SPEC1-EL1088-E11]^Channel 4^Input'}
M20: DUT_MotionStage := (sName := 'MFX:SPEC:C2:TILT');
{attribute 'pytmc' := 'pv: MFX:SPEC:C3:X'}
{attribute 'TcLinkTo' := '.bLimitForwardEnable := TIIB[MFX-SPEC1-EL1088-E11]^Channel 5^Input;
.bLimitBackwardEnable := TIIB[MFX-SPEC1-EL1088-E11]^Channel 6^Input;
.bHome := TIIB[MFX-SPEC1-EL1088-E11]^Channel 7^Input'}
M21: DUT_MotionStage := (sName := 'MFX:SPEC:C3:X');
{attribute 'pytmc' := 'pv: MFX:SPEC:C3:ROT'}
{attribute 'TcLinkTo' := '.bLimitForwardEnable := TIIB[MFX-SPEC1-EL1088-E17]^Channel 1^Input;
.bLimitBackwardEnable := TIIB[MFX-SPEC1-EL1088-E17]^Channel 2^Input;
.bHome := TIIB[MFX-SPEC1-EL1088-E11]^Channel 8^Input'}
M22: DUT_MotionStage := (sName := 'MFX:SPEC:C3:ROT');
{attribute 'pytmc' := 'pv: MFX:SPEC:C3:TILT'}
{attribute 'TcLinkTo' := '.bLimitForwardEnable := TIIB[MFX-SPEC1-EL1088-E17]^Channel 3^Input;
.bLimitBackwardEnable := TIIB[MFX-SPEC1-EL1088-E17]^Channel 4^Input;
.bHome := TIIB[MFX-SPEC1-EL1088-E17]^Channel 5^Input'}
M23: DUT_MotionStage := (sName := 'MFX:SPEC:C3:TILT');
{attribute 'pytmc' := 'pv: MFX:SPEC:C4:X'}
{attribute 'TcLinkTo' := '.bLimitForwardEnable := TIIB[MFX-SPEC1-EL1088-E17]^Channel 6^Input;
.bLimitBackwardEnable := TIIB[MFX-SPEC1-EL1088-E17]^Channel 7^Input;
.bHome := TIIB[MFX-SPEC1-EL1088-E17]^Channel 8^Input'}
M24: DUT_MotionStage := (sName := 'MFX:SPEC:C4:X');
{attribute 'pytmc' := 'pv: MFX:SPEC:C4:ROT'}
{attribute 'TcLinkTo' := '.bLimitForwardEnable := TIIB[MFX-SPEC1-EL1088-E21]^Channel 1^Input;
.bLimitBackwardEnable := TIIB[MFX-SPEC1-EL1088-E21]^Channel 2^Input;
.bHome := TIIB[MFX-SPEC1-EL1088-E21]^Channel 3^Input'}
M25: DUT_MotionStage := (sName := 'MFX:SPEC:C4:ROT');
{attribute 'pytmc' := 'pv: MFX:SPEC:C4:TILT'}
{attribute 'TcLinkTo' := '.bLimitForwardEnable := TIIB[MFX-SPEC1-EL1088-E21]^Channel 4^Input;
.bLimitBackwardEnable := TIIB[MFX-SPEC1-EL1088-E21]^Channel 5^Input;
.bHome := TIIB[MFX-SPEC1-EL1088-E21]^Channel 6^Input'}
M26: DUT_MotionStage := (sName := 'MFX:SPEC:C4:TILT');
{attribute 'pytmc' := 'pv: MFX:SPEC:C5:X'}
{attribute 'TcLinkTo' := '.bLimitForwardEnable := TIIB[MFX-SPEC2-EL1088-E4]^Channel 1^Input;
.bLimitBackwardEnable := TIIB[MFX-SPEC2-EL1088-E4]^Channel 2^Input'}
M27: DUT_MotionStage := (sName := 'MFX:SPEC:C5:X');
{attribute 'pytmc' := 'pv: MFX:SPEC:C5:ROT'}
{attribute 'TcLinkTo' := '.bLimitForwardEnable := TIIB[MFX-SPEC2-EL1088-E4]^Channel 3^Input;
.bLimitBackwardEnable := TIIB[MFX-SPEC2-EL1088-E4]^Channel 4^Input'}
M28: DUT_MotionStage := (sName := 'MFX:SPEC:C5:ROT');
{attribute 'pytmc' := 'pv: MFX:SPEC:C5:TILT'}
{attribute 'TcLinkTo' := '.bLimitForwardEnable := TIIB[MFX-SPEC2-EL1088-E4]^Channel 5^Input;
.bLimitBackwardEnable := TIIB[MFX-SPEC2-EL1088-E4]^Channel 6^Input'}
M29: DUT_MotionStage := (sName := 'MFX:SPEC:C5:TILT');
{attribute 'pytmc' := 'pv: MFX:SPEC:C6:X'}
{attribute 'TcLinkTo' := '.bLimitForwardEnable := TIIB[MFX-SPEC2-EL1088-E4]^Channel 7^Input;
.bLimitBackwardEnable := TIIB[MFX-SPEC2-EL1088-E4]^Channel 8^Input'}
M30: DUT_MotionStage := (sName := 'MFX:SPEC:C6:X');
{attribute 'pytmc' := 'pv: MFX:SPEC:C6:ROT'}
{attribute 'TcLinkTo' := '.bLimitForwardEnable := TIIB[MFX-SPEC2-EL1088-E11]^Channel 1^Input;
.bLimitBackwardEnable := TIIB[MFX-SPEC2-EL1088-E11]^Channel 2^Input'}
M31: DUT_MotionStage := (sName := 'MFX:SPEC:C6:ROT');
{attribute 'pytmc' := 'pv: MFX:SPEC:C6:TILT'}
{attribute 'TcLinkTo' := '.bLimitForwardEnable := TIIB[MFX-SPEC2-EL1088-E11]^Channel 3^Input;
.bLimitBackwardEnable := TIIB[MFX-SPEC2-EL1088-E11]^Channel 4^Input'}
M32: DUT_MotionStage := (sName := 'MFX:SPEC:C6:TILT');
// #######################################################################################
{attribute 'pytmc' := 'pv: MFX:SPEC:T1'}
{attribute 'TcLinkTo' := '.bLimitForwardEnable := TIIB[MFX-SPEC2-EL1088-E17]^Channel 1^Input;
.bLimitBackwardEnable := TIIB[MFX-SPEC2-EL1088-E17]^Channel 2^Input;
.bBrakeRelease := TIIB[MFX-SPEC2-EL2004-E18]^Channel 1^Output'}
M33: DUT_MotionStage := (sName := 'MFX:SPEC:T1');
{attribute 'pytmc' := 'pv: MFX:SPEC:T2'}
{attribute 'TcLinkTo' := '.bLimitForwardEnable := TIIB[MFX-SPEC2-EL1088-E17]^Channel 3^Input;
.bLimitBackwardEnable := TIIB[MFX-SPEC2-EL1088-E17]^Channel 4^Input;
.bBrakeRelease := TIIB[MFX-SPEC2-EL2004-E18]^Channel 2^Output'}
M34: DUT_MotionStage := (sName := 'MFX:SPEC:T2');
{attribute 'pytmc' := 'pv: MFX:SPEC:T3'}
{attribute 'TcLinkTo' := '.bLimitForwardEnable := TIIB[MFX-SPEC2-EL1088-E17]^Channel 5^Input;
.bLimitBackwardEnable := TIIB[MFX-SPEC2-EL1088-E17]^Channel 6^Input;
.bBrakeRelease := TIIB[MFX-SPEC2-EL2004-E18]^Channel 3^Output'}
M35: DUT_MotionStage := (sName := 'MFX:SPEC:T3');
{attribute 'pytmc' := 'pv: MFX:SPEC:ROT'}
{attribute 'TcLinkTo' := '.bLimitForwardEnable := TIIB[MFX-SPEC2-EL1088-E17]^Channel 7^Input;
.bLimitBackwardEnable := TIIB[MFX-SPEC2-EL1088-E17]^Channel 8^Input'}
M36: DUT_MotionStage := (sName := 'MFX:SPEC:ROT');
END_VAR
PMPS
VAR_GLOBAL
// Arbiter linked to the FFO and the MPS
// {attribute 'pytmc' := 'pv: PLC:TMO:MOTION:ARB'}
fbArbiter: FB_Arbiter(1);
// Fast fault for before ST4K4 (Most Devices)
// {attribute 'pytmc' := 'pv: PLC:TMO:MOTION:FFO:01'}
// {attribute 'TcLinkTo' := '.q_xFastFaultOut:=TIIB[PMPS_FFO]^Channel 1^Output'}
fbFastFaultOutput1: FB_HardwareFFOutput := (bAutoReset := TRUE, i_sNetID:='172.21.92.73.1.1');
// Fast fault for after ST4K4 (Basically just DREAM)
// {attribute 'pytmc' := 'pv: PLC:TMO:MOTION:FFO:02'}
// {attribute 'TcLinkTo' := '.q_xFastFaultOut:=TIIB[PMPS_FFO]^Channel 2^Output'}
// fbFastFaultOutput2: FB_HardwareFFOutput := (bAutoReset := TRUE, i_sNetID:='172.21.92.73.1.1');
END_VAR
POUs
FB_ATM_MFX
FUNCTION_BLOCK FB_ATM_MFX
VAR_IN_OUT // pass by reference, not value
stYStage: DUT_MotionStage;
stXStage: DUT_MotionStage;
fbArbiter: FB_Arbiter;
fbFFHWO: FB_HardwareFFOutput;
END_VAR
VAR_INPUT
stOut: DUT_PositionState;
stTarget1: DUT_PositionState;
stTarget2: DUT_PositionState;
stTarget3: DUT_PositionState;
stTarget4: DUT_PositionState;
stTarget5: DUT_PositionState;
nTransitionAssertionID: UDINT;
nUnknownAssertionID: UDINT;
END_VAR
VAR
fbYStage: FB_MotionStage;
fbXStage: FB_MotionStage;
{attribute 'pytmc' := '
pv: MMS:STATE
io: i
arrStates.array: 1..6
'}
fbStates: FB_MFX_ATM_States;
{attribute 'pytmc' := '
pv: STC:01
io: input
'}
fbThermoCouple1: FB_TempSensor;
// Only do some of the puts on init
bInit: BOOL := FALSE;
END_VAR
fbYStage(stMotionStage:=stYStage);
IF NOT bInit THEN // Easier to debug if you can write to these
stYStage.bHardwareEnable := TRUE;
stYStage.bPowerSelf := TRUE; // Changed from standard because no PMPS
stYStage.nEnableMode := ENUM_StageEnableMode.DURING_MOTION;
//stYStage.nEnableMode := ENUM_StageEnableMode.NEVER;
END_IF
fbXStage(stMotionStage:=stXStage);
IF NOT bInit THEN // Easier to debug if you can write to these
stXStage.bLimitForwardEnable := TRUE;
stXStage.bLimitBackwardEnable := TRUE;
stXStage.bHardwareEnable := TRUE;
stXStage.bPowerSelf := TRUE;
stXStage.nEnableMode := ENUM_StageEnableMode.DURING_MOTION;
//stXStage.nEnableMode := ENUM_StageEnableMode.NEVER;
END_IF
fbStates(
// fbArbiter:=fbArbiter,
// fbFFHWO:=fbFFHWO,
// nTransitionAssertionID:=nTransitionAssertionID,
// nUnknownAssertionID:=nUnknownAssertionID,
stMotionStage:=stYStage,
bEnable := TRUE,
stOut:=stOut,
stTarget1:=stTarget1,
stTarget2:=stTarget2,
stTarget3:=stTarget3,
stTarget4:=stTarget4,
stTarget5:=stTarget5);
fbThermoCouple1();
IF NOT bInit THEN
bInit := TRUE;
END_IF
END_FUNCTION_BLOCK
- Related:
FB_MFX_ATM_States
FUNCTION_BLOCK FB_MFX_ATM_States EXTENDS FB_PositionStateBase
VAR_INPUT
{attribute 'pytmc' := '
pv: SET
io: io
'}
enumSet: ENUM_ATM_states;
stOut: DUT_PositionState;
stTarget1: DUT_PositionState;
stTarget2: DUT_PositionState;
stTarget3: DUT_PositionState;
stTarget4: DUT_PositionState;
stTarget5: DUT_PositionState;
bStatesLock: BOOL;
END_VAR
VAR_OUTPUT
{attribute 'pytmc' := '
pv: GET
io: i
'}
enumGet: ENUM_ATM_States;
END_VAR
VAR
bATMInit: BOOL;
END_VAR
VAR CONSTANT
fInDelta: LREAL := 2;
fOutDelta: LREAL := 2;
fInVelocity: LREAL := 5;
fOutVelocity: LREAL := 5;
fAccel: LREAL := 200;
fOutDecel: LREAL := 25;
END_VAR
IF NOT bATMInit THEN
bATMInit := TRUE;
stOut.sName := 'OUT';
stOut.fVelocity := fOutVelocity;
stOut.fDelta := fOutDelta;
stOut.fAccel := fAccel;
stOut.fDecel := fOutDecel;
stOut.bMoveOk := TRUE;
stTarget1.sName := 'TARGET1';
stTarget1.fVelocity := fInVelocity;
stTarget1.fDelta := fInDelta;
stTarget1.fAccel := fAccel;
stTarget1.fDecel := fAccel;
stTarget1.bMoveOk := TRUE;
stTarget2.sName := 'TARGET2';
stTarget2.fVelocity := fInVelocity;
stTarget2.fDelta := fInDelta;
stTarget2.fAccel := fAccel;
stTarget2.fDecel := fAccel;
stTarget2.bMoveOk := TRUE;
stTarget3.sName := 'TARGET3';
stTarget3.fVelocity := fInVelocity;
stTarget3.fDelta := fInDelta;
stTarget3.fAccel := fAccel;
stTarget3.fDecel := fAccel;
stTarget3.bMoveOk := TRUE;
stTarget4.sName := 'TARGET4';
stTarget4.fVelocity := fInVelocity;
stTarget4.fDelta := fInDelta;
stTarget4.fAccel := fAccel;
stTarget4.fDecel := fAccel;
stTarget4.bMoveOk := TRUE;
stTarget5.sName := 'TARGET5';
stTarget5.fVelocity := fInVelocity;
stTarget5.fDelta := fInDelta;
stTarget5.fAccel := fAccel;
stTarget5.fDecel := fAccel;
stTarget5.bMoveOk := TRUE;
arrStates[1] := stOut;
arrStates[2] := stTarget1;
arrStates[3] := stTarget2;
arrStates[4] := stTarget3;
arrStates[5] := stTarget4;
arrStates[6] := stTarget5;
END_IF
setState := enumSet;
Exec();
enumGet := getState;
enumSet := setState;
END_FUNCTION_BLOCK
PRG_1_PlcTask
PROGRAM PRG_1_PlcTask
VAR
END_VAR
PRG_LIB();
PRG_ATM();
PRG_LJ();
PRG_SPEC();
PRG_4_LOG();
END_PROGRAM
PRG_4_LOG
PROGRAM PRG_4_LOG
VAR
fbLogHandler: FB_LogHandler;
END_VAR
fbLogHandler();
END_PROGRAM
PRG_ATM
PROGRAM PRG_ATM
VAR
{attribute 'pytmc' := '
pv: MFX:ATM
io: io
'}
{attribute 'TcLinkTo' := '.fbThermoCouple1.bError := TIIB[MFX-ATM-EL3314-E5]^TC Inputs Channel 1^Status^Error;
.fbThermoCouple1.bUnderrange := TIIB[MFX-ATM-EL3314-E5]^TC Inputs Channel 1^Status^Underrange;
.fbThermoCouple1.bOverrange := TIIB[MFX-ATM-EL3314-E5]^TC Inputs Channel 1^Status^Overrange;
.fbThermoCouple1.iRaw := TIIB[MFX-ATM-EL3314-E5]^TC Inputs Channel 1^Value'}
fbATM: FB_ATM_MFX;
{attribute 'TcLinkTo' := 'TIIB[MFX-ATM-EL2004-E4]^Channel 1^Output'}
bBrakeRelease AT%Q*: bool;
fbBrakeDelayTimer: TON;
END_VAR
fbATM.nTransitionAssertionID := 16#5140;
fbATM.nUnknownAssertionID := 16#5149;
fbATM.stOut.fPosition := -15;
fbATM.stOut.bUseRawCounts := FALSE;
fbATM.stOut.nRequestAssertionID := 16#5141;
fbATM.stOut.stBeamParams := PMPS_GVL.cstFullBeam;
fbATM.stOut.bValid := TRUE;
fbATM.stTarget1.fPosition := -39.124;
fbATM.stTarget1.bUseRawCounts := FALSE;
fbATM.stTarget1.nRequestAssertionID := 16#5142;
fbATM.stTarget1.stBeamParams := PMPS_GVL.cstFullBeam;
fbATM.stTarget1.bValid := TRUE;
fbATM.stTarget2.fPosition := -53.5;
fbATM.stTarget2.bUseRawCounts := FALSE;
fbATM.stTarget2.nRequestAssertionID := 16#5143;
fbATM.stTarget2.stBeamParams := PMPS_GVL.cstFullBeam;
fbATM.stTarget2.bValid := TRUE;
fbATM.stTarget3.fPosition := -67.874;
fbATM.stTarget3.bUseRawCounts := FALSE;
fbATM.stTarget3.nRequestAssertionID := 16#5144;
fbATM.stTarget3.stBeamParams := PMPS_GVL.cstFullBeam;
fbATM.stTarget3.bValid := TRUE;
fbATM.stTarget4.fPosition := -82.25;
fbATM.stTarget4.bUseRawCounts := FALSE;
fbATM.stTarget4.nRequestAssertionID := 16#5145;
fbATM.stTarget4.stBeamParams := PMPS_GVL.cstFullBeam;
fbATM.stTarget4.bValid := TRUE;
fbATM.stTarget5.fPosition := -96.623;
fbATM.stTarget5.bUseRawCounts := FALSE;
fbATM.stTarget5.nRequestAssertionID := 16#5146;
fbATM.stTarget5.stBeamParams := PMPS_GVL.cstFullBeam;
fbATM.stTarget5.bValid := TRUE;
fbATM(
fbArbiter := fbArbiter,
fbFFHWO := fbFastFaultOutput1,
stYStage := Main.M1,
stXStage := Main.M2);
// Add custom delay to the brakeRelease
fbBrakeDelayTimer(
IN := main.M1.bBrakeRelease,
PT := T#50ms);
bBrakeRelease := fbBrakeDelayTimer.Q;
END_PROGRAM
- Related:
PRG_LIB
PROGRAM PRG_LIB
VAR
fbLIB_1: FB_MotionStage;
fbLIB_2: FB_MotionStage;
fbLIB_3: FB_MotionStage;
fbLIB_4: FB_MotionStage;
// Only do some of the puts on init
bInit: BOOL := FALSE;
END_VAR
fbLIB_1(stMotionStage:=Main.M3);
fbLIB_2(stMotionStage:=Main.M4);
fbLIB_3(stMotionStage:=Main.M5);
fbLIB_4(stMotionStage:=Main.M6);
IF NOT bInit THEN // Easier to debug if you can write to these
Main.M3.bHardwareEnable := TRUE;
Main.M3.bPowerSelf := TRUE;
Main.M3.nEnableMode := ENUM_StageEnableMode.DURING_MOTION;
// Main.M3.nHomingMode := ENUM_EpicsHomeCmd.LOW_LIMIT;
// Main.M3.nEnableMode := ENUM_StageEnableMode.ALWAYS;
Main.M4.bHardwareEnable := TRUE;
Main.M4.bPowerSelf := TRUE;
Main.M4.nEnableMode := ENUM_StageEnableMode.DURING_MOTION;
// Main.M4.nHomingMode := ENUM_EpicsHomeCmd.LOW_LIMIT;
// Main.M4.nEnableMode := ENUM_StageEnableMode.ALWAYS;
Main.M5.bHardwareEnable := TRUE;
Main.M5.bPowerSelf := TRUE;
Main.M5.nEnableMode := ENUM_StageEnableMode.DURING_MOTION;
// Main.M5.nHomingMode := ENUM_EpicsHomeCmd.LOW_LIMIT;
// Main.M5.nEnableMode := ENUM_StageEnableMode.ALWAYS;
Main.M6.bHardwareEnable := TRUE;
Main.M6.bPowerSelf := TRUE;
Main.M6.nEnableMode := ENUM_StageEnableMode.DURING_MOTION;
// Main.M6.nHomingMode := ENUM_EpicsHomeCmd.LOW_LIMIT;
// Main.M6.nEnableMode := ENUM_StageEnableMode.ALWAYS;
bInit := True;
END_IF
END_PROGRAM
- Related:
PRG_LJ
PROGRAM PRG_LJ
VAR
fbLJ_1: FB_MotionStage;
fbLJ_2: FB_MotionStage;
fbLJ_3: FB_MotionStage;
fbLJ_4: FB_MotionStage;
fbLJ_5: FB_MotionStage;
fbLJ_6: FB_MotionStage;
fbLJ_7: FB_MotionStage;
fbLJ_8: FB_MotionStage;
// Only do some of the puts on init
bInit: BOOL := FALSE;
END_VAR
fbLJ_1(stMotionStage:=Main.M7);
fbLJ_2(stMotionStage:=Main.M8);
fbLJ_3(stMotionStage:=Main.M9);
fbLJ_4(stMotionStage:=Main.M10);
fbLJ_5(stMotionStage:=Main.M11);
fbLJ_6(stMotionStage:=Main.M12);
fbLJ_7(stMotionStage:=Main.M13);
fbLJ_8(stMotionStage:=Main.M14);
IF NOT bInit THEN // Easier to debug if you can write to these
Main.M7.bHardwareEnable := TRUE;
Main.M7.bPowerSelf := TRUE;
Main.M7.nEnableMode := ENUM_StageEnableMode.DURING_MOTION;
// Main.M7.nHomingMode := ENUM_EpicsHomeCmd.LOW_LIMIT;
// Main.M7.nEnableMode := ENUM_StageEnableMode.ALWAYS;
Main.M8.bHardwareEnable := TRUE;
Main.M8.bPowerSelf := TRUE;
Main.M8.nEnableMode := ENUM_StageEnableMode.DURING_MOTION;
// Main.M8.nHomingMode := ENUM_EpicsHomeCmd.LOW_LIMIT;
// Main.M8.nEnableMode := ENUM_StageEnableMode.ALWAYS;
Main.M9.bHardwareEnable := TRUE;
Main.M9.bPowerSelf := TRUE;
Main.M9.nEnableMode := ENUM_StageEnableMode.DURING_MOTION;
// Main.M9.nHomingMode := ENUM_EpicsHomeCmd.LOW_LIMIT;
// Main.M9.nEnableMode := ENUM_StageEnableMode.ALWAYS;
Main.M10.bHardwareEnable := TRUE;
Main.M10.bPowerSelf := TRUE;
Main.M10.nEnableMode := ENUM_StageEnableMode.DURING_MOTION;
// Main.M10.nHomingMode := ENUM_EpicsHomeCmd.LOW_LIMIT;
// Main.M10.nEnableMode := ENUM_StageEnableMode.ALWAYS;
Main.M11.bHardwareEnable := TRUE;
Main.M11.bPowerSelf := TRUE;
Main.M11.nEnableMode := ENUM_StageEnableMode.DURING_MOTION;
// Main.M11.nHomingMode := ENUM_EpicsHomeCmd.LOW_LIMIT;
// Main.M11.nEnableMode := ENUM_StageEnableMode.ALWAYS;
Main.M12.bHardwareEnable := TRUE;
Main.M12.bPowerSelf := TRUE;
Main.M12.nEnableMode := ENUM_StageEnableMode.DURING_MOTION;
// Main.M12.nHomingMode := ENUM_EpicsHomeCmd.LOW_LIMIT;
// Main.M12.nEnableMode := ENUM_StageEnableMode.ALWAYS;
Main.M13.bHardwareEnable := TRUE;
Main.M13.bPowerSelf := TRUE;
Main.M13.nEnableMode := ENUM_StageEnableMode.DURING_MOTION;
// Main.M13.nHomingMode := ENUM_EpicsHomeCmd.LOW_LIMIT;
// Main.M13.nEnableMode := ENUM_StageEnableMode.ALWAYS;
Main.M14.bHardwareEnable := TRUE;
Main.M14.bPowerSelf := TRUE;
Main.M14.nEnableMode := ENUM_StageEnableMode.DURING_MOTION;
// Main.M14.nHomingMode := ENUM_EpicsHomeCmd.LOW_LIMIT;
// Main.M14.nEnableMode := ENUM_StageEnableMode.ALWAYS;
bInit := True;
END_IF
END_PROGRAM
- Related:
PRG_SPEC
PROGRAM PRG_SPEC
VAR
fbSPEC_C1_X: FB_MotionStage;
fbSPEC_C1_ROT: FB_MotionStage;
fbSPEC_C1_TILT: FB_MotionStage;
fbSPEC_C2_X: FB_MotionStage;
fbSPEC_C2_ROT: FB_MotionStage;
fbSPEC_C2_TILT: FB_MotionStage;
fbSPEC_C3_X: FB_MotionStage;
fbSPEC_C3_ROT: FB_MotionStage;
fbSPEC_C3_TILT: FB_MotionStage;
fbSPEC_C4_X: FB_MotionStage;
fbSPEC_C4_ROT: FB_MotionStage;
fbSPEC_C4_TILT: FB_MotionStage;
fbSPEC_C5_X: FB_MotionStage;
fbSPEC_C5_ROT: FB_MotionStage;
fbSPEC_C5_TILT: FB_MotionStage;
fbSPEC_C6_X: FB_MotionStage;
fbSPEC_C6_ROT: FB_MotionStage;
fbSPEC_C6_TILT: FB_MotionStage;
fbSPEC_T1: FB_MotionStage;
fbSPEC_T2: FB_MotionStage;
fbSPEC_T3: FB_MotionStage;
fbSPEC_ROT: FB_MotionStage;
// Only do some of the puts on init
bInit: BOOL := FALSE;
END_VAR
fbSPEC_C1_X(stMotionStage:=Main.M15);
fbSPEC_C1_ROT(stMotionStage:=Main.M16);
fbSPEC_C1_TILT(stMotionStage:=Main.M17);
fbSPEC_C2_X(stMotionStage:=Main.M18);
fbSPEC_C2_ROT(stMotionStage:=Main.M19);
fbSPEC_C2_TILT(stMotionStage:=Main.M20);
fbSPEC_C3_X(stMotionStage:=Main.M21);
fbSPEC_C3_ROT(stMotionStage:=Main.M22);
fbSPEC_C3_TILT(stMotionStage:=Main.M23);
fbSPEC_C4_X(stMotionStage:=Main.M24);
fbSPEC_C4_ROT(stMotionStage:=Main.M25);
fbSPEC_C4_TILT(stMotionStage:=Main.M26);
fbSPEC_C5_X(stMotionStage:=Main.M27);
fbSPEC_C5_ROT(stMotionStage:=Main.M28);
fbSPEC_C5_TILT(stMotionStage:=Main.M29);
fbSPEC_C6_X(stMotionStage:=Main.M30);
fbSPEC_C6_ROT(stMotionStage:=Main.M31);
fbSPEC_C6_TILT(stMotionStage:=Main.M32);
fbSPEC_T1(stMotionStage:=Main.M33);
fbSPEC_T2(stMotionStage:=Main.M34);
fbSPEC_T3(stMotionStage:=Main.M35);
fbSPEC_ROT(stMotionStage:=Main.M36);
IF NOT bInit THEN // Easier to debug if you can write to these
Main.M15.bHardwareEnable := TRUE;
Main.M15.bPowerSelf := TRUE;
Main.M15.nEnableMode := ENUM_StageEnableMode.DURING_MOTION;
// Main.M15.nHomingMode := ENUM_EpicsHomeCmd.LOW_LIMIT;
// Main.M15.nEnableMode := ENUM_StageEnableMode.ALWAYS;
Main.M16.bHardwareEnable := TRUE;
Main.M16.bPowerSelf := TRUE;
Main.M16.nEnableMode := ENUM_StageEnableMode.DURING_MOTION;
// Main.M16.nHomingMode := ENUM_EpicsHomeCmd.LOW_LIMIT;
// Main.M16.nEnableMode := ENUM_StageEnableMode.ALWAYS;
Main.M17.bHardwareEnable := TRUE;
Main.M17.bPowerSelf := TRUE;
Main.M17.nEnableMode := ENUM_StageEnableMode.DURING_MOTION;
// Main.M17.nHomingMode := ENUM_EpicsHomeCmd.LOW_LIMIT;
// Main.M17.nEnableMode := ENUM_StageEnableMode.ALWAYS;
Main.M18.bHardwareEnable := TRUE;
Main.M18.bPowerSelf := TRUE;
Main.M18.nEnableMode := ENUM_StageEnableMode.DURING_MOTION;
// Main.M18.nHomingMode := ENUM_EpicsHomeCmd.LOW_LIMIT;
// Main.M18.nEnableMode := ENUM_StageEnableMode.ALWAYS;
Main.M19.bHardwareEnable := TRUE;
Main.M19.bPowerSelf := TRUE;
Main.M19.nEnableMode := ENUM_StageEnableMode.DURING_MOTION;
// Main.M19.nHomingMode := ENUM_EpicsHomeCmd.LOW_LIMIT;
// Main.M19.nEnableMode := ENUM_StageEnableMode.ALWAYS;
Main.M20.bHardwareEnable := TRUE;
Main.M20.bPowerSelf := TRUE;
Main.M20.nEnableMode := ENUM_StageEnableMode.DURING_MOTION;
// Main.M20.nHomingMode := ENUM_EpicsHomeCmd.LOW_LIMIT;
// Main.M20.nEnableMode := ENUM_StageEnableMode.ALWAYS;
Main.M21.bHardwareEnable := TRUE;
Main.M21.bPowerSelf := TRUE;
Main.M21.nEnableMode := ENUM_StageEnableMode.DURING_MOTION;
// Main.M21.nHomingMode := ENUM_EpicsHomeCmd.LOW_LIMIT;
// Main.M21.nEnableMode := ENUM_StageEnableMode.ALWAYS;
Main.M22.bHardwareEnable := TRUE;
Main.M22.bPowerSelf := TRUE;
Main.M22.nEnableMode := ENUM_StageEnableMode.DURING_MOTION;
// Main.M22.nHomingMode := ENUM_EpicsHomeCmd.LOW_LIMIT;
// Main.M22.nEnableMode := ENUM_StageEnableMode.ALWAYS;
Main.M23.bHardwareEnable := TRUE;
Main.M23.bPowerSelf := TRUE;
Main.M23.nEnableMode := ENUM_StageEnableMode.DURING_MOTION;
// Main.M23.nHomingMode := ENUM_EpicsHomeCmd.LOW_LIMIT;
// Main.M23.nEnableMode := ENUM_StageEnableMode.ALWAYS;
Main.M24.bHardwareEnable := TRUE;
Main.M24.bPowerSelf := TRUE;
Main.M24.nEnableMode := ENUM_StageEnableMode.DURING_MOTION;
// Main.M24.nHomingMode := ENUM_EpicsHomeCmd.LOW_LIMIT;
// Main.M24.nEnableMode := ENUM_StageEnableMode.ALWAYS;
Main.M25.bHardwareEnable := TRUE;
Main.M25.bPowerSelf := TRUE;
Main.M25.nEnableMode := ENUM_StageEnableMode.DURING_MOTION;
// Main.M25.nHomingMode := ENUM_EpicsHomeCmd.LOW_LIMIT;
// Main.M25.nEnableMode := ENUM_StageEnableMode.ALWAYS;
Main.M26.bHardwareEnable := TRUE;
Main.M26.bPowerSelf := TRUE;
Main.M26.nEnableMode := ENUM_StageEnableMode.DURING_MOTION;
// Main.M26.nHomingMode := ENUM_EpicsHomeCmd.LOW_LIMIT;
// Main.M26.nEnableMode := ENUM_StageEnableMode.ALWAYS;
Main.M27.bHardwareEnable := TRUE;
Main.M27.bPowerSelf := TRUE;
Main.M27.nEnableMode := ENUM_StageEnableMode.DURING_MOTION;
// Main.M27.nHomingMode := ENUM_EpicsHomeCmd.LOW_LIMIT;
// Main.M27.nEnableMode := ENUM_StageEnableMode.ALWAYS;
Main.M28.bHardwareEnable := TRUE;
Main.M28.bPowerSelf := TRUE;
Main.M28.nEnableMode := ENUM_StageEnableMode.DURING_MOTION;
// Main.M28.nHomingMode := ENUM_EpicsHomeCmd.LOW_LIMIT;
// Main.M28.nEnableMode := ENUM_StageEnableMode.ALWAYS;
Main.M29.bHardwareEnable := TRUE;
Main.M29.bPowerSelf := TRUE;
Main.M29.nEnableMode := ENUM_StageEnableMode.DURING_MOTION;
// Main.M29.nHomingMode := ENUM_EpicsHomeCmd.LOW_LIMIT;
// Main.M29.nEnableMode := ENUM_StageEnableMode.ALWAYS;
Main.M30.bHardwareEnable := TRUE;
Main.M30.bPowerSelf := TRUE;
Main.M30.nEnableMode := ENUM_StageEnableMode.DURING_MOTION;
// Main.M30.nHomingMode := ENUM_EpicsHomeCmd.LOW_LIMIT;
// Main.M30.nEnableMode := ENUM_StageEnableMode.ALWAYS;
Main.M31.bHardwareEnable := TRUE;
Main.M31.bPowerSelf := TRUE;
Main.M31.nEnableMode := ENUM_StageEnableMode.DURING_MOTION;
// Main.M31.nHomingMode := ENUM_EpicsHomeCmd.LOW_LIMIT;
// Main.M31.nEnableMode := ENUM_StageEnableMode.ALWAYS;
Main.M32.bHardwareEnable := TRUE;
Main.M32.bPowerSelf := TRUE;
Main.M32.nEnableMode := ENUM_StageEnableMode.DURING_MOTION;
// Main.M32.nHomingMode := ENUM_EpicsHomeCmd.LOW_LIMIT;
// Main.M32.nEnableMode := ENUM_StageEnableMode.ALWAYS;
Main.M33.bHardwareEnable := TRUE;
Main.M33.bPowerSelf := TRUE;
Main.M33.nEnableMode := ENUM_StageEnableMode.DURING_MOTION;
// Main.M33.nHomingMode := ENUM_EpicsHomeCmd.LOW_LIMIT;
// Main.M33.nEnableMode := ENUM_StageEnableMode.ALWAYS;
Main.M34.bHardwareEnable := TRUE;
Main.M34.bPowerSelf := TRUE;
Main.M34.nEnableMode := ENUM_StageEnableMode.DURING_MOTION;
// Main.M34.nHomingMode := ENUM_EpicsHomeCmd.LOW_LIMIT;
// Main.M34.nEnableMode := ENUM_StageEnableMode.ALWAYS;
Main.M35.bHardwareEnable := TRUE;
Main.M35.bPowerSelf := TRUE;
Main.M35.nEnableMode := ENUM_StageEnableMode.DURING_MOTION;
// Main.M35.nHomingMode := ENUM_EpicsHomeCmd.LOW_LIMIT;
// Main.M35.nEnableMode := ENUM_StageEnableMode.ALWAYS;
Main.M36.bHardwareEnable := TRUE;
Main.M36.bPowerSelf := TRUE;
Main.M36.nEnableMode := ENUM_StageEnableMode.DURING_MOTION;
// Main.M36.nHomingMode := ENUM_EpicsHomeCmd.LOW_LIMIT;
// Main.M36.nEnableMode := ENUM_StageEnableMode.ALWAYS;
bInit := True;
END_IF
END_PROGRAM
- Related: