Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tm1k2 target 7 and 8 #77

Merged
merged 5 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .vs/VSWorkspaceState.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"ExpandedNodes": [
""
],
"PreviewInSolutionExplorer": false
}
Binary file added .vs/slnx.sqlite
Binary file not shown.
114 changes: 57 additions & 57 deletions plc-kfe-rix-motion/_Config/PLC/kfe_rix_motion.xti
Original file line number Diff line number Diff line change
Expand Up @@ -1269,124 +1269,124 @@ External Setpoint Generation:
</DataType>
</DataTypes>
<Project GUID="{C31F67CF-3F03-4F49-935F-2494FCDDA958}" Name="kfe_rix_motion" PrjFilePath="..\..\kfe_rix_motion\kfe_rix_motion.plcproj" TmcFilePath="..\..\kfe_rix_motion\kfe_rix_motion.tmc" ReloadTmc="true" AmsPort="851" FileArchiveSettings="#x000e" SymbolicMapping="true">
<Instance Id="#x08502000" TcSmClass="TComPlcObjDef" KeepUnrestoredLinks="2" TmcPath="kfe_rix_motion\kfe_rix_motion.tmc" TmcHash="{5E131CCC-A3A0-E958-9625-CC2213B587CD}">
<Instance Id="#x08502000" TcSmClass="TComPlcObjDef" KeepUnrestoredLinks="2" TmcPath="kfe_rix_motion\kfe_rix_motion.tmc" TmcHash="{2EA11D80-50F9-3A21-1A3E-9DFFE58C6262}">
<Name>kfe_rix_motion Instance</Name>
<CLSID ClassFactory="TcPlc30">{08500001-0000-0000-F000-000000000064}</CLSID>
<Vars VarGrpType="1">
<Name>PlcTask Inputs</Name>
<Var>
<Name>PRG_AL1K2_L2SI.fbAL1K2.fbYStage.fbDriveVirtual.MasterAxis.NcToPlc</Name>
<Name>PRG_TM1K2_ATM.fbTM1K2.fbYStage.fbDriveVirtual.MasterAxis.NcToPlc</Name>
<Type GUID="{25521FAA-EA5F-4C7F-8864-BBCCDACD2E98}" Namespace="MC">NCTOPLC_AXIS_REF</Type>
</Var>
<Var>
<Name>PRG_AL1K2_L2SI.fbAL1K2.fbStates.astMotionStageMax[1].Axis.NcToPlc</Name>
<Name>PRG_TM1K2_ATM.fbTM1K2.fbXStage.fbDriveVirtual.MasterAxis.NcToPlc</Name>
<Type GUID="{25521FAA-EA5F-4C7F-8864-BBCCDACD2E98}" Namespace="MC">NCTOPLC_AXIS_REF</Type>
</Var>
<Var>
<Name>PRG_AL1K2_L2SI.fbAL1K2.fbStates.astMotionStageMax[1].bLimitForwardEnable</Name>
<Name>PRG_TM1K2_ATM.fbTM1K2.fbStates.astMotionStageMax[1].Axis.NcToPlc</Name>
<Type GUID="{25521FAA-EA5F-4C7F-8864-BBCCDACD2E98}" Namespace="MC">NCTOPLC_AXIS_REF</Type>
</Var>
<Var>
<Name>PRG_TM1K2_ATM.fbTM1K2.fbStates.astMotionStageMax[1].bLimitForwardEnable</Name>
<Comment><![CDATA[ NC Forward Limit Switch: TRUE if ok to move]]></Comment>
<Type>BOOL</Type>
</Var>
<Var>
<Name>PRG_AL1K2_L2SI.fbAL1K2.fbStates.astMotionStageMax[1].bLimitBackwardEnable</Name>
<Name>PRG_TM1K2_ATM.fbTM1K2.fbStates.astMotionStageMax[1].bLimitBackwardEnable</Name>
<Comment><![CDATA[ NC Backward Limit Switch: TRUE if ok to move]]></Comment>
<Type>BOOL</Type>
</Var>
<Var>
<Name>PRG_AL1K2_L2SI.fbAL1K2.fbStates.astMotionStageMax[1].bHome</Name>
<Name>PRG_TM1K2_ATM.fbTM1K2.fbStates.astMotionStageMax[1].bHome</Name>
<Comment><![CDATA[ NO Home Switch: TRUE if at home]]></Comment>
<Type>BOOL</Type>
</Var>
<Var>
<Name>PRG_AL1K2_L2SI.fbAL1K2.fbStates.astMotionStageMax[1].bHardwareEnable</Name>
<Name>PRG_TM1K2_ATM.fbTM1K2.fbStates.astMotionStageMax[1].bHardwareEnable</Name>
<Comment><![CDATA[ NC STO Input: TRUE if ok to move]]></Comment>
<Type>BOOL</Type>
</Var>
<Var>
<Name>PRG_AL1K2_L2SI.fbAL1K2.fbStates.astMotionStageMax[1].nRawEncoderULINT</Name>
<Name>PRG_TM1K2_ATM.fbTM1K2.fbStates.astMotionStageMax[1].nRawEncoderULINT</Name>
<Comment><![CDATA[ Raw encoder IO for ULINT (Biss-C)]]></Comment>
<Type>ULINT</Type>
</Var>
<Var>
<Name>PRG_AL1K2_L2SI.fbAL1K2.fbStates.astMotionStageMax[1].nRawEncoderUINT</Name>
<Name>PRG_TM1K2_ATM.fbTM1K2.fbStates.astMotionStageMax[1].nRawEncoderUINT</Name>
<Comment><![CDATA[ Raw encoder IO for UINT (Relative Encoders)]]></Comment>
<Type>UINT</Type>
</Var>
<Var>
<Name>PRG_AL1K2_L2SI.fbAL1K2.fbStates.astMotionStageMax[1].nRawEncoderINT</Name>
<Name>PRG_TM1K2_ATM.fbTM1K2.fbStates.astMotionStageMax[1].nRawEncoderINT</Name>
<Comment><![CDATA[ Raw encoder IO for INT (LVDT)]]></Comment>
<Type>INT</Type>
</Var>
<Var>
<Name>PRG_AL1K2_L2SI.fbAL1K2.fbLaser.fbGetLasPercent.iRaw</Name>
<Comment><![CDATA[ Connect this input to the terminal]]></Comment>
<Name>PRG_TM1K2_ATM.fbTM1K2.fbThermoCouple1.bError</Name>
<Type>BOOL</Type>
</Var>
<Var>
<Name>PRG_TM1K2_ATM.fbTM1K2.fbThermoCouple1.bUnderrange</Name>
<Type>BOOL</Type>
</Var>
<Var>
<Name>PRG_TM1K2_ATM.fbTM1K2.fbThermoCouple1.bOverrange</Name>
<Type>BOOL</Type>
</Var>
<Var>
<Name>PRG_TM1K2_ATM.fbTM1K2.fbThermoCouple1.iRaw</Name>
<Type>INT</Type>
</Var>
<Var>
<Name>PRG_TM1K2_ATM.fbTM1K2.fbYStage.fbDriveVirtual.MasterAxis.NcToPlc</Name>
<Type GUID="{25521FAA-EA5F-4C7F-8864-BBCCDACD2E98}" Namespace="MC">NCTOPLC_AXIS_REF</Type>
<Name>PRG_TM1K2_ATM.fbTM1K2.fbFlowMeter.iRaw</Name>
<Comment><![CDATA[ Connect this input to the terminal]]></Comment>
<Type>INT</Type>
</Var>
<Var>
<Name>PRG_TM1K2_ATM.fbTM1K2.fbXStage.fbDriveVirtual.MasterAxis.NcToPlc</Name>
<Name>PRG_AL1K2_L2SI.fbAL1K2.fbYStage.fbDriveVirtual.MasterAxis.NcToPlc</Name>
<Type GUID="{25521FAA-EA5F-4C7F-8864-BBCCDACD2E98}" Namespace="MC">NCTOPLC_AXIS_REF</Type>
</Var>
<Var>
<Name>PRG_TM1K2_ATM.fbTM1K2.fbStates.astMotionStageMax[1].Axis.NcToPlc</Name>
<Name>PRG_AL1K2_L2SI.fbAL1K2.fbStates.astMotionStageMax[1].Axis.NcToPlc</Name>
<Type GUID="{25521FAA-EA5F-4C7F-8864-BBCCDACD2E98}" Namespace="MC">NCTOPLC_AXIS_REF</Type>
</Var>
<Var>
<Name>PRG_TM1K2_ATM.fbTM1K2.fbStates.astMotionStageMax[1].bLimitForwardEnable</Name>
<Name>PRG_AL1K2_L2SI.fbAL1K2.fbStates.astMotionStageMax[1].bLimitForwardEnable</Name>
<Comment><![CDATA[ NC Forward Limit Switch: TRUE if ok to move]]></Comment>
<Type>BOOL</Type>
</Var>
<Var>
<Name>PRG_TM1K2_ATM.fbTM1K2.fbStates.astMotionStageMax[1].bLimitBackwardEnable</Name>
<Name>PRG_AL1K2_L2SI.fbAL1K2.fbStates.astMotionStageMax[1].bLimitBackwardEnable</Name>
<Comment><![CDATA[ NC Backward Limit Switch: TRUE if ok to move]]></Comment>
<Type>BOOL</Type>
</Var>
<Var>
<Name>PRG_TM1K2_ATM.fbTM1K2.fbStates.astMotionStageMax[1].bHome</Name>
<Name>PRG_AL1K2_L2SI.fbAL1K2.fbStates.astMotionStageMax[1].bHome</Name>
<Comment><![CDATA[ NO Home Switch: TRUE if at home]]></Comment>
<Type>BOOL</Type>
</Var>
<Var>
<Name>PRG_TM1K2_ATM.fbTM1K2.fbStates.astMotionStageMax[1].bHardwareEnable</Name>
<Name>PRG_AL1K2_L2SI.fbAL1K2.fbStates.astMotionStageMax[1].bHardwareEnable</Name>
<Comment><![CDATA[ NC STO Input: TRUE if ok to move]]></Comment>
<Type>BOOL</Type>
</Var>
<Var>
<Name>PRG_TM1K2_ATM.fbTM1K2.fbStates.astMotionStageMax[1].nRawEncoderULINT</Name>
<Name>PRG_AL1K2_L2SI.fbAL1K2.fbStates.astMotionStageMax[1].nRawEncoderULINT</Name>
<Comment><![CDATA[ Raw encoder IO for ULINT (Biss-C)]]></Comment>
<Type>ULINT</Type>
</Var>
<Var>
<Name>PRG_TM1K2_ATM.fbTM1K2.fbStates.astMotionStageMax[1].nRawEncoderUINT</Name>
<Name>PRG_AL1K2_L2SI.fbAL1K2.fbStates.astMotionStageMax[1].nRawEncoderUINT</Name>
<Comment><![CDATA[ Raw encoder IO for UINT (Relative Encoders)]]></Comment>
<Type>UINT</Type>
</Var>
<Var>
<Name>PRG_TM1K2_ATM.fbTM1K2.fbStates.astMotionStageMax[1].nRawEncoderINT</Name>
<Name>PRG_AL1K2_L2SI.fbAL1K2.fbStates.astMotionStageMax[1].nRawEncoderINT</Name>
<Comment><![CDATA[ Raw encoder IO for INT (LVDT)]]></Comment>
<Type>INT</Type>
</Var>
<Var>
<Name>PRG_TM1K2_ATM.fbTM1K2.fbThermoCouple1.bError</Name>
<Type>BOOL</Type>
</Var>
<Var>
<Name>PRG_TM1K2_ATM.fbTM1K2.fbThermoCouple1.bUnderrange</Name>
<Type>BOOL</Type>
</Var>
<Var>
<Name>PRG_TM1K2_ATM.fbTM1K2.fbThermoCouple1.bOverrange</Name>
<Type>BOOL</Type>
</Var>
<Var>
<Name>PRG_TM1K2_ATM.fbTM1K2.fbThermoCouple1.iRaw</Name>
<Type>INT</Type>
</Var>
<Var>
<Name>PRG_TM1K2_ATM.fbTM1K2.fbFlowMeter.iRaw</Name>
<Name>PRG_AL1K2_L2SI.fbAL1K2.fbLaser.fbGetLasPercent.iRaw</Name>
<Comment><![CDATA[ Connect this input to the terminal]]></Comment>
<Type>INT</Type>
</Var>
Expand Down Expand Up @@ -4505,6 +4505,23 @@ External Setpoint Generation:
</Vars>
<Vars VarGrpType="2" AreaNo="1">
<Name>PlcTask Outputs</Name>
<Var>
<Name>PRG_TM1K2_ATM.fbTM1K2.fbYStage.fbDriveVirtual.MasterAxis.PlcToNc</Name>
<Type GUID="{96B75FEB-2D84-43BE-A3EC-D9A681F27D52}" Namespace="MC">PLCTONC_AXIS_REF</Type>
</Var>
<Var>
<Name>PRG_TM1K2_ATM.fbTM1K2.fbXStage.fbDriveVirtual.MasterAxis.PlcToNc</Name>
<Type GUID="{96B75FEB-2D84-43BE-A3EC-D9A681F27D52}" Namespace="MC">PLCTONC_AXIS_REF</Type>
</Var>
<Var>
<Name>PRG_TM1K2_ATM.fbTM1K2.fbStates.astMotionStageMax[1].Axis.PlcToNc</Name>
<Type GUID="{96B75FEB-2D84-43BE-A3EC-D9A681F27D52}" Namespace="MC">PLCTONC_AXIS_REF</Type>
</Var>
<Var>
<Name>PRG_TM1K2_ATM.fbTM1K2.fbStates.astMotionStageMax[1].bBrakeRelease</Name>
<Comment><![CDATA[ NC Brake Output: TRUE to release brake]]></Comment>
<Type>BOOL</Type>
</Var>
<Var>
<Name>PRG_AL1K2_L2SI.fbAL1K2.fbYStage.fbDriveVirtual.MasterAxis.PlcToNc</Name>
<Type GUID="{96B75FEB-2D84-43BE-A3EC-D9A681F27D52}" Namespace="MC">PLCTONC_AXIS_REF</Type>
Expand All @@ -4531,23 +4548,6 @@ External Setpoint Generation:
<Comment><![CDATA[ Connect this output to the terminal]]></Comment>
<Type>INT</Type>
</Var>
<Var>
<Name>PRG_TM1K2_ATM.fbTM1K2.fbYStage.fbDriveVirtual.MasterAxis.PlcToNc</Name>
<Type GUID="{96B75FEB-2D84-43BE-A3EC-D9A681F27D52}" Namespace="MC">PLCTONC_AXIS_REF</Type>
</Var>
<Var>
<Name>PRG_TM1K2_ATM.fbTM1K2.fbXStage.fbDriveVirtual.MasterAxis.PlcToNc</Name>
<Type GUID="{96B75FEB-2D84-43BE-A3EC-D9A681F27D52}" Namespace="MC">PLCTONC_AXIS_REF</Type>
</Var>
<Var>
<Name>PRG_TM1K2_ATM.fbTM1K2.fbStates.astMotionStageMax[1].Axis.PlcToNc</Name>
<Type GUID="{96B75FEB-2D84-43BE-A3EC-D9A681F27D52}" Namespace="MC">PLCTONC_AXIS_REF</Type>
</Var>
<Var>
<Name>PRG_TM1K2_ATM.fbTM1K2.fbStates.astMotionStageMax[1].bBrakeRelease</Name>
<Comment><![CDATA[ NC Brake Output: TRUE to release brake]]></Comment>
<Type>BOOL</Type>
</Var>
<Var>
<Name>PRG_LI2K2_K2A.fbLI2K2.fbYStage.fbDriveVirtual.MasterAxis.PlcToNc</Name>
<Type GUID="{96B75FEB-2D84-43BE-A3EC-D9A681F27D52}" Namespace="MC">PLCTONC_AXIS_REF</Type>
Expand Down
14 changes: 8 additions & 6 deletions plc-kfe-rix-motion/kfe_rix_motion/POUs/PRG_TM1K2_ATM.TcPOU
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@ END_VAR
fbStateSetup(stPositionState:=stDefault, bSetDefault:=TRUE);

fbStateSetup(stPositionState:=fbTM1K2.stOut, fPosition:=-16.00, fDelta:=7, sPmpsState:='TM1K2:ATM-OUT');
fbStateSetup(stPositionState:=fbTM1K2.stTarget1, fPosition:=-39.124, fDelta:=7, sPmpsState:='TM1K2:ATM-TARGET1');
fbStateSetup(stPositionState:=fbTM1K2.stTarget2, fPosition:=-53.5, fDelta:=7, sPmpsState:='TM1K2:ATM-TARGET2');
fbStateSetup(stPositionState:=fbTM1K2.stTarget3, fPosition:=-67.874, fDelta:=7, sPmpsState:='TM1K2:ATM-TARGET3');
fbStateSetup(stPositionState:=fbTM1K2.stTarget4, fPosition:=-82.25, fDelta:=7, sPmpsState:='TM1K2:ATM-TARGET4');
fbStateSetup(stPositionState:=fbTM1K2.stTarget5, fPosition:=-96.623, fDelta:=7, sPmpsState:='TM1K2:ATM-TARGET5');
fbStateSetup(stPositionState:=fbTM1K2.stTarget6, fPosition:=-114.5, fDelta:=7, sPmpsState:='TM1K2:ATM-TARGET6');
fbStateSetup(stPositionState:=fbTM1K2.stTarget1, fPosition:=-28, fDelta:=7, sPmpsState:='TM1K2:ATM-TARGET1');
fbStateSetup(stPositionState:=fbTM1K2.stTarget2, fPosition:=-38, fDelta:=7, sPmpsState:='TM1K2:ATM-TARGET2');
fbStateSetup(stPositionState:=fbTM1K2.stTarget3, fPosition:=-48, fDelta:=7, sPmpsState:='TM1K2:ATM-TARGET3');
fbStateSetup(stPositionState:=fbTM1K2.stTarget4, fPosition:=-58, fDelta:=7, sPmpsState:='TM1K2:ATM-TARGET4');
fbStateSetup(stPositionState:=fbTM1K2.stTarget5, fPosition:=-68, fDelta:=7, sPmpsState:='TM1K2:ATM-TARGET5');
fbStateSetup(stPositionState:=fbTM1K2.stTarget6, fPosition:=-80, fDelta:=7, sPmpsState:='TM1K2:ATM-TARGET6');
fbStateSetup(stPositionState:=fbTM1K2.stTarget7, fPosition:=-96, fDelta:=7, sPmpsState:='TM1K2:ATM-TARGET7');
fbStateSetup(stPositionState:=fbTM1K2.stTarget8, fPosition:=-114.5, fDelta:=7, sPmpsState:='TM1K2:ATM-TARGET8');

fbTM1K2(
fbFFHWO := GVL.fbFastFaultOutput2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ TYPE E_TM1K2_States :
TARGET3 := 4,
TARGET4 := 5,
TARGET5 := 6,
TARGET6 := 7
TARGET6 := 7,
TARGET7 := 8,
TARGET8 := 9
) UINT;
END_TYPE
]]></Declaration>
Expand Down
12 changes: 12 additions & 0 deletions plc-kfe-rix-motion/kfe_rix_motion/POUs/TM1K2/FB_TM1K2.TcPOU
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
- Add stTarget6 to the inputs
- Change the array pragma from 1..6 to 1..7 (1 out and 6 in states, up from 5 in states)
- Use E_TM1K2_States instead of E_ATM_States

Add array to 1..9
*)
VAR_IN_OUT
// Y motor (state select).
Expand All @@ -38,6 +40,10 @@ VAR_INPUT
stTarget5: ST_PositionState;
// Settings for the TARGET6 state.
stTarget6: ST_PositionState;
// Settings for the TARGET7 state.
stTarget7: ST_PositionState;
// Settings for the TARGET8 state.
stTarget8: ST_PositionState;
// Set this to a non-unknown value to request a new move.
{attribute 'pytmc' := '
pv: MMS:STATE:SET
Expand Down Expand Up @@ -112,6 +118,8 @@ IF NOT bInit THEN
fbStateDefaults(stPositionState:=stTarget4, sNameDefault:='TARGET4', fDeltaDefault:=fDelta, fAccelDefault:=fAccel, fDecelDefault:=fAccel);
fbStateDefaults(stPositionState:=stTarget5, sNameDefault:='TARGET5', fDeltaDefault:=fDelta, fAccelDefault:=fAccel, fDecelDefault:=fAccel);
fbStateDefaults(stPositionState:=stTarget6, sNameDefault:='TARGET6', fDeltaDefault:=fDelta, fAccelDefault:=fAccel, fDecelDefault:=fAccel);
fbStateDefaults(stPositionState:=stTarget7, sNameDefault:='TARGET7', fDeltaDefault:=fDelta, fAccelDefault:=fAccel, fDecelDefault:=fAccel);
fbStateDefaults(stPositionState:=stTarget8, sNameDefault:='TARGET8', fDeltaDefault:=fDelta, fAccelDefault:=fAccel, fDecelDefault:=fAccel);
END_IF

stYStage.bHardwareEnable := TRUE;
Expand Down Expand Up @@ -139,6 +147,8 @@ IF NOT fbArrCheckWrite.bHadWrite THEN
astPositionState[E_TM1K2_States.TARGET4] := stTarget4;
astPositionState[E_TM1K2_States.TARGET5] := stTarget5;
astPositionState[E_TM1K2_States.TARGET6] := stTarget6;
astPositionState[E_TM1K2_States.TARGET7] := stTarget7;
astPositionState[E_TM1K2_States.TARGET8] := stTarget8;
END_IF

fbStates(
Expand Down Expand Up @@ -170,6 +180,8 @@ stTarget3 := astPositionState[E_TM1K2_States.TARGET3];
stTarget4 := astPositionState[E_TM1K2_States.TARGET4];
stTarget5 := astPositionState[E_TM1K2_States.TARGET5];
stTarget6 := astPositionState[E_TM1K2_States.TARGET6];
stTarget7 := astPositionState[E_TM1K2_States.TARGET7];
stTarget8 := astPositionState[E_TM1K2_States.TARGET8];

fbThermoCouple1();
fbFlowMeter();]]></ST>
Expand Down
Loading