Skip to content

Commit

Permalink
Updating interlocks for venting valves
Browse files Browse the repository at this point in the history
  • Loading branch information
janezg-SLAC committed Aug 30, 2024
1 parent 2d8890d commit 023842d
Show file tree
Hide file tree
Showing 5 changed files with 284 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
</DataType>
</DataTypes>
<Project GUID="{8B5CA86E-1547-4766-AA3F-34B97851849D}" Name="lcls_plc_dream_vac" PrjFilePath="..\..\lcls_plc_dream_vac\lcls_plc_dream_vac.plcproj" TmcFilePath="..\..\lcls_plc_dream_vac\lcls_plc_dream_vac.tmc" ReloadTmc="true" AmsPort="851" FileArchiveSettings="#x000e" SymbolicMapping="true">
<Instance Id="#x08502000" TcSmClass="TComPlcObjDef" KeepUnrestoredLinks="1" TmcPath="lcls_plc_dream_vac\lcls_plc_dream_vac.tmc" TmcHash="{42D93E79-622A-FE76-7C89-95D5290EA20F}">
<Instance Id="#x08502000" TcSmClass="TComPlcObjDef" KeepUnrestoredLinks="1" TmcPath="lcls_plc_dream_vac\lcls_plc_dream_vac.tmc" TmcHash="{A2CB7032-FF0A-D9F0-9C59-5B485DA29665}">
<Name>lcls_plc_dream_vac Instance</Name>
<CLSID ClassFactory="TcPlc30">{08500001-0000-0000-F000-000000000064}</CLSID>
<Vars VarGrpType="1">
Expand Down Expand Up @@ -482,11 +482,6 @@
<Name>GVL_VAC_VALVES.DREAM_ROUGH1_VRC_01.i_xClsLS</Name>
<Type>BOOL</Type>
</Var>
<Var>
<Name>GVL_VAC_VALVES.DREAM_ROUGH2_VRC_01.i_xOpnLS</Name>
<Comment><![CDATA[IO]]></Comment>
<Type>BOOL</Type>
</Var>
<Var>
<Name>GVL_VAC_VALVES.DREAM_ROUGH2_VRC_01.i_xClsLS</Name>
<Type>BOOL</Type>
Expand All @@ -500,6 +495,11 @@
<Name>GVL_VAC_VALVES.DREAM_ROUGH2_VRC_02.i_xClsLS</Name>
<Type>BOOL</Type>
</Var>
<Var>
<Name>GVL_VAC_VALVES.DREAM_ROUGH2_VRC_01.i_xOpnLS</Name>
<Comment><![CDATA[IO]]></Comment>
<Type>BOOL</Type>
</Var>
</Vars>
<Vars VarGrpType="2" ContextId="1" AreaNo="17">
<Name>PlcTask Outputs</Name>
Expand Down Expand Up @@ -694,15 +694,15 @@
<Type>BOOL</Type>
</Var>
<Var>
<Name>GVL_VAC_VALVES.DREAM_CAT1_VRC_01.q_xOPN_DO</Name>
<Name>GVL_VAC_VALVES.DREAM_DP1_VRC_02.q_xCLS_DO</Name>
<Type>BOOL</Type>
</Var>
<Var>
<Name>GVL_VAC_VALVES.DREAM_ROUGH1_VRC_01.q_xOPN_DO</Name>
<Name>GVL_VAC_VALVES.DREAM_CAT1_VRC_01.q_xOPN_DO</Name>
<Type>BOOL</Type>
</Var>
<Var>
<Name>GVL_VAC_VALVES.DREAM_DP1_VRC_02.q_xCLS_DO</Name>
<Name>GVL_VAC_VALVES.DREAM_ROUGH1_VRC_01.q_xOPN_DO</Name>
<Type>BOOL</Type>
</Var>
<Var>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.12">
<POU Name="FB_TurboSpeedCheck" Id="{bb0e0322-4af5-49e9-b25a-9b24b28cda7e}" SpecialFunc="None">
<Declaration><![CDATA[FUNCTION_BLOCK FB_TurboSpeedCheck
VAR_INPUT
i_stNCTurbo1 : ST_PTM; //Turbo pump 1
i_stNCTurbo2 : ST_PTM; //Turbo pump 1
i_stDP1Turbo : ST_PTM; //Turbo pump 3
i_stDP2Turbo : ST_PTM; //Turbo pump 4
i_stDP3Turbo : ST_PTM; //Turbo pump 5
i_stMCTurbo1 : ST_PTM; //Turbo pump 6
i_stMCTurbo2 : ST_PTM; //Turbo pump 7
i_stCAT1Turbo : ST_PTM; //Turbo pump 8
i_stCAT2Turbo : ST_PTM; //Turbo pump 9
i_stRough2Turbo1 : ST_PTM; //Turbo pump 10
i_stRough2Turbo2 : ST_PTM; //Turbo pump 11
END_VAR
VAR_OUTPUT
END_VAR
VAR
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[]]></ST>
</Implementation>
<Method Name="IsCatTurboSpeedBelow10Hz" Id="{88b573ec-fa86-4f1e-a432-602315e7dab2}">
<Declaration><![CDATA[METHOD IsCatTurboSpeedBelow10Hz : BOOL
VAR_INPUT
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[IsCatTurboSpeedBelow10Hz := i_stCAT2Turbo.i_diCurSpd < 10;]]></ST>
</Implementation>
</Method>
<Method Name="IsMainTurboSpeedBelow10Hz" Id="{d913ea7f-c62a-4300-a0d8-93b089a0858c}">
<Declaration><![CDATA[METHOD IsMainTurboSpeedBelow10Hz : BOOL
VAR_INPUT
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[IsMainTurboSpeedBelow10Hz := i_stDP1Turbo.i_diCurSpd < 10 AND
i_stDP2Turbo.i_diCurSpd < 10 AND
i_stDP3Turbo.i_diCurSpd < 10 AND
i_stMCTurbo1.i_diCurSpd < 10 AND
i_stMCTurbo2.i_diCurSpd < 10 AND
i_stRough2Turbo1.i_diCurSpd < 10 AND
i_stRough2Turbo2.i_diCurSpd < 10 AND
i_stCAT1Turbo.i_diCurSpd < 10;]]></ST>
</Implementation>
</Method>
<Method Name="IsNozzleTurboSpeedBelow10Hz" Id="{93f65d96-0380-4bcd-b1ef-0bdde103c5b2}">
<Declaration><![CDATA[METHOD IsNozzleTurboSpeedBelow10Hz : BOOL
VAR_INPUT
END_VAR]]></Declaration>
<Implementation>
<ST><![CDATA[IsNozzleTurboSpeedBelow10Hz := i_stNCTurbo1.i_diCurSpd < 10 AND i_stNCTurbo2.i_diCurSpd < 10;]]></ST>
</Implementation>
</Method>
</POU>
</TcPlcObject>
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ VAR
bDP1_VRC_01_ILK : BOOL;
bDP1_VRC_02_ILK : BOOL;
bCAT1_VRC_DP_OK : BOOL;
//dummy FF output to use in VGC_2S function
dummy_FFFO : FB_HardwareFFOutput;
dummy_fbArbiter1 : FB_Arbiter(1);
//Turbo speed check function
fbTurboSpeedCheck : FB_TurboSpeedCheck;
END_VAR
]]></Declaration>
<Implementation>
Expand Down Expand Up @@ -106,16 +109,30 @@ DREAM_ROUGH2_VRC_02(i_stUSG := DREAM_ROUGH2_GPI_01.PG,
io_fbFFHWO := dummy_FFFO,
fbArbiter := dummy_fbArbiter1,
i_sDevName := 'DREAM-ROUGH2-VRC-02');
//DREAM_ROUGH1_VRC_01(i_xExtILK_OK := ROUGH1_VRC_01_ILK, i_xOverrideMode := bSystemOverrideMode);
//DREAM_ROUGH2_VRC_01(i_xExtILK_OK := ROUGH2_VRC_01_ILK, i_xOverrideMode := bSystemOverrideMode);
//DREAM_ROUGH2_VRC_02(i_xExtILK_OK := ROUGH2_VRC_02_ILK, i_xOverrideMode := bSystemOverrideMode);
//Turbo current speed evaluation
fbTurboSpeedCheck(i_stNCTurbo1 := DREAM_NC_PTM_01.iq_stPTM,
i_stNCTurbo2 := DREAM_NC_PTM_02.iq_stPTM,
i_stDP1Turbo := DREAM_DP1_PTM_01.iq_stPTM,
i_stDP2Turbo := DREAM_DP2_PTM_01.iq_stPtm,
i_stDP3Turbo := DREAM_DP3_PTM_01.iq_stPtm,
i_stMCTurbo1 := DREAM_MC_PTM_01.iq_stPtm,
i_stMCTurbo2 := DREAM_MC_PTM_02.iq_stPtm,
i_stCAT1Turbo := DREAM_CAT1_PTM_01.iq_stPtm,
i_stCAT2Turbo := DREAM_CAT2_PTM_01.iq_stPtm,
i_stRough2Turbo1 := DREAM_ROUGH2_PTM_01.iq_stPtm,
i_stRough2Turbo2 := DREAM_ROUGH2_PTM_02.iq_stPTM);
//Flow control valves
DREAM_ROUGH1_VFV_01(i_xExtIlkOK := DREAM_ROUGH1_VRC_01.M_IsClosed());
DREAM_ROUGH1_VFV_02(i_xExtIlkOK := DREAM_ROUGH1_VRC_01.M_IsClosed());
DREAM_ROUGH1_VFV_02(i_xExtIlkOK := DREAM_ROUGH1_VRC_01.M_IsClosed() AND DREAM_DP1_VRC_01.M_IsClosed() AND fbTurboSpeedCheck.IsNozzleTurboSpeedBelow10Hz());
DREAM_ROUGH2_VFV_01(i_xExtIlkOK := DREAM_ROUGH2_VRC_01.M_IsClosed() AND DREAM_ROUGH2_VRC_02.M_IsClosed());
DREAM_ROUGH2_VFV_02(i_xExtIlkOK := DREAM_ROUGH2_VRC_01.M_IsClosed());
DREAM_ROUGH2_VFV_03(i_xExtIlkOK := DREAM_ROUGH2_VRC_02.M_IsClosed());
DREAM_ROUGH2_VFV_02(i_xExtIlkOK := DREAM_ROUGH2_VRC_01.M_IsClosed() AND fbTurboSpeedCheck.IsMainTurboSpeedBelow10Hz());
DREAM_ROUGH2_VFV_03(i_xExtIlkOK := DREAM_ROUGH2_VRC_02.M_IsClosed() AND DREAM_CAT1_VRC_01.M_IsClosed() AND fbTurboSpeedCheck.IsCatTurboSpeedBelow10Hz());
]]></ST>
</Implementation>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
<Compile Include="PlcTask.TcTTO">
<SubType>Code</SubType>
</Compile>
<Compile Include="POUs\Functions\FB_TurboSpeedCheck.TcPOU">
<SubType>Code</SubType>
</Compile>
<Compile Include="POUs\Functions\F_TurboIlkLogic.TcPOU">
<SubType>Code</SubType>
</Compile>
Expand Down
Loading

0 comments on commit 023842d

Please sign in to comment.