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

ENH: add MR1K3 as veto device for TMO #42

Merged
merged 7 commits into from
Jun 28, 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
114 changes: 57 additions & 57 deletions lcls-plc-tmo-optics/_Config/PLC/tmo_optics.xti
Original file line number Diff line number Diff line change
Expand Up @@ -1349,7 +1349,7 @@ External Setpoint Generation:
</DataType>
</DataTypes>
<Project GUID="{7FA5AD82-8B94-448C-8921-86A608467E2A}" Name="tmo_optics" PrjFilePath="..\..\tmo_optics\tmo_optics.plcproj" TmcFilePath="..\..\tmo_optics\tmo_optics.tmc" ReloadTmc="true" AmsPort="851" FileArchiveSettings="#x000e" SymbolicMapping="true">
<Instance Id="#x08502000" TcSmClass="TComPlcObjDef" KeepUnrestoredLinks="2" TmcPath="tmo_optics\tmo_optics.tmc" TmcHash="{D5910105-A41C-5406-F16D-AF54E83F3886}">
<Instance Id="#x08502000" TcSmClass="TComPlcObjDef" KeepUnrestoredLinks="2" TmcPath="tmo_optics\tmo_optics.tmc" TmcHash="{B751D60F-6A36-0A2F-8955-4284BCC779DF}">
<Name>tmo_optics Instance</Name>
<CLSID ClassFactory="TcPlc30">{08500001-0000-0000-F000-000000000064}</CLSID>
<Vars VarGrpType="1">
Expand All @@ -1370,15 +1370,6 @@ External Setpoint Generation:
</Vars>
<Vars VarGrpType="1" ContextId="2" AreaNo="32">
<Name>PlcTask Inputs</Name>
<Var>
<Name>Main.bDreamEnable1</Name>
<Comment><![CDATA[MR4K4 MR5K4 STO button]]></Comment>
<Type>BOOL</Type>
</Var>
<Var>
<Name>Main.bDreamEnable2</Name>
<Type>BOOL</Type>
</Var>
<Var>
<Name>lcls_twincat_optics.GVL_TestStructs.TestPitch_LimitSwitches.diEncCnt</Name>
<Comment><![CDATA[Raw encoder count]]></Comment>
Expand Down Expand Up @@ -1599,26 +1590,6 @@ External Setpoint Generation:
<Name>Main.fbMotionStage_m5.fbDriveVirtual.MasterAxis.NcToPlc</Name>
<Type GUID="{25521FAA-EA5F-4C7F-8864-BBCCDACD2E98}" Namespace="MC">NCTOPLC_AXIS_REF</Type>
</Var>
<Var>
<Name>PRG_MR4K4_KBO.fbCoolingPanel.fbFlow_1.iRaw</Name>
<Comment><![CDATA[ Connect this input to the terminal]]></Comment>
<Type>INT</Type>
</Var>
<Var>
<Name>PRG_MR4K4_KBO.fbCoolingPanel.fbPress_1.iRaw</Name>
<Comment><![CDATA[ Connect this input to the terminal]]></Comment>
<Type>INT</Type>
</Var>
<Var>
<Name>PRG_MR5K4_KBO.fbCoolingPanel.fbFlow_1.iRaw</Name>
<Comment><![CDATA[ Connect this input to the terminal]]></Comment>
<Type>INT</Type>
</Var>
<Var>
<Name>PRG_MR5K4_KBO.fbCoolingPanel.fbPress_1.iRaw</Name>
<Comment><![CDATA[ Connect this input to the terminal]]></Comment>
<Type>INT</Type>
</Var>
<Var>
<Name>Main.M1K4.fbRunHOMS.bSTOEnable1</Name>
<Comment><![CDATA[ STO Button]]></Comment>
Expand Down Expand Up @@ -1665,6 +1636,24 @@ External Setpoint Generation:
<Comment><![CDATA[ Connect to encoder "Position" input]]></Comment>
<Type>ULINT</Type>
</Var>
<Var>
<Name>Main.bDreamEnable1</Name>
<Comment><![CDATA[MR4K4 MR5K4 STO button]]></Comment>
<Type>BOOL</Type>
</Var>
<Var>
<Name>Main.bDreamEnable2</Name>
<Type>BOOL</Type>
</Var>
<Var>
<Name>Main.LAMPbSTOEnable1</Name>
<Comment><![CDATA[Emergency Stop for LAMP KBs (M2K4 and M3K4)]]></Comment>
<Type>BOOL</Type>
</Var>
<Var>
<Name>Main.LAMPbSTOEnable2</Name>
<Type>BOOL</Type>
</Var>
<Var>
<Name>Main.M7.Axis.NcToPlc</Name>
<Type GUID="{25521FAA-EA5F-4C7F-8864-BBCCDACD2E98}" Namespace="MC">NCTOPLC_AXIS_REF</Type>
Expand Down Expand Up @@ -2440,13 +2429,8 @@ External Setpoint Generation:
<Type GUID="{25521FAA-EA5F-4C7F-8864-BBCCDACD2E98}" Namespace="MC">NCTOPLC_AXIS_REF</Type>
</Var>
<Var>
<Name>Main.LAMPbSTOEnable1</Name>
<Comment><![CDATA[Emergency Stop for LAMP KBs (M2K4 and M3K4)]]></Comment>
<Type>BOOL</Type>
</Var>
<Var>
<Name>Main.LAMPbSTOEnable2</Name>
<Type>BOOL</Type>
<Name>Main.fM3K4DS_RTD_3</Name>
<Type>REAL</Type>
</Var>
<Var>
<Name>Main.bM2K4US_RTD_1_Err</Name>
Expand All @@ -2457,10 +2441,6 @@ External Setpoint Generation:
<Name>Main.bM2K4US_RTD_2_Err</Name>
<Type>BOOL</Type>
</Var>
<Var>
<Name>Main.fM3K4DS_RTD_3</Name>
<Type>REAL</Type>
</Var>
<Var>
<Name>Main.bM2K4US_RTD_3_Err</Name>
<Type>BOOL</Type>
Expand Down Expand Up @@ -2529,53 +2509,73 @@ External Setpoint Generation:
<Type>INT</Type>
</Var>
<Var>
<Name>GVL_M2K4_RTD.nM2K4US_RTD_1</Name>
<Comment><![CDATA[ M2K4 BENDER RTDs
M2K4 US RTDs]]></Comment>
<Name>PRG_MR2K4_KBO.fbCoolingPanel.fbFlow_1.iRaw</Name>
<Comment><![CDATA[ Connect this input to the terminal]]></Comment>
<Type>INT</Type>
</Var>
<Var>
<Name>GVL_M2K4_RTD.nM2K4US_RTD_2</Name>
<Name>PRG_MR2K4_KBO.fbCoolingPanel.fbPress_1.iRaw</Name>
<Comment><![CDATA[ Connect this input to the terminal]]></Comment>
<Type>INT</Type>
</Var>
<Var>
<Name>GVL_M2K4_RTD.nM2K4US_RTD_3</Name>
<Name>PRG_MR3K4_KBO.fbCoolingPanel.fbFlow_1.iRaw</Name>
<Comment><![CDATA[ Connect this input to the terminal]]></Comment>
<Type>INT</Type>
</Var>
<Var>
<Name>PRG_MR2K4_KBO.fbCoolingPanel.fbFlow_1.iRaw</Name>
<Name>PRG_MR3K4_KBO.fbCoolingPanel.fbPress_1.iRaw</Name>
<Comment><![CDATA[ Connect this input to the terminal]]></Comment>
<Type>INT</Type>
</Var>
<Var>
<Name>PRG_MR2K4_KBO.fbCoolingPanel.fbPress_1.iRaw</Name>
<Name>PRG_MR4K4_KBO.fbCoolingPanel.fbFlow_1.iRaw</Name>
<Comment><![CDATA[ Connect this input to the terminal]]></Comment>
<Type>INT</Type>
</Var>
<Var>
<Name>PRG_MR3K4_KBO.fbCoolingPanel.fbFlow_1.iRaw</Name>
<Name>PRG_MR4K4_KBO.fbCoolingPanel.fbPress_1.iRaw</Name>
<Comment><![CDATA[ Connect this input to the terminal]]></Comment>
<Type>INT</Type>
</Var>
<Var>
<Name>PRG_MR3K4_KBO.fbCoolingPanel.fbPress_1.iRaw</Name>
<Name>PRG_MR5K4_KBO.fbCoolingPanel.fbFlow_1.iRaw</Name>
<Comment><![CDATA[ Connect this input to the terminal]]></Comment>
<Type>INT</Type>
</Var>
<Var>
<Name>GVL_M2K4_RTD.nM2K4DS_RTD_1</Name>
<Comment><![CDATA[ M2K4 DS RTDs]]></Comment>
<Name>PRG_MR5K4_KBO.fbCoolingPanel.fbPress_1.iRaw</Name>
<Comment><![CDATA[ Connect this input to the terminal]]></Comment>
<Type>INT</Type>
</Var>
<Var>
<Name>GVL_M2K4_RTD.nM2K4DS_RTD_2</Name>
<Name>GVL_M2K4_RTD.nM2K4US_RTD_1</Name>
<Comment><![CDATA[ M2K4 BENDER RTDs
M2K4 US RTDs]]></Comment>
<Type>INT</Type>
</Var>
<Var>
<Name>GVL_M2K4_RTD.nM2K4US_RTD_2</Name>
<Type>INT</Type>
</Var>
<Var>
<Name>GVL_M1K4.M1K4_Pitch.diEncCnt</Name>
<Comment><![CDATA[Raw encoder count]]></Comment>
<Type>LINT</Type>
</Var>
<Var>
<Name>GVL_M2K4_RTD.nM2K4US_RTD_3</Name>
<Type>INT</Type>
</Var>
<Var>
<Name>GVL_M2K4_RTD.nM2K4DS_RTD_1</Name>
<Comment><![CDATA[ M2K4 DS RTDs]]></Comment>
<Type>INT</Type>
</Var>
<Var>
<Name>GVL_M2K4_RTD.nM2K4DS_RTD_2</Name>
<Type>INT</Type>
</Var>
<Var>
<Name>GVL_M2K4_RTD.nM2K4DS_RTD_3</Name>
<Type>INT</Type>
Expand Down Expand Up @@ -3005,14 +3005,14 @@ External Setpoint Generation:
<Name>Main.fbMotionStageM24.fbDriveVirtual.MasterAxis.PlcToNc</Name>
<Type GUID="{96B75FEB-2D84-43BE-A3EC-D9A681F27D52}" Namespace="MC">PLCTONC_AXIS_REF</Type>
</Var>
<Var>
<Name>PRG_PMPS.fbArbiterIO.q_stRequestedBP</Name>
<Type GUID="{292CD354-C7C0-4A61-AAD0-1C85DD69646B}">ST_BeamParams_IO</Type>
</Var>
<Var>
<Name>PRG_MR1K4_SOMS.bActivateVarCool</Name>
<Type>BOOL</Type>
</Var>
<Var>
<Name>PRG_PMPS.fbArbiterIO.q_stRequestedBP</Name>
<Type GUID="{292CD354-C7C0-4A61-AAD0-1C85DD69646B}">ST_BeamParams_IO</Type>
</Var>
<Var>
<Name>GVL_PMPS.g_FastFaultOutput1.q_xFastFaultOut</Name>
<Type>BOOL</Type>
Expand Down
13 changes: 7 additions & 6 deletions lcls-plc-tmo-optics/tmo_optics/POUs/PRG_PMPS.TcPOU
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4022.18">
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.12">
<POU Name="PRG_PMPS" Id="{0f3d8667-823e-4b6c-9348-207a75a704c2}" SpecialFunc="None">
<Declaration><![CDATA[PROGRAM PRG_PMPS
VAR
Expand All @@ -17,6 +17,7 @@ VAR

bMR1K1_IN : BOOL;
bST3K4_IN : BOOL;
bMR1K3_IN : BOOL;
END_VAR
]]></Declaration>
<Implementation>
Expand All @@ -33,15 +34,15 @@ bMR1K1_IN := PMPS.PMPS_GVL.stCurrentBeamParameters.aVetoDevices[PMPS.K_Stopper.M

bST3K4_IN := PMPS.PMPS_GVL.stCurrentBeamParameters.aVetoDevices[PMPS.K_Stopper.ST3K4];

fbArbiterIO(i_bVeto:= bMR1K1_IN, Arbiter := GVL_PMPS.g_fbArbiter1, fbFFHWO := GVL_PMPS.g_FastFaultOutput1);
bMR1K3_IN := PMPS.PMPS_GVL.stCurrentBeamParameters.aVetodevices[PMPS.K_Stopper.MR1K3_IN]
AND NOT PMPS.PMPS_GVL.stCurrentBeamParameters.aVetoDevices[PMPS.K_Stopper.MR1K3_OUT];

GVL_PMPS.g_FastFaultOutput2.i_xVeto := bMR1K1_IN OR bST3K4_IN;

GVL_PMPS.g_FastFaultOutput2.Execute();
fbArbiterIO(i_bVeto:= bMR1K1_IN OR bMR1K3_IN, Arbiter := GVL_PMPS.g_fbArbiter1, fbFFHWO := GVL_PMPS.g_FastFaultOutput1);

ffFFO2ToFFO1(i_xOK := GVL_PMPS.g_FastFaultOutput2.q_xFastFaultOut, io_fbFFHWO := GVL_PMPS.g_FastFaultOutput1);

GVL_PMPS.g_FastFaultOutput1.Execute(i_xVeto:= bMR1K1_IN);
GVL_PMPS.g_FastFaultOutput2.Execute(i_xVeto:= bMR1K1_IN OR bMR1K3_IN OR bST3K4_IN);
GVL_PMPS.g_FastFaultOutput1.Execute(i_xVeto:= bMR1K1_IN OR bMR1K3_IN);

fb_vetoArbiter(bVeto := GVL_PMPS.g_FastFaultOutput2.i_xVeto, HigherAuthority := GVL_PMPS.g_fbArbiter1, LowerAuthority:= GVL_PMPS.g_fbArbiter2,
FFO:= GVL_PMPS.g_FastFaultOutput1);]]></ST>
Expand Down
4 changes: 2 additions & 2 deletions lcls-plc-tmo-optics/tmo_optics/tmo_optics.plcproj
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@
<LibraryReference Include="lcls-twincat-motion,4.0.9,SLAC">
<Namespace>lcls_twincat_motion</Namespace>
</LibraryReference>
<LibraryReference Include="PMPS,3.0.14,SLAC - LCLS">
<LibraryReference Include="PMPS,3.3.0,SLAC - LCLS">
<Namespace>PMPS</Namespace>
</LibraryReference>
</ItemGroup>
Expand All @@ -189,7 +189,7 @@
<Resolution>lcls2-cc-lib, 2.0.0 (SLAC)</Resolution>
</PlaceholderResolution>
<PlaceholderResolution Include="PMPS">
<Resolution>PMPS, 3.0.14 (SLAC - LCLS)</Resolution>
<Resolution>PMPS, 3.3.0 (SLAC - LCLS)</Resolution>
</PlaceholderResolution>
<PlaceholderResolution Include="Tc2_MC2">
<Resolution>Tc2_MC2, 3.3.42.0 (Beckhoff Automation GmbH)</Resolution>
Expand Down
Loading