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

2oo3 reset function #115

Merged
merged 4 commits into from
Oct 17, 2023
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
60 changes: 31 additions & 29 deletions L2SIVacuum/L2SIVacuum.tmc

Large diffs are not rendered by default.

21 changes: 9 additions & 12 deletions L2SIVacuum/POUs/Functions/Valves/FB_VFS_2OO3.TcPOU
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,26 @@
The Fast shutter was tested with PLC task Cycle Base Time 50us with cycle time 0.050ms.*)
FUNCTION_BLOCK FB_VFS_2OO3 EXTENDS FB_Valve
VAR_INPUT
i_xPMPS_OK : BOOL; (*External MPS interlock, Set to TRUE when no PMPS interlock is required*)

Check warning on line 11 in L2SIVacuum/POUs/Functions/Valves/FB_VFS_2OO3.TcPOU

View workflow job for this annotation

GitHub Actions / standard / Style check / Leading tabs

Leading tabs
i_xExt_OK : BOOL; (*Other External Interlock, Set to True when no external interlock is required*)

Check warning on line 12 in L2SIVacuum/POUs/Functions/Valves/FB_VFS_2OO3.TcPOU

View workflow job for this annotation

GitHub Actions / standard / Style check / Leading tabs

Leading tabs
i_sDevName : T_MaxString := 'VFS'; (*Device name for diagnostic*)

Check warning on line 13 in L2SIVacuum/POUs/Functions/Valves/FB_VFS_2OO3.TcPOU

View workflow job for this annotation

GitHub Actions / standard / Style check / Leading tabs

Leading tabs
i_xVeto_Enable : BOOL := FALSE; (*Set to TRUE if there is a Veto Valve to this VFS*)

Check warning on line 14 in L2SIVacuum/POUs/Functions/Valves/FB_VFS_2OO3.TcPOU

View workflow job for this annotation

GitHub Actions / standard / Style check / Leading tabs

Leading tabs
END_VAR
VAR_IN_OUT
io_fbFFHWO : FB_HardwareFFOutput;

Check warning on line 17 in L2SIVacuum/POUs/Functions/Valves/FB_VFS_2OO3.TcPOU

View workflow job for this annotation

GitHub Actions / standard / Style check / Leading tabs

Leading tabs
END_VAR
VAR
xOPN_OK : BOOL; //internal variable OK to Open signal

Check warning on line 20 in L2SIVacuum/POUs/Functions/Valves/FB_VFS_2OO3.TcPOU

View workflow job for this annotation

GitHub Actions / standard / Style check / Leading tabs

Leading tabs
xERR_ExtFault : BOOL; //internal variable External Fault signal

Check warning on line 21 in L2SIVacuum/POUs/Functions/Valves/FB_VFS_2OO3.TcPOU

View workflow job for this annotation

GitHub Actions / standard / Style check / Leading tabs

Leading tabs
xVeto : BOOL; //internal variable Veto signal

Check warning on line 22 in L2SIVacuum/POUs/Functions/Valves/FB_VFS_2OO3.TcPOU

View workflow job for this annotation

GitHub Actions / standard / Style check / Leading tabs

Leading tabs
xTrigger : BOOL; //internal trigger signal, output of 2oo3 logic

Check warning on line 23 in L2SIVacuum/POUs/Functions/Valves/FB_VFS_2OO3.TcPOU

View workflow job for this annotation

GitHub Actions / standard / Style check / Leading tabs

Leading tabs
xPress_OK : BOOL; //internal signal indicating if at gauges are connected and OK
//Fault counter triggers
rtFault_IG1 : R_TRIG;
rtFault_IG2 : R_TRIG;
rtFault_IG3 : R_TRIG;
//Reset Fault counter trigger
rtResetFaultCounter : R_TRIG;

//PMPS
fbFF : FB_FastFault :=(
Expand All @@ -39,28 +41,28 @@
xFirstPass : BOOL := TRUE; //Do something on first pass, after that set to FALSE

rtOPN_SW : R_TRIG; //Detect rising endge on i_xOPN_SW input

Check warning on line 44 in L2SIVacuum/POUs/Functions/Valves/FB_VFS_2OO3.TcPOU

View workflow job for this annotation

GitHub Actions / standard / Style check / Trailing whitespace

Trailing whitespace
tonDelOK : TON;
rtOK : R_TRIG;
tonOvrd : TON;

Check warning on line 48 in L2SIVacuum/POUs/Functions/Valves/FB_VFS_2OO3.TcPOU

View workflow job for this annotation

GitHub Actions / standard / Style check / Trailing whitespace

Trailing whitespace
tDelOK : TIME := T#60S;
tOvrd : TIME := T#10s;
rTrigOverrideOpen : R_TRIG;

Check warning on line 52 in L2SIVacuum/POUs/Functions/Valves/FB_VFS_2OO3.TcPOU

View workflow job for this annotation

GitHub Actions / standard / Style check / Trailing whitespace

Trailing whitespace
xClose : BOOL;
xOpen : BOOL;
CloseTimer : TON;
TimDur : TIME := T#20MS;
OpenTimer : TON;
OpenTimDur : TIME := T#2S;

Check warning on line 59 in L2SIVacuum/POUs/Functions/Valves/FB_VFS_2OO3.TcPOU

View workflow job for this annotation

GitHub Actions / standard / Style check / Trailing whitespace

Trailing whitespace
(*Timeouts*)
tCLSTimeOutDuration : TIME := T#0.5S;
tOPNTimeOutDuration : TIME := T#10S;
tOPNtimeout : TON;
tCLStimeout : TON;

Check warning on line 65 in L2SIVacuum/POUs/Functions/Valves/FB_VFS_2OO3.TcPOU

View workflow job for this annotation

GitHub Actions / standard / Style check / Trailing whitespace

Trailing whitespace

(*IO to the valve(s)*)
i_xOpnLS AT%I* : BOOL; //VFS Open limit switch input
Expand All @@ -72,15 +74,16 @@
(*3x Fast trigger Inputs from CC Gauge controller.
Make sure all tri CC gauge cards are in the same controller*)
i_xTriggerIG1 AT%I* : BOOL; //Fast trigger input from CC gauge 1
i_xTriggerIG2 AT%I* : BOOL; //Fast trigger input from CC gauge 2

Check warning on line 77 in L2SIVacuum/POUs/Functions/Valves/FB_VFS_2OO3.TcPOU

View workflow job for this annotation

GitHub Actions / standard / Style check / Trailing whitespace

Trailing whitespace
i_xTriggerIG3 AT%I* : BOOL; //Fast trigger input from CC gauge 3

Check warning on line 79 in L2SIVacuum/POUs/Functions/Valves/FB_VFS_2OO3.TcPOU

View workflow job for this annotation

GitHub Actions / standard / Style check / Trailing whitespace

Trailing whitespace
(*VETO Devices*)
i_xVetoValveOpenDO AT%I* : BOOL; (*Link to VFS Interface*)
i_xVetoValveClosed AT%I* : BOOL; (*Link to VFS Interface*)

Check warning on line 83 in L2SIVacuum/POUs/Functions/Valves/FB_VFS_2OO3.TcPOU

View workflow job for this annotation

GitHub Actions / standard / Style check / Trailing whitespace

Trailing whitespace
(*Interface with external system*)

Check warning on line 84 in L2SIVacuum/POUs/Functions/Valves/FB_VFS_2OO3.TcPOU

View workflow job for this annotation

GitHub Actions / standard / Style check / Trailing whitespace

Trailing whitespace
i_e2OO3_MODE AT%I* : E_2OO3_MODE; (*Link to VFS Interface, 2oo3 mode selector*)
i_ResetFaultCounter AT%I* : BOOL; (*Link to VFS Interface, FaultCounter Reset*)
i_xPress_OK_IG1 AT%I* : BOOL; (*Link to VFS Interface, IG.xPRESS_OK, to make sure that the device is connected*)
i_xPress_OK_IG2 AT%I* : BOOL; (*Link to VFS Interface, IG.xPRESS_OK, to make sure that the device is connected*)
i_xPress_OK_IG3 AT%I* : BOOL; (*Link to VFS Interface, IG.xPRESS_OK, to make sure that the device is connected*)
Expand Down Expand Up @@ -267,6 +270,12 @@
rtOPN_SW (CLK := i_xOPN_SW);

(*Gauge fault counters*)
rtResetFaultCounter(CLK := i_ResetFaultCounter);
IF rtResetFaultCounter.Q THEN
nFaultCounter_IG1 := 0;
nFaultCounter_IG2 := 0;
nFaultCounter_IG3 := 0;
END_IF
//IG1
rtFault_IG1(CLK := i_xTriggerIG1 AND NOT xTrigger);
IF rtFault_IG1.Q THEN
Expand Down Expand Up @@ -328,17 +337,5 @@
q_nFltCount_IG3 := nFaultCounter_IG3;]]></ST>
</Implementation>
</Action>
<LineIds Name="FB_VFS_2OO3">
<LineId Id="875" Count="191" />
<LineId Id="2" Count="0" />
</LineIds>
<LineIds Name="FB_VFS_2OO3.ACT_ResetAlarms">
<LineId Id="2" Count="11" />
<LineId Id="1" Count="0" />
</LineIds>
<LineIds Name="FB_VFS_2OO3.IO">
<LineId Id="2" Count="5" />
<LineId Id="1" Count="0" />
</LineIds>
</POU>
</TcPlcObject>
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ VAR_INPUT
pv: VFS_2OO3_MODE
io: io
'}
i_e2OO3_MODE : E_2OO3_MODE; // 2oo3 mode selector as EPICS Command or Input for global variable
i_e2OO3_MODE : E_2OO3_MODE; //2oo3 mode selector as EPICS Command or Input for global variable
{attribute 'pytmc' := '
pv: VFS_RESET_FAULT_COUNTER
io: io
'}
i_ResetFaultCounter : BOOL; //Reset Fault counter as EPCIS Command or Input for global reset button
END_VAR
VAR_OUTPUT
{attribute 'pytmc' := '
Expand All @@ -33,10 +38,14 @@ VAR
tonDelOK : TON;
xOPN_OK : BOOL;
tDelOK : TIME := T#60S;
xPress_OK : BOOL; //internal signal indicating if at gauges are connected and OK
xPress_OK : BOOL; //internal signal indicating if at gauges are connected and OK

//Reset Fault counter trigger
rtResetFaultCounter : R_TRIG;

(*outputs*)
q_e2OO3_MODE AT%Q* : E_2OO3_MODE; //2oo3 mode selector
q_e2OO3_MODE AT%Q* : E_2OO3_MODE; //2oo3 mode selector, connect to FB_VFS_2OO3 mode selector input
q_ResetFaultCounter AT%Q* : BOOL; //Reset Fault counter, connect to FB_VFS_2OO3 reset fault counter input
q_xPRESS_OK_IG1 AT%Q* : BOOL;
q_xPRESS_OK_IG2 AT%Q* : BOOL;
q_xPRESS_OK_IG3 AT%Q* : BOOL;
Expand Down Expand Up @@ -188,7 +197,16 @@ IF ( iq_stValve.i_xClsLS) THEN iq_stValve.xCLS_SW := FALSE; END_IF
iq_stValve.sVetoDeviceName := Veto_Valve.sDevName;

(*2oo3 mode selector*)
q_e2OO3_MODE := i_e2OO3_MODE;]]></ST>
q_e2OO3_MODE := i_e2OO3_MODE;

(*Reset Fault counter, q_ResetFaultCounter output is TRUE for one plc cycle *)
rtResetFaultCounter(CLK := i_ResetFaultCounter);
IF rtResetFaultCounter.Q THEN
i_ResetFaultCounter := FALSE;
q_ResetFaultCounter := TRUE;
ELSE
q_ResetFaultCounter := FALSE;
END_IF]]></ST>
</Implementation>
</Action>
</POU>
Expand Down
45 changes: 3 additions & 42 deletions L2SIVacuumLib.tsproj
Original file line number Diff line number Diff line change
@@ -1,24 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TcSmProject xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.beckhoff.com/schemas/2012/07/TcSmProject" TcSmVersion="1.0" TcVersion="3.1.4022.30">
<DataTypes>
<DataType>
<Name GUID="{18071995-0000-0000-0000-000000000041}" TcBaseType="true" HideSubItems="true" CName="AmsNetId">AMSNETID</Name>
<BitSize>48</BitSize>
<BaseType GUID="{18071995-0000-0000-0000-000000000001}">BYTE</BaseType>
<ArrayInfo>
<LBound>0</LBound>
<Elements>6</Elements>
</ArrayInfo>
<Format>
<Printf>%d.%d.%d.%d.%d.%d</Printf>
<Parameter>[0]</Parameter>
<Parameter>[1]</Parameter>
<Parameter>[2]</Parameter>
<Parameter>[3]</Parameter>
<Parameter>[4]</Parameter>
<Parameter>[5]</Parameter>
</Format>
</DataType>
<DataType>
<Name GUID="{F27C2E36-F71A-4739-B9BA-8A892874FECC}" PersistentType="true">VacEventClass</Name>
<DisplayName TxtId="">
Expand Down Expand Up @@ -84,20 +66,6 @@
<CLSID ClassFactory="TcPlc30">{08500001-0000-0000-F000-000000000064}</CLSID>
<Vars VarGrpType="1">
<Name>PlcTask Inputs</Name>
<Var>
<Name>LCLS_General.DefaultGlobals.stSys.I_EcatMaster1</Name>
<Comment>
<![CDATA[ AMS Net ID used for FB_EcatDiag, among others ]]>
</Comment>
<Type GUID="{18071995-0000-0000-0000-000000000041}">AMSNETID</Type>
</Var>
<Var>
<Name>LCLS_Vacuum_Serial.LCLS_Vacuum.Global_Variables.g_stSystem.I_EcatMaster1</Name>
<Comment>
<![CDATA[ AMS Net ID used for FB_EcatDiag, among others ]]>
</Comment>
<Type GUID="{18071995-0000-0000-0000-000000000041}">AMSNETID</Type>
</Var>
<Var>
<Name>PRG_Test.fb_VGC_Test.VGC.i_xOpnLS</Name>
<Comment>
Expand Down Expand Up @@ -220,13 +188,6 @@
</Comment>
<Type>INT</Type>
</Var>
<Var>
<Name>Global_Variables.g_stSystem.I_EcatMaster1</Name>
<Comment>
<![CDATA[ AMS Net ID used for FB_EcatDiag, among others ]]>
</Comment>
<Type GUID="{18071995-0000-0000-0000-000000000041}">AMSNETID</Type>
</Var>
</Vars>
<Vars VarGrpType="2">
<Name>PlcTask Outputs</Name>
Expand Down Expand Up @@ -369,13 +330,13 @@
<MappingInfo Identifier="{00000000-2001-0850-0020-500800205008}" Id="#x02030010"/>
<OwnerA Name="TIPC^L2SIVacuum^L2SIVacuum Instance">
<OwnerB Name="TIPC^L2SIVacuum^L2SIVacuum Instance">
<Link VarA="PlcTask Inputs^PRG_Test.fb_GPI_Test.fb_MKS317.i_iPRESS_R" VarB="PlcTask Outputs^PRG_Test.fb_GPI_Test.i_iPRESS_R"/>
<Link VarA="PlcTask Inputs^PRG_Test.fb_PTM_Test.fb_PTM_Ebara_010M.i_iTempMon" VarB="PlcTask Outputs^PRG_Test.fb_PTM_Test.i_iTempMon"/>
<Link VarA="PlcTask Inputs^PRG_Test.fb_PTM_Test.q_iSpeedSet" VarB="PlcTask Outputs^PRG_Test.fb_PTM_Test.i_diCurSpd"/>
<Link VarA="PlcTask Outputs^PRG_Test.fb_GCC_Test.i_iPRESS_R" VarB="PlcTask Inputs^PRG_Test.fb_GCC_Test.fb_MKS422.i_iPRESS_R"/>
<Link VarA="PlcTask Outputs^PRG_Test.fb_GPI_Test.i_iPRESS_R" VarB="PlcTask Inputs^PRG_Test.fb_GPI_Test.fb_MKS275.i_iPRESS_R"/>
<Link VarA="PlcTask Outputs^PRG_Test.fb_GPI_Test.i_iPRESS_R" VarB="PlcTask Inputs^PRG_Test.fb_GPI_Test.fb_MKS317.i_iPRESS_R"/>
<Link VarA="PlcTask Outputs^PRG_Test.fb_PTM_Test.i_diCurSpd" VarB="PlcTask Inputs^PRG_Test.fb_PTM_Test.q_iSpeedSet"/>
<Link VarA="PlcTask Outputs^PRG_Test.fb_PTM_Test.i_iCurrentMon" VarB="PlcTask Inputs^PRG_Test.fb_PTM_Test.fb_PTM_Ebara_010M.i_iCurrentMon"/>
<Link VarA="PlcTask Outputs^PRG_Test.fb_PTM_Test.i_iRawSpeed" VarB="PlcTask Inputs^PRG_Test.fb_PTM_Test.fb_PTM_Ebara_010M.i_iRawSpeed"/>
<Link VarA="PlcTask Outputs^PRG_Test.fb_PTM_Test.i_iTempMon" VarB="PlcTask Inputs^PRG_Test.fb_PTM_Test.fb_PTM_Ebara_010M.i_iTempMon"/>
</OwnerB>
</OwnerA>
</Mappings>
Expand Down
Loading