Skip to content

Commit

Permalink
Merge pull request #15 from ghalym/master
Browse files Browse the repository at this point in the history
Fixing some issues found during checkouts
  • Loading branch information
slacAdpai authored Mar 3, 2020
2 parents 7ae7b1a + 40b6986 commit e7b4882
Show file tree
Hide file tree
Showing 18 changed files with 339 additions and 125 deletions.
11 changes: 11 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
*.tsproj text eol=crlf
*.plcproj text eol=crlf
*.tmc text eol=crlf
*.xti text eol=crlf
*.TcTTO text eol=crlf
*.TcPOU text eol=crlf
*.TcDUT text eol=crlf
*.TcGVL text eol=crlf
*.TcVis text eol=crlf
*.TcVMO text eol=crlf
*.TcGTLO text eol=crlf
24 changes: 21 additions & 3 deletions L2SIVacuum/DUTs/Gauges/ST_VG.TcDUT
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.12">
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4022.18">
<DUT Name="ST_VG" Id="{e8999049-eca7-4ca1-9a7c-26918f6aba1e}">
<Declaration><![CDATA[TYPE ST_VG :
STRUCT
Expand All @@ -18,6 +18,8 @@ STRUCT
{attribute 'pytmc' := '
pv: AT_VAC;
io: i;
field: ZNAM FALSE;
field: ONAM TRUE;
'}
xAT_VAC: BOOL;
{attribute 'pytmc' := '
Expand All @@ -36,8 +38,8 @@ STRUCT
{attribute 'pytmc' := '
pv: HV_SW;
io: io;
field: ZNAM Off;
field: ONAM On;
field: ZNAM OFF;
field: ONAM ON;
'}
xHV_SW: BOOL; // High Voltage Switch from epics
Expand All @@ -62,6 +64,8 @@ STRUCT
{attribute 'pytmc' := '
pv: HV_DIS_DO;
io: i;
field: ZNAM FALSE ;
field: ONAM TRUE ;
'}
q_xHV_DIS : BOOL; // Enable High Voltage when True
//
Expand All @@ -84,22 +88,36 @@ STRUCT
{attribute 'pytmc' := '
pv: VAC_SP;
io:io;
field: HOPR 1000
field: LOPR 0
field: PREC 2
field: EGU "TORR"
'}
rVAC_SP: REAL := 0.001; /// At vacuum setpoint for all gauges
/// Protection setpoint for ion gauges at which the gauge turns off, not used for pirani
{attribute 'pytmc' := '
pv: PRO_SP;
io: io;
field: HOPR 1000
field: LOPR 0
field: PREC 2
field: EGU "TORR"
'}
rPRO_SP: REAL := 0.001;
{attribute 'pytmc' := '
pv: SP_HYS;
io: io;
field: HOPR 1000
field: LOPR 0
field: PREC 2
field: EGU "TORR"
'}
/// Protection setpoint hysteresis
rHYS_PR: REAL := 0.001;
{attribute 'pytmc' := '
pv: ILK_OK;
field: ZNAM NOT OK ;
field: ONAM OK ;
io: i;
'}
xILKOk : BOOL; (* also a control *)
Expand Down
6 changes: 3 additions & 3 deletions L2SIVacuum/DUTs/Pumps/E_PumpState.TcDUT
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.4020.12">
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4022.18">
<DUT Name="E_PumpState" Id="{cd10f6fd-e32a-457c-9058-4461bcc9d005}">
<Declaration><![CDATA[TYPE E_PumpState :
(
pumpSTOPPED := 0,
pumpSTARTING := 1,
pumpRUNNING := 2,
pumpFAULT := 3
pumpFAULT := 3,
pumpSTOPPING :=4
);
END_TYPE
]]></Declaration>
Expand Down
6 changes: 3 additions & 3 deletions L2SIVacuum/DUTs/Pumps/ST_KashiyamaDryPump.TcDUT
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.16">
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4022.18">
<DUT Name="ST_KashiyamaDryPump" Id="{ea7dbd39-0b45-44ec-97c9-3ee5cc59d920}">
<Declaration><![CDATA[TYPE ST_KashiyamaDryPump EXTENDS ST_RoughPump:
STRUCT
Expand Down Expand Up @@ -27,12 +27,12 @@ STRUCT
pv: ALARM_OK
io: i
'}
i_xAlarm : BOOL;
i_xAlarmOK : BOOL;
{attribute 'pytmc' := '
pv: WARN_OK
io: i
'}
i_xWarning : BOOL;
i_xWarningOK : BOOL;
{attribute 'pytmc' := '
pv: RUN_DI
io: i
Expand Down
42 changes: 36 additions & 6 deletions L2SIVacuum/DUTs/Pumps/ST_PIP.TcDUT
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,43 @@ STRUCT
field: ONAM OK ;
io: i;
'}
xHV_ExtIlk : BOOL;
xILKOk : BOOL;
{attribute 'pytmc' := '
pv: AT_VAC_SP;
io: io;
field: HOPR 1000
field: LOPR 0
field: PREC 2
field: EGU "TORR"
'}
rHVEna_SP : REAL := 1.0E-4;
(* EPICS Controls *)
{attribute 'pytmc' := '
pv: HV_SW;
io: io;
field: ZNAM Off;
field: ONAM On;
field: ZNAM OFF;
field: ONAM ON;
'}
xHVEna_SW : BOOL;
{attribute 'pytmc' := '
pv: SP_HYS;
io: io;
field: HOPR 1000
field: LOPR 0
field: PREC 2
field: EGU "TORR"
'}
/// Protection setpoint hysteresis
rHYS_PR: REAL := 0.001;
(* IO Controls *)
{attribute 'pytmc' := '
pv: HV_DO;
field: ZNAM OFF;
field: ONAM ON;
io: i;
'}
q_xHVEna_DO : BOOL; // Enable High Voltage when True // 'TcLinkTo' (EL1124) ^Input
Expand All @@ -50,12 +68,24 @@ STRUCT
'}
i_iPRESS: REAL; //
{attribute 'pytmc' := '
pv: SP_DI;
pv: HV_DI;
field: ZNAM FALSE;
field: ONAM TRUE;
io:i;
'}
i_xSP_DI : BOOL; // NO contact // 'TcLinkTo' (EL1004) ^Input
i_xHV_DI : BOOL; // NO contact // 'TcLinkTo' (EL1004) ^Input
{attribute 'pytmc' := '
pv: STATE;
field: ZRST STOPPED;
field: ONST STARTING;
field: TWST RUNNING;
field: THST FAULT;
field: FRST STOPPING;
io: i;
'}
eState : E_PumpState;
END_STRUCT
END_TYPE]]></Declaration>
Expand Down
8 changes: 8 additions & 0 deletions L2SIVacuum/DUTs/Pumps/ST_PTM.TcDUT
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,19 @@ NOTE: This is an archetype, use an extension of this structure for a specific pu
{attribute 'pytmc' := '
pv: BP_SP;
io: io;
field: HOPR 1000
field: LOPR 0
field: PREC 2
field: EGU "TORR"
'}
rBackingPressureSP : REAL := 0.01;
{attribute 'pytmc' := '
pv: IP_SP;
io: io;
field: HOPR 1000
field: LOPR 0
field: PREC 2
field: EGU "TORR"
'}
rInletPressureSP : REAL := 0.02; //20mTorr
(*State*)
Expand Down
3 changes: 1 addition & 2 deletions L2SIVacuum/DUTs/Valves/ST_VCN.TcDUT
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,11 @@ STRUCT
rReqPosition : REAL; //Requested position (0.0-100.0%)
{attribute 'pytmc' := '
pv: STATE ;
type: mbbi ;
field: ZRST Close ;
field: ONST Open;
field: TWST PressureControl ;
field: THST ManualControl ;
io: i
io: io
'}
eValveControl : E_VCN := CloseValve; // Valve control state
Expand Down
12 changes: 11 additions & 1 deletion L2SIVacuum/DUTs/Valves/ST_VGC.TcDUT
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.16">
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4022.18">
<DUT Name="ST_VGC" Id="{0b7dfc27-9760-4c7a-bad2-fa375ac628b8}">
<Declaration><![CDATA[TYPE ST_VGC :
STRUCT
Expand Down Expand Up @@ -56,6 +56,8 @@ STRUCT
{attribute 'pytmc' := '
pv: OPN_DO;
io: i;
field: ZNAM FALSE;
field: ONAM TRUE;
'}
q_xOPN_DO : BOOL;
Expand Down Expand Up @@ -88,12 +90,20 @@ STRUCT
{attribute 'pytmc' := '
pv: AT_VAC_SP;
io: o;
field: HOPR 1000
field: LOPR 0
field: PREC 2
field: EGU "TORR"
'}
rAT_VAC_SP : REAL := 0.01; // Interlock setpoint for gauges on both sides of valve
rAT_VAC_SP_LAST : REAL :=0.01 ; // Interlock setpoint for gauges on both sides of valve
{attribute 'pytmc' := '
pv: AT_VAC_HYS;
io: o;
field: HOPR 1000
field: LOPR 0
field: PREC 2
field: EGU "TORR"
'}
rAT_VAC_HYS : REAL :=0.01; // Hysteresis of the vacuum sp
{attribute 'pytmc' := '
Expand Down
41 changes: 40 additions & 1 deletion L2SIVacuum/L2SIVacuum.plcproj
Original file line number Diff line number Diff line change
Expand Up @@ -369,17 +369,56 @@
</ItemGroup>
<ItemGroup>
<PlaceholderResolution Include="LCLS General">
<Resolution>LCLS General, 0.0.0 (SLAC)</Resolution>
<Resolution>LCLS General, * (SLAC)</Resolution>
</PlaceholderResolution>
<PlaceholderResolution Include="PMPS">
<Resolution>PMPS, * (SLAC - LCLS)</Resolution>
</PlaceholderResolution>
<PlaceholderResolution Include="Standard">
<Resolution>Standard, * (System)</Resolution>
</PlaceholderResolution>
<PlaceholderResolution Include="Tc2_DataExchange">
<Resolution>Tc2_DataExchange, * (Beckhoff Automation GmbH)</Resolution>
</PlaceholderResolution>
<PlaceholderResolution Include="Tc2_EtherCAT">
<Resolution>Tc2_EtherCAT, * (Beckhoff Automation GmbH)</Resolution>
</PlaceholderResolution>
<PlaceholderResolution Include="Tc2_Math">
<Resolution>Tc2_Math, * (Beckhoff Automation GmbH)</Resolution>
</PlaceholderResolution>
<PlaceholderResolution Include="Tc2_MC2">
<Resolution>Tc2_MC2, * (Beckhoff Automation GmbH)</Resolution>
</PlaceholderResolution>
<PlaceholderResolution Include="Tc2_ModbusSrv">
<Resolution>Tc2_ModbusSrv, * (Beckhoff Automation GmbH)</Resolution>
</PlaceholderResolution>
<PlaceholderResolution Include="Tc2_Standard">
<Resolution>Tc2_Standard, * (Beckhoff Automation GmbH)</Resolution>
</PlaceholderResolution>
<PlaceholderResolution Include="Tc2_System">
<Resolution>Tc2_System, * (Beckhoff Automation GmbH)</Resolution>
</PlaceholderResolution>
<PlaceholderResolution Include="Tc2_TcpIp">
<Resolution>Tc2_TcpIp, * (Beckhoff Automation GmbH)</Resolution>
</PlaceholderResolution>
<PlaceholderResolution Include="Tc2_Utilities">
<Resolution>Tc2_Utilities, * (Beckhoff Automation GmbH)</Resolution>
</PlaceholderResolution>
<PlaceholderResolution Include="Tc3_EventLogger">
<Resolution>Tc3_EventLogger, * (Beckhoff Automation GmbH)</Resolution>
</PlaceholderResolution>
<PlaceholderResolution Include="Tc3_JsonXml">
<Resolution>Tc3_JsonXml, * (Beckhoff Automation GmbH)</Resolution>
</PlaceholderResolution>
<PlaceholderResolution Include="Tc3_Module">
<Resolution>Tc3_Module, * (Beckhoff Automation GmbH)</Resolution>
</PlaceholderResolution>
<PlaceholderResolution Include="TcUnit">
<Resolution>TcUnit, * (www.tcunit.org)</Resolution>
</PlaceholderResolution>
<PlaceholderResolution Include="UML State Chart Types">
<Resolution>UML Statechart Types, * (3S - Smart Software Solutions GmbH)</Resolution>
</PlaceholderResolution>
</ItemGroup>
<ProjectExtensions>
<PlcProjectOptions>
Expand Down
37 changes: 23 additions & 14 deletions L2SIVacuum/L2SIVacuum.tmc

Large diffs are not rendered by default.

Binary file removed L2SIVacuum/LineIDs.dbg
Binary file not shown.
4 changes: 4 additions & 0 deletions L2SIVacuum/POUs/Functions/Gauges/Interfaces/FB_TGCC_ADS.TcPOU
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,9 @@ bError:= fb_Read_VG.bError OR fb_CheckWatchdog.bWatchdog;
]]></ST>
</Implementation>
<LineIds Name="FB_TGCC_ADS">
<LineId Id="3" Count="27" />
<LineId Id="2" Count="0" />
</LineIds>
</POU>
</TcPlcObject>
12 changes: 6 additions & 6 deletions L2SIVacuum/POUs/Functions/Pumps/FB_KashiyamaPump.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.12">
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4022.18">
<POU Name="FB_KashiyamaPump" Id="{c252a3ee-f366-44ed-9d74-8c0f474d15b1}" SpecialFunc="None">
<Declaration><![CDATA[(* This function block does basic controls FOR the Kashiyama pump. Turns off pump
in the event of errors/ warnings. Provides interlocking interface.*)
Expand Down Expand Up @@ -33,7 +33,7 @@ END_VAR
<Implementation>
<ST><![CDATA[
//Kashiyama Dry pump outputs at high level indicate no warning, no alarm and remotely
q_stPump.xIlkOK := q_stPump.i_xLocal AND q_stPump.i_xWarning AND q_stPump.i_xAlarm;
q_stPump.xIlkOK := q_stPump.i_xLocal AND q_stPump.i_xWarningOK AND q_stPump.i_xAlarmOK;
IF q_stPump.xIlkOK THEN
q_stPump.q_xRunDO := q_stPump.pv_xRunSW;
Expand Down Expand Up @@ -63,9 +63,9 @@ TONtmr (IN := q_stPump.i_xIsRun, PT := T#20S);
q_stPump.RdyTmr := TO_REAL(TONtmr.PT) - TO_REAL(TONtmr.ET);
(*State evaluation*)
IF q_stPump.i_xAlarm THEN
IF NOT q_stPump.i_xAlarmOK THEN
q_stPump.eState := pumpFAULT;
ELSIF NOT q_stPump.q_xRunDo AND NOT(q_stPump.i_xAlarm) THEN
ELSIF NOT q_stPump.q_xRunDo AND q_stPump.i_xAlarmOK THEN
q_stPump.eState := pumpSTOPPED;
ELSIF NOT q_stPump.q_xRunDo AND NOT q_stPump.i_xIsRun THEN
q_stPump.eState := pumpSTARTING;
Expand All @@ -87,8 +87,8 @@ ACT_IO();]]></ST>
(* Input *)
q_stPump.i_xLocal := i_xLocal;
q_stPump.i_xAlarm := i_xAlarm;
q_stPump.i_xWarning := i_xWarning;
q_stPump.i_xAlarmOK := i_xAlarm;
q_stPump.i_xWarningOK := i_xWarning;
q_stPump.i_xIsRun := i_xIsRun;]]></ST>
</Implementation>
</Action>
Expand Down
Loading

0 comments on commit e7b4882

Please sign in to comment.