From a9aa2477538c9c7ed31dd8211d02e04660e85a3a Mon Sep 17 00:00:00 2001 From: Margaret Ghaly Date: Fri, 10 Jul 2020 16:46:42 -0700 Subject: [PATCH 1/5] WIP: PIP remove the wait timer --- L2SIVacuum/POUs/Functions/Pumps/FB_PIP_Gamma.TcPOU | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/L2SIVacuum/POUs/Functions/Pumps/FB_PIP_Gamma.TcPOU b/L2SIVacuum/POUs/Functions/Pumps/FB_PIP_Gamma.TcPOU index 9a88e00..31cef00 100644 --- a/L2SIVacuum/POUs/Functions/Pumps/FB_PIP_Gamma.TcPOU +++ b/L2SIVacuum/POUs/Functions/Pumps/FB_PIP_Gamma.TcPOU @@ -59,7 +59,7 @@ IF i_stGauge.rPRESS <= stPump.rHVEna_SP AND i_stGauge.xPRESS_OK THEN ELSE stPump.q_xHVEna_DO := stPump.xHVEna_SW; END_IF stPump.xILKOk:= TRUE; -ELSIF stPump.q_xHVEna_DO AND timer.Q THEN +ELSIF stPump.q_xHVEna_DO (*AND timer.Q*) THEN IF q_IG.rPRESS > (stPump.rHVEna_SP + stPump.rHYS_PR) THEN // Ion pumps when running switches off based on their own pressure readings stPump.q_xHVEna_DO := FALSE; stPump.xHVEna_SW := FALSE; From b987e7d961d9c26aa0e93e91b23406db7fab42ba Mon Sep 17 00:00:00 2001 From: Margaret Ghaly Date: Fri, 10 Jul 2020 16:51:07 -0700 Subject: [PATCH 2/5] WIP: FB_VGC iPMPS permissions --- L2SIVacuum/POUs/Functions/Valves/FB_VGC.TcPOU | 38 ++++++++++++------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/L2SIVacuum/POUs/Functions/Valves/FB_VGC.TcPOU b/L2SIVacuum/POUs/Functions/Valves/FB_VGC.TcPOU index 28b6682..25c8e9b 100644 --- a/L2SIVacuum/POUs/Functions/Valves/FB_VGC.TcPOU +++ b/L2SIVacuum/POUs/Functions/Valves/FB_VGC.TcPOU @@ -80,6 +80,8 @@ VAR tonDelOK : TON; rtOK : R_TRIG; tonOvrd : TON; + rtOpen : R_TRIG; + ftClose: F_TRIG; tDelOK : TIME := T#60S; tOvrd : TIME := T#10s; @@ -292,28 +294,33 @@ IF NOT (i_xOverrideMode) THEN iq_stValve.pv_xOvrdOpn :=FALSE; END_IF //Override timer tonOvrd(IN:=iq_stValve.pv_xOvrdOpn, PT:=tOvrd); -(* If Epics Command to close the Valve while it was open, check if PMPS and EPS are ok, otherwise Keep command set to open valve *) -IF NOT(iq_stValve.pv_xOPN_SW) AND (iq_stValve.eState =OPEN) AND (NOT (i_xPMPS_OK) OR (i_xEPS_OK)) THEN - //iq_stValve.pv_xOPN_SW := TRUE; // plc to only reset never to set this signal -END_IF -(* Reset the EPICS command to open the valve if the interlock is lost *) -(* based on EPS ok state, EPS overrides OPN_OK*) -IF NOT iq_stValve.xOPN_OK THEN - IF i_xEPS_OK THEN iq_stValve.pv_xOPN_SW := FALSE; iq_stValve.sErrorMessage := 'ILK Active'; - ELSE //iq_stValve.pv_xOPN_SW := TRUE; // plc to only reset never to set this signal + +(* Valve operation *) +(* Here's where we evaluate sw actions and operate the valve *) +(* Valve operation *) + +ftClose(CLK:= iq_stValve.pv_xOPN_SW); +rtOpen(CLK:= iq_stValve.pv_xOPN_SW); +(*when interlock is lost the Valve closes regarldess of the status of the PMPS and EPS*) +IF NOT (iq_stValve.xOPN_OK) THEN + iq_stValve.pv_xOPN_SW:= FALSE; // Reset switch after inlk is lost + iq_stValve.q_xOPN_DO := (iq_stValve.pv_xOPN_SW AND iq_stValve.xOPN_OK) OR (tonOvrd.Q AND i_xOverrideMode); +ELSIF i_xPMPS_OK THEN + iq_stValve.q_xOPN_DO := (iq_stValve.pv_xOPN_SW AND iq_stValve.xOPN_OK) OR (tonOvrd.Q AND i_xOverrideMode); +ELSIF NOT (i_xPMPS_OK) THEN + IF (tonOvrd.Q AND i_xOverrideMode) THEN // Only override mode + iq_stValve.q_xOPN_DO := (tonOvrd.Q AND i_xOverrideMode); END_IF END_IF -(* Here's where the valve opens *) -iq_stValve.q_xOPN_DO := (iq_stValve.pv_xOPN_SW AND iq_stValve.xOPN_OK) OR (tonOvrd.Q AND i_xOverrideMode); (*MPS Fault setting*) If (i_xIsAperture ) THEN (* When the valve is open or in Closed position MPS is OK, Fault while moving*) - xMPS_OK := i_xOpnLS XOR i_xClsLS; //(iq_stValve.eState=OPEN) OR (iq_stValve.eState=OPEN_F) OR (iq_stValve.eState=CLOSED);//iq_stValve.i_xOpnLS; + xMPS_OK := i_xOpnLS XOR i_xClsLS; ELSE (* When the valve is open MPS is OK*) - xMPS_OK := i_xOpnLS; //(iq_stValve.eState=OPEN) OR (iq_stValve.eState=OPEN_F);//iq_stValve.i_xOpnLS; + xMPS_OK := i_xOpnLS AND NOT i_xClsLS AND q_xOPN_DO; END_IF @@ -503,7 +510,10 @@ END_VAR - + + + + From daa6459f5f233fe672816c2391285e25434c2e7f Mon Sep 17 00:00:00 2001 From: Margaret Ghaly Date: Mon, 13 Jul 2020 18:38:18 -0700 Subject: [PATCH 3/5] FIX: Issue #54 --- .../Functions/Valves/Interfaces/FB_VFS_Interface.TcPOU | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/L2SIVacuum/POUs/Functions/Valves/Interfaces/FB_VFS_Interface.TcPOU b/L2SIVacuum/POUs/Functions/Valves/Interfaces/FB_VFS_Interface.TcPOU index 226fe22..f0e9fd0 100644 --- a/L2SIVacuum/POUs/Functions/Valves/Interfaces/FB_VFS_Interface.TcPOU +++ b/L2SIVacuum/POUs/Functions/Valves/Interfaces/FB_VFS_Interface.TcPOU @@ -6,13 +6,16 @@ FUNCTION_BLOCK FB_VFS_Interface EXTENDS FB_Valve VAR_INPUT IG : ST_VG; // The MKS422 Cold Cathode Data Structure - END_VAR -VAR +VAR_OUTPUT {attribute 'pytmc' := ' pv: ; '} iq_stValve : ST_VFS; (* All valve data and states will be in this struct*) + i_xVAC_FAULT_OK AT%I*: BOOL; (*Valve Vacuum OK, is set to False when there is Vacuum Fault*) +END_VAR +VAR + tonOvrd : TON; tOvrd : TIME := T#10s; (*outputs*) @@ -27,7 +30,6 @@ VAR i_xTrigger AT %I* : BOOL; i_xVFS_Open AT %I* : BOOL; i_xVFS_Closed AT %I* : BOOL; - i_xVAC_FAULT_OK AT%I*: BOOL; (*Valve Vacuum OK, is set to False when there is Vacuum Fault*) {attribute 'pytmc' := ' pv: MPS_FAULT_OK field: ZNAM MPS FAULT ; From 9eaf1889cc331ddb333cbb75497964dfc9f73542 Mon Sep 17 00:00:00 2001 From: Margaret Ghaly Date: Tue, 14 Jul 2020 16:05:42 -0700 Subject: [PATCH 4/5] ENH: Add sPath for interlock --- L2SIVacuum/POUs/Functions/Pumps/FB_PIP_Gamma.TcPOU | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/L2SIVacuum/POUs/Functions/Pumps/FB_PIP_Gamma.TcPOU b/L2SIVacuum/POUs/Functions/Pumps/FB_PIP_Gamma.TcPOU index 31cef00..968a399 100644 --- a/L2SIVacuum/POUs/Functions/Pumps/FB_PIP_Gamma.TcPOU +++ b/L2SIVacuum/POUs/Functions/Pumps/FB_PIP_Gamma.TcPOU @@ -3,6 +3,7 @@ @@ -216,7 +221,9 @@ stPump.xError := (stPump.eState = pumpFAULT); stPump.i_iPRESS:= i_iPRESS; stPump.i_xHV_DI:= i_xSP_DI; (*output*) -q_xHVEna_DO:= stPump.q_xHVEna_DO; //According to Manual pin should be grounded to activate function]]> +q_xHVEna_DO:= stPump.q_xHVEna_DO; //According to Manual pin should be grounded to activate function + + This^.stPump.sPath:= sPath;]]> @@ -272,6 +279,8 @@ this^.stPump.xHVEna_SW := run;]]> + + From 8c09fc7cd07bb5bce6d0e658433827bd3a009086 Mon Sep 17 00:00:00 2001 From: Margaret Ghaly Date: Tue, 14 Jul 2020 16:08:54 -0700 Subject: [PATCH 5/5] FIX: State error latch --- L2SIVacuum/POUs/Functions/Valves/FB_VGC.TcPOU | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/L2SIVacuum/POUs/Functions/Valves/FB_VGC.TcPOU b/L2SIVacuum/POUs/Functions/Valves/FB_VGC.TcPOU index 25c8e9b..3de1a96 100644 --- a/L2SIVacuum/POUs/Functions/Valves/FB_VGC.TcPOU +++ b/L2SIVacuum/POUs/Functions/Valves/FB_VGC.TcPOU @@ -250,7 +250,7 @@ CASE iq_stValve.eVGC_State OF END_IF ERR_ExtFault: - IF NOT (iq_stValve.xERR_ExtFault) AND (NOT i_xExt_OK) THEN + IF NOT (iq_stValve.xERR_ExtFault) AND (i_xExt_OK) THEN IF iq_stValve.xAT_VAC AND (NOT (iq_stValve.xERR_DifPres)) AND (NOT (iq_stValve.xERR_SP)) AND (NOT (iq_stValve.xERR_ExtFault))THEN iq_stValve.eVGC_State := AtVacuum; ELSE @@ -308,9 +308,8 @@ IF NOT (iq_stValve.xOPN_OK) THEN ELSIF i_xPMPS_OK THEN iq_stValve.q_xOPN_DO := (iq_stValve.pv_xOPN_SW AND iq_stValve.xOPN_OK) OR (tonOvrd.Q AND i_xOverrideMode); ELSIF NOT (i_xPMPS_OK) THEN - IF (tonOvrd.Q AND i_xOverrideMode) THEN // Only override mode - iq_stValve.q_xOPN_DO := (tonOvrd.Q AND i_xOverrideMode); - END_IF + // Only override mode + iq_stValve.q_xOPN_DO := (tonOvrd.Q AND i_xOverrideMode); END_IF @@ -455,6 +454,7 @@ IF tOverrideActivated.Q THEN fbLogger(sMsg:='Valve override mode activated', eSe - + + @@ -548,7 +549,9 @@ END_VAR - + + +