Skip to content

Commit

Permalink
ENH: move flow/pressure calls to the optics library
Browse files Browse the repository at this point in the history
  • Loading branch information
nrwslac committed Feb 6, 2024
1 parent 2036925 commit 691e949
Show file tree
Hide file tree
Showing 9 changed files with 2,684 additions and 4,392 deletions.
226 changes: 113 additions & 113 deletions lcls-plc-rixs-optics/_Config/PLC/rixs_optics.xti

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lcls-plc-rixs-optics/lcls-plc-rixs-optics.tsproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<ManualSelect>{BF78CFC7-2E63-42C3-8C07-BB6C346BFB8B}</ManualSelect>
<ManualSelect>{3EBB9639-5FF3-42B6-8847-35C70DC013C8}</ManualSelect>
<TargetSelect TargetId="2">{BF78CFC7-2E63-42C3-8C07-BB6C346BFB8B}</TargetSelect>
<TargetSelect TargetId="2">{BCA6EE0A-9CE1-4D3F-98CA-413ABC0D94FD}</TargetSelect>
<TargetSelect TargetId="2">{66689887-CCBD-452C-AC9A-039D997C6E66}</TargetSelect>
<TargetSelect TargetId="2">{BCA6EE0A-9CE1-4D3F-98CA-413ABC0D94FD}</TargetSelect>
<TargetSelect TargetId="2">{3EBB9639-5FF3-42B6-8847-35C70DC013C8}</TargetSelect>
<TargetSelect TargetId="2">{777F1598-583B-4503-99BB-7C02E0ABD97E}</TargetSelect>
<TargetSelect TargetId="2">{520DE751-9DB6-47CB-8240-BD5C466E7E64}</TargetSelect>
Expand Down
74 changes: 37 additions & 37 deletions lcls-plc-rixs-optics/rixs_optics/GVLs/Main.TcGVL

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?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="FB_AssembleChannel" Id="{5ef2e007-6efe-4b71-ad1b-59044bb806ba}" SpecialFunc="None">
<Declaration><![CDATA[FUNCTION_BLOCK FB_AssembleChannel
VAR_INPUT
// Raw count from the encoder, taken from DUT_MotionStage.nEncoderCount
// Raw count from the encoder, taken from ST_MotionStage.nEncoderCount
nEncCount : UDINT;
// Latched rising edge timestamp from EL1252-0050 terminal.
nTiming : ULINT;
// Scale as reported in DUT_MotionStage.stAxisParameters.fEncScaleFactorNumerator
// Scale as reported in ST_MotionStage.stAxisParameters.fEncScaleFactorNumerator
fScale : LREAL;
// Serial number of the encoder
sHardwareID : STRING(15);
Expand All @@ -17,7 +17,7 @@ VAR_INPUT
nError : USINT;
// Selector for acquisition mode (currently unused)
nMode : USINT;
// Scale denominator as reported in DUT_MotionStage.stAxisParameters.fEncScaleFactorDenominator
// Scale denominator as reported in ST_MotionStage.stAxisParameters.fEncScaleFactorDenominator
fScaleDenominator: LREAL;
END_VAR
VAR_OUTPUT
Expand Down
39 changes: 7 additions & 32 deletions lcls-plc-rixs-optics/rixs_optics/POUs/PRG_MR2K2_FLAT.TcPOU
Original file line number Diff line number Diff line change
Expand Up @@ -72,33 +72,14 @@ VAR
M2K2FLATbSTOEnable1 AT %I* : BOOL;
{attribute 'TcLinkTo' := 'TIID^Device 1 (EtherCAT)^Term 1 (EK1200)^Term 79 (EK1521-0010)^Term 306 (EK1501-0010)^Term 310 (EK1122)^EK1100_MR2K2^EL1004_M2K2_STO^Channel 2^Input'}
M2K2FLATbSTOEnable2 AT %I* : BOOL;
// MR2K2 Flow Press Sensors
{attribute 'TcLinkTo' := '.iRaw := TIIB[EL3054_MR2K2_FWM_PRSM]^AI Standard Channel 1^Value'}
fMR2K2_Flow_1 : FB_AnalogInput;
{attribute 'pytmc' := '
pv: MR2K2:FLAT:FWM:1
field: EGU lpm
io: i
'}
fMR2K2_Flow_1_val : LREAL;
{attribute 'TcLinkTo' := '.iRaw := TIIB[EL3054_MR2K2_FWM_PRSM]^AI Standard Channel 3^Value'}
fMR2K2_Flow_2 : FB_AnalogInput;
{attribute 'pytmc' := '
pv: MR2K2:FLAT:FWM:2
field: EGU lpm
io: i
{attribute 'TcLinkTo' := '.fbFlow_1.iRaw := TIIB[EL3054_MR2K2_FWM_PRSM]^AI Standard Channel 1^Value;
.fbFlow_2.iRaw := TIIB[EL3054_MR2K2_FWM_PRSM]^AI Standard Channel 3^Value;
.fbPress_1.iRaw := TIIB[EL3054_MR2K2_FWM_PRSM]^AI Standard Channel 2^Value
'}
fMR2K2_Flow_2_val : LREAL;
{attribute 'TcLinkTo' := '.iRaw := TIIB[EL3054_MR2K2_FWM_PRSM]^AI Standard Channel 2^Value'}
fMR2K2_Press_1 : FB_AnalogInput;
{attribute 'pytmc' := '
pv: MR2K2:FLAT:PRSM:1
field: EGU bar
io: i
pv: MR2K2:FLAT
'}
fMR2K2_Press_1_val : LREAL;
fbCoolingPanel : FB_Axilon_Cooling_2f1p;
END_VAR]]></Declaration>
<Implementation>
<ST><![CDATA[//FB_Motion stages for MR2K2 Axes
Expand Down Expand Up @@ -136,14 +117,8 @@ nEncCntXM2K2 := ULINT_TO_UDINT(M25.nRawEncoderULINT);
nEncCntYM2K2 := ULINT_TO_UDINT(M26.nRawEncoderULINT);
nEncCntrXM2K2 := ULINT_TO_UDINT(M27.nRawEncoderULINT);
fMR2K2_Flow_1(iTermBits:=15, fTermMax:=5.0427, fTermMin:=0.050472);
fMR2K2_Flow_1_val := fMR2K2_Flow_1.fReal;
fMR2K2_Flow_2(iTermBits:=15, fTermMax:=5.0427, fTermMin:=0.050472);
fMR2K2_Flow_2_val := fMR2K2_Flow_2.fReal;
fMR2K2_Press_1(iTermBits:=15, fTermMax:=4.0, fTermMin:=0);
fMR2K2_Press_1_val := fMR2K2_Press_1.fReal;]]></ST>
// Axilon Cooling Panel
fbCoolingPanel();]]></ST>
</Implementation>
</POU>
</TcPlcObject>
28 changes: 7 additions & 21 deletions lcls-plc-rixs-optics/rixs_optics/POUs/PRG_MR3K2_KBH.TcPOU
Original file line number Diff line number Diff line change
Expand Up @@ -164,25 +164,14 @@ VAR
M3K2KBHbSTOEnable1 AT %I* : BOOL;
{attribute 'TcLinkTo' := 'TIIB[EL1004_M3K2_STO]^Channel 2^Input'}
M3K2KBHbSTOEnable2 AT %I* : BOOL;
// MR3K2 Flow Sensors
{attribute 'TcLinkTo' := '.iRaw := TIIB[EL3054_MR3_4K2_FWM_PRSM]^AI Standard Channel 1^Value'}
fMR3K2_Flow_1 : FB_AnalogInput;
{attribute 'pytmc' := '
pv: MR3K2:KBH:FWM:1
field: EGU lpm
io: i
{attribute 'TcLinkTo' := '.fbFlow_1.iRaw := TIIB[EL3054_MR3_4K2_FWM_PRSM]^AI Standard Channel 1^Value;
.fbPress_1.iRaw := TIIB[EL3054_MR3_4K2_FWM_PRSM]^AI Standard Channel 2^Value
'}
fMR3K2_Flow_1_val : LREAL;
{attribute 'TcLinkTo' := '.iRaw := TIIB[EL3054_MR3_4K2_FWM_PRSM]^AI Standard Channel 2^Value'}
fMR3K2_Press_1 : FB_AnalogInput;
{attribute 'pytmc' := '
pv: MR3K2:KBH:PRSM:1
field: EGU bar
io: i
pv: MR3K2:KBH
'}
fMR3K2_Press_1_val : LREAL;
// MR3K2 Flow Sensors
fbCoolingPanel : FB_Axilon_Cooling_1f1p;
(*
// PMPS
ffBenderRange : FB_FastFault := (
Expand Down Expand Up @@ -266,11 +255,8 @@ bM3K2DS_RTD_3_Err := fM3K2DS_RTD_3 = 0;
M31.bHardwareEnable R= fM3K2US_RTD_1 > 9000 OR bM3K2US_RTD_1_Err;
M32.bHardwareEnable R= fM3K2DS_RTD_1 > 9000 OR bM3K2DS_RTD_1_Err;
fMR3K2_Flow_1(iTermBits:=15, fTermMax:=5.0427, fTermMin:=0.050472);
fMR3K2_Flow_1_val := fMR3K2_Flow_1.fReal;
fMR3K2_Press_1(iTermBits:=15, fTermMax:=4.0, fTermMin:=0);
fMR3K2_Press_1_val := fMR3K2_Press_1.fReal;
// Axilon Cooling Panel
fbCoolingPanel();
(*
//PMPS
ffBenderRange.i_xOK :=
Expand Down
26 changes: 6 additions & 20 deletions lcls-plc-rixs-optics/rixs_optics/POUs/PRG_MR4K2_KBV.TcPOU
Original file line number Diff line number Diff line change
Expand Up @@ -186,23 +186,13 @@ VAR
M4K2KBVbSTOEnable2 AT %I* : BOOL;
// MR4K2 Flow Sensors
{attribute 'TcLinkTo' := '.iRaw := TIIB[EL3054_MR3_4K2_FWM_PRSM]^AI Standard Channel 3^Value'}
fMR4K2_Flow_1 : FB_AnalogInput;
{attribute 'pytmc' := '
pv: MR4K2:KBV:FWM:1
field: EGU lpm
io: i
{attribute 'TcLinkTo' := '.fbFlow_1.iRaw := TIIB[EL3054_MR3_4K2_FWM_PRSM]^AI Standard Channel 3^Value;
.fbPress_1.iRaw := TIIB[EL3054_MR3_4K2_FWM_PRSM]^AI Standard Channel 2^Value
'}
fMR4K2_Flow_1_val : LREAL;
{attribute 'TcLinkTo' := '.iRaw := TIIB[EL3054_MR3_4K2_FWM_PRSM]^AI Standard Channel 2^Value'}
fMR4K2_Press_1 : FB_AnalogInput;
{attribute 'pytmc' := '
pv: MR4K2:KBV:PRSM:1
field: EGU bar
io: i
pv: MR4K2:KBV
'}
fMR4K2_Press_1_val : LREAL;
fbCoolingPanel : FB_Axilon_Cooling_1f1p;
(*
// PMPS
Expand Down Expand Up @@ -290,12 +280,8 @@ M37.bHardwareEnable R= fM4K2DS_RTD_1 > 9000 OR bM4K2DS_RTD_1_Err;
nM4K2_Chin_Right_RTD();
nM4K2_Chin_Left_RTD();
fMR4K2_Flow_1(iTermBits:=15, fTermMax:=5.0427, fTermMin:=0.050472);
fMR4K2_Flow_1_val := fMR4K2_Flow_1.fReal;
fMR4K2_Press_1(iTermBits:=15, fTermMax:=4.0, fTermMin:=0);
fMR4K2_Press_1_val := fMR4K2_Press_1.fReal;
// Axilon Cooling Panel
fbCoolingPanel();
(*
//PMPS
ffBenderRange.i_xOK :=
Expand Down
11 changes: 6 additions & 5 deletions lcls-plc-rixs-optics/rixs_optics/rixs_optics.plcproj
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,10 @@
<DefaultResolution>LCLS General, * (SLAC)</DefaultResolution>
<Namespace>LCLS_General</Namespace>
</PlaceholderReference>
<PlaceholderReference Include="lcls-twincat-optics-nrw">
<DefaultResolution>lcls-twincat-optics-nrw, * (SLAC)</DefaultResolution>
<Namespace>lcls_twincat_optics_nrw</Namespace>
</PlaceholderReference>
<PlaceholderReference Include="lcls2-cc-lib">
<DefaultResolution>lcls2-cc-lib, * (SLAC)</DefaultResolution>
<Namespace>lcls2_cc_lib</Namespace>
Expand Down Expand Up @@ -249,19 +253,16 @@
</PlaceholderReference>
</ItemGroup>
<ItemGroup>
<LibraryReference Include="lcls-twincat-motion,2.0.1,SLAC">
<LibraryReference Include="lcls-twincat-motion,4.0.5,SLAC">
<Namespace>lcls_twincat_motion</Namespace>
</LibraryReference>
<LibraryReference Include="lcls-twincat-optics,0.6.1,SLAC">
<Namespace>lcls_twincat_optics</Namespace>
</LibraryReference>
</ItemGroup>
<ItemGroup>
<PlaceholderResolution Include="LCLS General">
<Resolution>LCLS General, 2.10.0 (SLAC)</Resolution>
</PlaceholderResolution>
<PlaceholderResolution Include="lcls-twincat-motion">
<Resolution>lcls-twincat-motion, 2.0.1 (SLAC)</Resolution>
<Resolution>lcls-twincat-motion, 4.0.5 (SLAC)</Resolution>
</PlaceholderResolution>
<PlaceholderResolution Include="lcls2-cc-lib">
<Resolution>lcls2-cc-lib, 2.0.0 (SLAC)</Resolution>
Expand Down
Loading

0 comments on commit 691e949

Please sign in to comment.