DUTs

GVLs

Global_Version

{attribute 'TcGenerated'}
// This function has been automatically generated from the project information.
VAR_GLOBAL CONSTANT
    {attribute 'const_non_replaced'}
    {attribute 'linkalways'}
    stLibVersion_txi_hxr_vac : ST_LibVersion := (iMajor := 1, iMinor := 0, iBuild := 4, iRevision := 0, sVersion := '1.0.4');
END_VAR

GVL_Interfaces

{attribute 'qualified_only'}
VAR_GLOBAL
    //Adding Interface with LFE VAC PLC, PC2L1_VGC reading PC2L1_PIP
    {attribute 'TcLinkTo' := 'TIID^Device 1 (EtherCAT)^Term 1 (EK1200)^E15 (EL6692)^IO Outputs^PC2L1_PIP_01_rPress'}
    PC2L1_PIP_01_Interface_rPress AT%Q*: REAL;
    {attribute 'TcLinkTo' := 'TIID^Device 1 (EtherCAT)^Term 1 (EK1200)^E15 (EL6692)^IO Outputs^PC2L1_PIP_01_AT_VAC'}
    PC2L1_PIP_01_Interface_xAT_VAC AT%Q*: BOOL;
    {attribute 'TcLinkTo' := 'TIID^Device 1 (EtherCAT)^Term 1 (EK1200)^E15 (EL6692)^IO Outputs^PC2L1_PIP_01_PRESS_OK'}
    PC2L1_PIP_01_Interface_xPRESS_OK AT%Q*: BOOL;
END_VAR

GVL_TXI_VAC_FS

VAR_GLOBAL
    fb_TV2L1_VFS_1 : FB_VFS;
END_VAR

GVL_TXI_VAC_FS_PMPS

VAR_GLOBAL
    {attribute 'pytmc' := '
        pv: PLC:TXI:LFE:VAC:FFO:02
    '}
    {attribute 'TcLinkTo' := '.q_xFastFaultOut:=TIIB[FFO]^Channel 2^Output'}
    g_FastFaultOutput2  :   FB_HardwareFFOutput:= (i_sNetID:='172.21.42.126.1.1');  //FFO for Fast Shutter Valves downstream of ST1L1
END_VAR

GVL_TXI_VAC_GAUGES

VAR_GLOBAL

// B940-008-L0S23-PNL-1 (Fee)
{attribute 'pytmc' := ' pv: ST1L1:PPS:GCC:01 '}
{attribute 'TcLinkTo' :=    '.i_iPRESS_R    := TIID^Device 1 (EtherCAT)^Term 1 (EK1200)^E16 (EK1122)^L0S23-PNL-1 EP1  (EP3174-0002)^ST1L1-GCC-01^Value;
                             .q_xHV_DIS             := TIID^Device 1 (EtherCAT)^Term 1 (EK1200)^E16 (EK1122)^L0S23-PNL-1 EP2 (EP2624-0002)^ST1L1-GCC-01^Output '}
fb_ST1L1_PPS_GCC_01: FB_MKS500;

{attribute 'pytmc' := ' pv: ST1L1:PPS:GPI:01 '}
{attribute 'TcLinkTo' :=    '.i_iPRESS_R    := TIID^Device 1 (EtherCAT)^Term 1 (EK1200)^E16 (EK1122)^L0S23-PNL-1 EP1  (EP3174-0002)^ST1L1-GPI-01^Value '}
fb_ST1L1_PPS_GPI_01: FB_MKS275;

// B950-100H1-L1S1-PNL-1 (H1.1)
{attribute 'pytmc' := ' pv: TV2L1:PLEG:GCC:01 '}
{attribute 'TcLinkTo' :=    '.i_iPRESS_R    := TIID^Device 1 (EtherCAT)^Term 1 (EK1200)^E17 (EK1122)^100H1-L1S01-EP2 (EP3174-0002)^TV2L1-GCC-1^Value';
                              .q_xHV_DIS            := TIID^Device 1 (EtherCAT)^Term 1 (EK1200)^E17 (EK1122)^100H1-L1S01-EP3 (EP2624-0002)^TV2L1-GCC-1^Output'}
fb_TV2L1_PLEG_GCC_01: FB_MKS500;
{attribute 'pytmc' := ' pv: TV2L1:PLEG:GPI:01 '}
{attribute 'TcLinkTo' :=    '.i_iPRESS_R    := TIID^Device 1 (EtherCAT)^Term 1 (EK1200)^E17 (EK1122)^100H1-L1S01-EP2 (EP3174-0002)^TV2L1-GPI-1^Value'}
fb_TV2L1_PLEG_GPI_01: FB_MKS275;

// B950-100H1-L1S3-DRL-1 (H1.1)
{attribute 'pytmc' := ' pv: TV4L1:PLEG:GCC:01 '}
{attribute 'TcLinkTo' :=    '.i_iPRESS_R    := TIID^Device 1 (EtherCAT)^Term 1 (EK1200)^E17 (EK1122)^100H1-L1S03-EP2 (EP3174-0002)^TV4L1-GCC-1^Value';
                                .q_xHV_DIS          := TIID^Device 1 (EtherCAT)^Term 1 (EK1200)^E17 (EK1122)^100H1-L1S03-EP3 (EP2624-0002)^TV4L1-GCC-1^Output'}
fb_TV4L1_PLEG_GCC_01: FB_MKS500;
{attribute 'pytmc' := ' pv: TV4L1:PLEG:GPI:01 '}
{attribute 'TcLinkTo' :=    '.i_iPRESS_R    := TIID^Device 1 (EtherCAT)^Term 1 (EK1200)^E17 (EK1122)^100H1-L1S03-EP2 (EP3174-0002)^TV4L1-GPI-1^Value'}
fb_TV4L1_PLEG_GPI_01: FB_MKS275;
{attribute 'pytmc' := ' pv: TV4L1:PLEG:GFS:01 '}
fb_TV4L1_PLEG_GFS_01 : FB_MKS422;

END_VAR

GVL_TXI_VAC_PUMPS

VAR_GLOBAL
//B940-009-R17-PCI-03
{attribute 'pytmc' := ' pv: ST1L1:PPS:PIP:01 '}
{attribute 'TcLinkTo' :=    '.i_iPRESS              := TIID^Device 1 (EtherCAT)^Term 1 (EK1200)^E8 (EL3064)^ST1L1_PIP_01^Value;
                              .q_xHVEna_DO  := TIID^Device 1 (EtherCAT)^Term 1 (EK1200)^E9 (EL2794)^ST1L1_PIP_01^Output;
                               .i_xSP_DI            := TIID^Device 1 (EtherCAT)^Term 1 (EK1200)^E10 (EL1004)^ST1L1_PIP_01^Input     '}
fb_ST1L1_PPS_PIP_01: FB_PIP_GAMMA;

{attribute 'pytmc' := ' pv: PC2L1:L2SI:PIP:01 '}
{attribute 'TcLinkTo' :=    '.i_iPRESS              := TIID^Device 1 (EtherCAT)^Term 1 (EK1200)^E8 (EL3064)^PC2L1_PIP_01^Value  ;
                               .q_xHVEna_DO         := TIID^Device 1 (EtherCAT)^Term 1 (EK1200)^E9 (EL2794)^PC2L1_PIP_01^Output     ;
                               .i_xSP_DI            := TIID^Device 1 (EtherCAT)^Term 1 (EK1200)^E10 (EL1004)^PC2L1_PIP_01^Input     '}
fb_PC2L1_L2SI_PIP_01: FB_PIP_GAMMA;

{attribute 'pytmc' := ' pv: TV2L1:PLEG:PIP:01 '}
{attribute 'TcLinkTo' :=    '.i_iPRESS              := TIID^Device 1 (EtherCAT)^Term 1 (EK1200)^E8 (EL3064)^TV2L1_PIP_01^Value  ;
                               .q_xHVEna_DO         := TIID^Device 1 (EtherCAT)^Term 1 (EK1200)^E9 (EL2794)^TV2L1_PIP_01^Output     ;
                                .i_xSP_DI           := TIID^Device 1 (EtherCAT)^Term 1 (EK1200)^E10 (EL1004)^TV2L1_PIP_01^Input     '}
fb_TV2L1_PLEG_PIP_01: FB_PIP_GAMMA;

{attribute 'pytmc' := ' pv: TV3L1:PLEG:PIP:01 '}
{attribute 'TcLinkTo' :=    '.i_iPRESS              := TIID^Device 1 (EtherCAT)^Term 1 (EK1200)^E8 (EL3064)^TV3L1_PIP_01^Value  ;
                               .q_xHVEna_DO         := TIID^Device 1 (EtherCAT)^Term 1 (EK1200)^E9 (EL2794)^TV3L1_PIP_01^Output     ;
                                .i_xSP_DI           := TIID^Device 1 (EtherCAT)^Term 1 (EK1200)^E10 (EL1004)^TV3L1_PIP_01^Input     '}
fb_TV3L1_PLEG_PIP_01: FB_PIP_GAMMA;

//B940-009-R17-PCI-04
{attribute 'pytmc' := ' pv: TV4L1:PLEG:PIP:01 '}
{attribute 'TcLinkTo' :=    '.i_iPRESS              := TIID^Device 1 (EtherCAT)^Term 1 (EK1200)^E11 (EL3064)^TV4L1_PIP_01^Value  ;
                               .q_xHVEna_DO         := TIID^Device 1 (EtherCAT)^Term 1 (EK1200)^E12 (EL2794)^TV4L1_PIP_01^Output ;
                                .i_xSP_DI           := TIID^Device 1 (EtherCAT)^Term 1 (EK1200)^E13 (EL1004)^TV4L1_PIP_01^Input     '}
fb_TV4L1_PLEG_PIP_01: FB_PIP_GAMMA;

END_VAR

GVL_TXI_VAC_VALVES

VAR_GLOBAL
{attribute 'TcLinkTo' :=    '.i_xOpnLS      :=      TIID^Device 1 (EtherCAT)^Term 1 (EK1200)^E17 (EK1122)^100H1-L1S01-EP1 (EP2338-0002)^Channel 1^Input;
                             .i_xClsLS      :=      TIID^Device 1 (EtherCAT)^Term 1 (EK1200)^E17 (EK1122)^100H1-L1S01-EP1 (EP2338-0002)^Channel 2^Input;
                             .q_xOPN_DO     :=      TIID^Device 1 (EtherCAT)^Term 1 (EK1200)^E17 (EK1122)^100H1-L1S01-EP1 (EP2338-0002)^Channel 11^Output'}
{attribute 'pytmc' := ' pv: TV2L1:PLEG:VGC:01 '}
fb_TV2L1_PLEG_VGC_01: FB_VGC;

{attribute 'TcLinkTo' :=    '.i_xOpnLS      :=      TIID^Device 1 (EtherCAT)^Term 1 (EK1200)^E17 (EK1122)^100H1-L1S03-EP1 (EP2338-0002)^Channel 1^Input;
                             .i_xClsLS      :=      TIID^Device 1 (EtherCAT)^Term 1 (EK1200)^E17 (EK1122)^100H1-L1S03-EP1 (EP2338-0002)^Channel 2^Input;
                             .q_xOPN_DO     :=      TIID^Device 1 (EtherCAT)^Term 1 (EK1200)^E17 (EK1122)^100H1-L1S03-EP1 (EP2338-0002)^Channel 11^Output'}
{attribute 'pytmc' := ' pv: TV4L1:PLEG:VGC:01 '}
fb_TV4L1_PLEG_VGC_01: FB_VGC;
END_VAR

GVL_Variables

VAR_GLOBAL
{attribute 'pytmc' := 'pv: TXI:LFE:VAC:OVRDON;
    field: ZNAM Override OFF;
    field: ONAM Override ON;
    io: io;
'}
xSystemOverrideMode1 : BOOL; (* Global system override for the prototype section*)

{attribute 'pytmc' := ' pv: PLC:TXI:LFE:VAC:FFO:01 '}
{attribute 'TcLinkTo' := '.q_xFastFaultOut:=TIIB[FFO]^Channel 1^Output'}
g_FastFaultOutput1  :   FB_HardwareFFOutput:= (i_sNetID:='172.21.42.126.1.1'); // change i_sNetID ??

{attribute 'pytmc' := ' pv: PLC:TXI:VAC:ARB:01 '}
fbArbiter1 : FB_Arbiter(1);

fbLogHandler : FB_loghandler;

END_VAR

POUs

MAIN

PROGRAM MAIN
VAR
fbArbiterIO: FB_SubSysToArbiter_IO;
fb_vetoArbiter: FB_VetoArbiter;
END_VAR
PRG_TXI_VAC_GAUGES();
PRG_TXI_VAC_PUMPS();
PRG_TXI_VAC_VALVES();

fbArbiterIO(i_bVeto:=  PMPS_GVL.stCurrentBeamParameters.aVetoDevices[PMPS.L_Stopper.ST1L1],
    Arbiter:= fbArbiter1,
    fbFFHWO:= g_FastFaultOutput1);

g_FastFaultOutput1.bAutoReset := TRUE;

fbArbiter1.AddRequest(nReqID := 16#FAFC, stReqBp := PMPS_GVL.cstFullBeam, sDevName := 'plc-txi-hxr-vac');

g_FastFaultOutput1.Execute(i_xVeto := PMPS_GVL.stCurrentBeamParameters.aVetoDevices[PMPS.L_Stopper.ST1L1]);

END_PROGRAM
Related:

PRG_TXI_VAC_FS

PROGRAM PRG_TXI_VAC_FS
VAR
END_VAR
//Fast Shutter Valve
fb_TV2L1_VFS_1(
    i_xVeto_Enable:=False,
    i_xPMPS_OK:= TRUE,
    i_xExt_OK:= TRUE,
    i_sDevName:= 'TV2L1:VFS:1',
    io_fbFFHWO:= g_FastFaultOutput2
);
(*FastFaultOuput*)
g_FastFaultOutput2.Execute(bAutoReset:= TRUE);

END_PROGRAM

PRG_TXI_VAC_GAUGES

PROGRAM PRG_TXI_VAC_GAUGES
VAR
    bm_dummy_gauge: ST_VG;
END_VAR
//beamline dummy gauge
bm_dummy_gauge.xPRESS_OK := TRUE;
bm_dummy_gauge.xAT_VAC := TRUE;
bm_dummy_gauge.eState := ValidLo;
bm_dummy_gauge.rPRESS := 1e-4;


// B940-008-L0S23-PNL-1
fb_ST1L1_PPS_GPI_01(PG=>);
fb_ST1L1_PPS_GCC_01(PG := fb_ST1L1_PPS_GPI_01.PG, bEP := TRUE);
// B950-100H1-L1S1-PNL-1 (H1.1)
fb_TV2L1_PLEG_GPI_01(PG=>);
fb_TV2L1_PLEG_GCC_01(PG := fb_TV2L1_PLEG_GPI_01.PG, bEP := TRUE);
// B950-100H1-L1S3-DRL-1(H1.1)
fb_TV4L1_PLEG_GPI_01(PG=>);
fb_TV4L1_PLEG_GCC_01(PG := fb_TV4L1_PLEG_GPI_01.PG, bEP := TRUE);
//MKS422
fb_TV4L1_PLEG_GFS_01(PG := bm_dummy_gauge);

END_PROGRAM

PRG_TXI_VAC_PUMPS

PROGRAM PRG_TXI_VAC_PUMPS
VAR
    dummy_gauge : ST_VG;
END_VAR
//beamline dummy gauge
dummy_gauge.xPRESS_OK := TRUE;
dummy_gauge.xAT_VAC := TRUE;
dummy_gauge.eState := ValidLo;
dummy_gauge.rPRESS := 1e-4;

//B940-009-R17-PCI-03
fb_PC2L1_L2SI_PIP_01(i_stGauge := dummy_gauge, i_xOverrideMode := xSystemOverrideMode1);
GVL_Interfaces.PC2L1_PIP_01_Interface_rPress := fb_PC2L1_L2SI_PIP_01.q_IG.rPRESS;
GVL_Interfaces.PC2L1_PIP_01_Interface_xAT_VAC := fb_PC2L1_L2SI_PIP_01.q_IG.xAT_VAC;
GVL_Interfaces.PC2L1_PIP_01_Interface_xPRESS_OK := fb_PC2L1_L2SI_PIP_01.q_IG.xPRESS_OK;

fb_ST1L1_PPS_PIP_01(i_stGauge := fb_ST1L1_PPS_GPI_01.PG, i_xOverrideMode := xSystemOverrideMode1);
fb_TV2L1_PLEG_PIP_01(i_stGauge := fb_TV2L1_PLEG_GPI_01.PG, i_xOverrideMode := xSystemOverrideMode1);
fb_TV3L1_PLEG_PIP_01(i_stGauge := fb_TV2L1_PLEG_GPI_01.PG, i_xOverrideMode := xSystemOverrideMode1);

//B940-009-R17-PCI-04
fb_TV4L1_PLEG_PIP_01(i_stGauge := fb_TV4L1_PLEG_GPI_01.PG, i_xOverrideMode := xSystemOverrideMode1);

END_PROGRAM
Related:

PRG_TXI_VAC_VALVES

PROGRAM PRG_TXI_VAC_VALVES
VAR
END_VAR
fb_TV2L1_PLEG_VGC_01(
    i_stUSG := fb_ST1L1_PPS_PIP_01.q_IG,
    i_stDSG := fb_TV2L1_PLEG_PIP_01.q_IG,
    i_xDis_DPIlk := FALSE,
    i_xEPS_OK := TRUE,
    i_xPMPS_OK := TRUE,
    i_xExt_OK := TRUE,
    i_xOverrideMode := xSystemOverrideMode1,
    io_fbFFHWO := g_FastFaultOutput1,
    fbArbiter := fbArbiter1
);

fb_TV4L1_PLEG_VGC_01(
    i_stUSG := fb_TV3L1_PLEG_PIP_01.q_IG,
    i_stDSG := fb_TV4L1_PLEG_PIP_01.q_IG,
    i_xDis_DPIlk := FALSE,
    i_xEPS_OK := TRUE,
    i_xPMPS_OK := TRUE,
    i_xExt_OK := TRUE,
    i_xOverrideMode := xSystemOverrideMode1,
    io_fbFFHWO := g_FastFaultOutput1,
    fbArbiter := fbArbiter1
);

//Fast Shutter Valve interface
 //fb_TV2L1_PLEG_VFS_Interface(IG:=fb_TV2L1_PLEG_GFS_01, iq_stValve=> , Veto_Valve:= , i_xVAC_FAULT_OK=>);

END_PROGRAM