diff --git a/GratingMonoScope/VSSettings/.vsm b/GratingMonoScope/VSSettings/.vsm index 80af606..e223389 100644 --- a/GratingMonoScope/VSSettings/.vsm +++ b/GratingMonoScope/VSSettings/.vsm @@ -6,7 +6,7 @@ Scope YT NC Project True - C:\Users\nrw\plcprojs\lcls-plc-rixs-optics\GratingMonoScope\Scope YT NC Project.tcscopex + C:\Github (mghaly)\lcls-plc-rixs-optics\GratingMonoScope\Scope YT NC Project.tcscopex DataPool diff --git a/lcls-plc-rixs-optics/_Config/PLC/rixs_optics.xti b/lcls-plc-rixs-optics/_Config/PLC/rixs_optics.xti index b3ef13b..8c37ae6 100644 --- a/lcls-plc-rixs-optics/_Config/PLC/rixs_optics.xti +++ b/lcls-plc-rixs-optics/_Config/PLC/rixs_optics.xti @@ -76,15 +76,15 @@ - EL5042_Status + EL5042_Status 0 - + - ST_RenishawAbsEnc + ST_RenishawAbsEnc @@ -106,7 +106,7 @@ Status - EL5042_Status + EL5042_Status @@ -123,7 +123,7 @@ 64 - + @@ -1377,7 +1377,7 @@ External Setpoint Generation: - ST_RenishawAbsEnc + ST_RenishawAbsEnc Count @@ -1399,7 +1399,7 @@ External Setpoint Generation: PRG_MR1K1_BEND.M1K1.fbRunHOMS.stYdwnEnc - ST_RenishawAbsEnc + ST_RenishawAbsEnc Count @@ -1421,7 +1421,7 @@ External Setpoint Generation: PRG_MR1K1_BEND.M1K1.fbRunHOMS.stXupEnc - ST_RenishawAbsEnc + ST_RenishawAbsEnc Count @@ -1443,7 +1443,7 @@ External Setpoint Generation: PRG_MR1K1_BEND.M1K1.fbRunHOMS.stXdwnEnc - ST_RenishawAbsEnc + ST_RenishawAbsEnc Count @@ -1673,7 +1673,7 @@ Emergency Stop for MR1K1]]> - ST_RenishawAbsEnc + ST_RenishawAbsEnc Count @@ -1695,7 +1695,7 @@ Emergency Stop for MR1K1]]> PRG_MR1K2_SWITCH.M1K2.fbRunHOMS.stYdwnEnc - ST_RenishawAbsEnc + ST_RenishawAbsEnc Count @@ -1717,7 +1717,7 @@ Emergency Stop for MR1K1]]> PRG_MR1K2_SWITCH.M1K2.fbRunHOMS.stXupEnc - ST_RenishawAbsEnc + ST_RenishawAbsEnc Count @@ -1739,7 +1739,7 @@ Emergency Stop for MR1K1]]> PRG_MR1K2_SWITCH.M1K2.fbRunHOMS.stXdwnEnc - ST_RenishawAbsEnc + ST_RenishawAbsEnc Count @@ -2192,7 +2192,7 @@ External Setpoint Generation: PRG_SP1K1_MONO.mpi_upe - ST_RenishawAbsEnc + ST_RenishawAbsEnc Count @@ -2214,7 +2214,7 @@ External Setpoint Generation: PRG_SP1K1_MONO.gpi_upe - ST_RenishawAbsEnc + ST_RenishawAbsEnc Count @@ -8722,8 +8722,8 @@ External Setpoint Generation: - + diff --git a/lcls-plc-rixs-optics/rixs_optics/POUs/PRG_ZeroOrder_PMPS.TcPOU b/lcls-plc-rixs-optics/rixs_optics/POUs/PRG_ZeroOrder_PMPS.TcPOU index 9fd1f35..b9e2a0b 100644 --- a/lcls-plc-rixs-optics/rixs_optics/POUs/PRG_ZeroOrder_PMPS.TcPOU +++ b/lcls-plc-rixs-optics/rixs_optics/POUs/PRG_ZeroOrder_PMPS.TcPOU @@ -10,46 +10,57 @@ VAR i_Desc := 'Faults when Zero order beam safe conditions are not met', i_TypeCode := 16#F506); {attribute 'pytmc' := ' - pv: SIM:SafeBenderRange + pv: @(PREFIX)SafeBenderRange field: ZNAM FALSE field: ONAM TRUE '} bSafeBenderRange : BOOL; {attribute 'pytmc' := ' - pv: SIM:LRG_Grating_IN + pv: @(PREFIX)LRG_Grating_IN field: ZNAM FALSE field: ONAM TRUE '} bLRG_Grating_IN : BOOL; {attribute 'pytmc' := ' - pv: SIM:ZOS_IN + pv: @(PREFIX)ZOS_IN field: ZNAM FALSE field: ONAM TRUE '} bZOS_IN : BOOL; {attribute 'pytmc' := ' - pv: SIM:ZOB_on_Lower_Stopper + pv: :@(PREFIX)ZOB_on_Lower_Stopper field: ZNAM FALSE field: ONAM TRUE '} bZOB_on_Lower_Stopper : BOOL; {attribute 'pytmc' := ' - pv: SIM:MR1K1_Inserted + pv: @(PREFIX)MR1K1_Inserted field: ZNAM FALSE field: ONAM TRUE '} bMR1K1_Inserted : BOOL; + + + {attribute 'pytmc' := ' + pv: @(PREFIX)MachineMode + field: ZRST NC + field: ONST SC + field: TWST Misconfig + field: THST UnInit + '} + nMachineMode : INT; + {attribute 'pytmc' := ' - pv: SIM:ZeroOrderBeam + pv: @(PREFIX)BeamPermitted field: ZNAM FALSE field: ONAM TRUE '} - bZeroOrderBeam : BOOL; + bBeamPermitted : BOOL; Pm3 : LREAL; @@ -86,33 +97,35 @@ VAR CONSTANT Zmon : LREAL:=739.622;//m Zpiv : LREAL:= 739.762 ; //m Zzos : LREAL:= 741.422;//m + Pm1Offset: LREAL:= 18181;//=18310-129 + Pm2Offset: LREAL:= -90641; + Pm3Offset: LREAL:= -63300;//urad, could depend on the inserted grating END_VAR ]]> D + +//TRUE if Hzos - hb0m3(Zzoz) > D Ans := (Hzos*1E3) - Hb0m3; //um IF GVL_PMPS.rPhotonEnergy <550 THEN - bZeroOrderBeam := Ans > 3*1E3; + bZOB_on_Lower_Stopper := Ans > 3*1E3; ELSIF GVL_PMPS.rPhotonEnergy <1000 THEN - bZeroOrderBeam := Ans > 2.5*1E3; + bZOB_on_Lower_Stopper := Ans > 2.5*1E3; ELSIF GVL_PMPS.rPhotonEnergy >=1000 THEN - bZeroOrderBeam := Ans > 2*1E3; + bZOB_on_Lower_Stopper := Ans > 2*1E3; END_IF // @@ -126,16 +139,16 @@ ACT_ExitSlitsGap();]]> - - - - D -Ans := Hb0m3 - (Hzos*1E3); //um -IF GVL_PMPS.rPhotonEnergy <550 THEN - ZOB_on_Lower_Stopper := Ans > 6*1E3; - ELSIF GVL_PMPS.rPhotonEnergy <1000 THEN - ZOB_on_Lower_Stopper := Ans > 3.2*1E3; - ELSIF GVL_PMPS.rPhotonEnergy >=1000 THEN - ZOB_on_Lower_Stopper := Ans > 2.5*1E3; -END_IF -]]> - - \ No newline at end of file diff --git a/lcls-plc-rixs-optics/rixs_optics/rixs_optics.tmc b/lcls-plc-rixs-optics/rixs_optics/rixs_optics.tmc index c720b55..0083aad 100644 --- a/lcls-plc-rixs-optics/rixs_optics/rixs_optics.tmc +++ b/lcls-plc-rixs-optics/rixs_optics/rixs_optics.tmc @@ -1,5 +1,5 @@ - + ComSerialLineMode_t @@ -22781,11 +22781,6 @@ contributing fast faults, unless the FFO is currently vetoed. DINT 32 - - __Index__0 - DINT - 32 - AssertEquals_BOOL @@ -22921,11 +22916,6 @@ contributing fast faults, unless the FFO is currently vetoed. DINT 32 - - __Index__0 - DINT - 32 - AssertEquals_STRING @@ -23082,11 +23072,6 @@ contributing fast faults, unless the FFO is currently vetoed. DINT 32 - - __Index__0 - DINT - 32 - CalculateAndSetNumberOfAssertsForTest @@ -23224,11 +23209,6 @@ contributing fast faults, unless the FFO is currently vetoed. DINT 32 - - __Index__0 - DINT - 32 - SetTestFailed @@ -23387,11 +23367,6 @@ contributing fast faults, unless the FFO is currently vetoed. DINT 32 - - __Index__0 - DINT - 32 - IsTestFinished @@ -23897,11 +23872,6 @@ contributing fast faults, unless the FFO is currently vetoed. DINT 32 - - __Index__0 - DINT - 32 - AssertEquals_SINT @@ -24674,11 +24644,6 @@ contributing fast faults, unless the FFO is currently vetoed. DINT 32 - - __Index__0 - DINT - 32 - AssertEquals_TIME @@ -25057,11 +25022,6 @@ contributing fast faults, unless the FFO is currently vetoed. DINT 32 - - __Index__0 - DINT - 32 - AssertArrayEquals_INT @@ -25156,11 +25116,6 @@ contributing fast faults, unless the FFO is currently vetoed. DINT 32 - - __Index__0 - DINT - 32 - AssertFalse @@ -25285,11 +25240,6 @@ contributing fast faults, unless the FFO is currently vetoed. DINT 32 - - __Index__0 - DINT - 32 - AssertArrayEquals_LWORD @@ -25394,11 +25344,6 @@ contributing fast faults, unless the FFO is currently vetoed. DINT 32 - - __Index__0 - DINT - 32 - GetTestByPosition @@ -25710,11 +25655,6 @@ contributing fast faults, unless the FFO is currently vetoed. DINT 32 - - __Index__0 - DINT - 32 - AreAllTestsFinished @@ -25887,11 +25827,6 @@ contributing fast faults, unless the FFO is currently vetoed. DINT 32 - - __Index__0 - DINT - 32 - FindTestSuiteInstancePath @@ -26073,11 +26008,6 @@ contributing fast faults, unless the FFO is currently vetoed. DINT 32 - - __Index__0 - DINT - 32 - AssertArrayEquals_LREAL @@ -26178,11 +26108,6 @@ contributing fast faults, unless the FFO is currently vetoed. DINT 32 - - __Index__0 - DINT - 32 - GetNumberOfSuccessfulTests @@ -30013,11 +29938,6 @@ contributing fast faults, unless the FFO is currently vetoed. DINT 32 - - __Index__0 - DINT - 32 - FindTestSuiteInstancePath @@ -30276,11 +30196,6 @@ contributing fast faults, unless the FFO is currently vetoed. DINT 32 - - __Index__0 - DINT - 32 - AssertArrayEquals_BYTE @@ -30385,11 +30300,6 @@ contributing fast faults, unless the FFO is currently vetoed. DINT 32 - - __Index__0 - DINT - 32 - AssertEquals_DATE @@ -30546,11 +30456,6 @@ contributing fast faults, unless the FFO is currently vetoed. DINT 32 - - __Index__0 - DINT - 32 - AssertEquals_LTIME @@ -30676,11 +30581,6 @@ contributing fast faults, unless the FFO is currently vetoed. DINT 32 - - __Index__0 - DINT - 32 - AssertEquals_LREAL @@ -30822,11 +30722,6 @@ contributing fast faults, unless the FFO is currently vetoed. DINT 32 - - __Index__0 - DINT - 32 - AssertEquals @@ -31585,11 +31480,6 @@ contributing fast faults, unless the FFO is currently vetoed. DINT 32 - - __Index__0 - DINT - 32 - SetHasStartedRunning @@ -31750,11 +31640,6 @@ contributing fast faults, unless the FFO is currently vetoed. DINT 32 - - __Index__0 - DINT - 32 - GetHasStartedRunning @@ -31860,11 +31745,6 @@ contributing fast faults, unless the FFO is currently vetoed. DINT 32 - - __Index__0 - DINT - 32 - AssertEquals_WSTRING @@ -32016,11 +31896,6 @@ contributing fast faults, unless the FFO is currently vetoed. DINT 32 - - __Index__0 - DINT - 32 - AssertEquals_DINT @@ -32146,11 +32021,6 @@ contributing fast faults, unless the FFO is currently vetoed. DINT 32 - - __Index__0 - DINT - 32 - AssertEquals_STRING @@ -32326,11 +32196,6 @@ contributing fast faults, unless the FFO is currently vetoed. DINT 32 - - __Index__0 - DINT - 32 - AssertArray3dEquals_LREAL @@ -32613,11 +32478,6 @@ contributing fast faults, unless the FFO is currently vetoed. DINT 32 - - __Index__0 - DINT - 32 - CalculateAndSetNumberOfAssertsForTest @@ -33411,11 +33271,6 @@ contributing fast faults, unless the FFO is currently vetoed. DINT 32 - - __Index__0 - DINT - 32 - AssertArrayEquals_UDINT @@ -33510,11 +33365,6 @@ contributing fast faults, unless the FFO is currently vetoed. DINT 32 - - __Index__0 - DINT - 32 - @@ -60025,7 +59875,7 @@ The BPTM will throw an error if the arbiter does not have enough space for the t 0 SerialIO Inputs 0 - 163774464 + 163840000 GVL_SerialIO.Serial_stComIn_M1K2 Better have your inputs and outputs! @@ -60048,7 +59898,7 @@ The BPTM will throw an error if the arbiter does not have enough space for the t 1 SerialIO Outputs 0 - 163774464 + 163840000 GVL_SerialIO.Serial_stComOut_M1K2 192 @@ -60069,7 +59919,7 @@ The BPTM will throw an error if the arbiter does not have enough space for the t 3 SerialIO Internal 0 - 163774464 + 163840000 P_Serial_Com.fbSerialLineControl_EL6001_M1K2 10432 @@ -60167,7 +60017,7 @@ The BPTM will throw an error if the arbiter does not have enough space for the t 19 PiezoDriver Internal 1 - 163774464 + 163840000 PiezoSerial.fbE621SerialDriver_M1K2 PI Serial @@ -60264,7 +60114,7 @@ The BPTM will throw an error if the arbiter does not have enough space for the t 32 DaqTask Inputs 2 - 163774464 + 163840000 PRG_DAQ_ENCODER.iLatchPos Inputs @@ -60319,7 +60169,7 @@ The BPTM will throw an error if the arbiter does not have enough space for the t 35 DaqTask Internal 2 - 163774464 + 163840000 GVL_Logger.sIpTidbit 56 @@ -60834,7 +60684,7 @@ The BPTM will throw an error if the arbiter does not have enough space for the t 48 PlcTask Inputs 3 - 163774464 + 163840000 LCLS_General.DefaultGlobals.stSys.I_EcatMaster1 AMS Net ID used for FB_EcatDiag, among others @@ -68735,7 +68585,7 @@ Emergency Stop for MR1K1 49 PlcTask Outputs 3 - 163774464 + 163840000 PRG_MR1K1_BEND.fbM1K1PitchControl.fbMotionStage.fbDriveVirtual.MasterAxis.PlcToNc 1024 @@ -70847,7 +70697,7 @@ Emergency Stop for MR1K1 51 PlcTask Internal 3 - 163774464 + 163840000 MOTION_GVL.fbPmpsFileReader 928512 @@ -78974,7 +78824,7 @@ M1K1 BEND US ENC CNT pytmc - pv: SIM:SafeBenderRange + pv: @(PREFIX)SafeBenderRange field: ZNAM FALSE field: ONAM TRUE @@ -78990,7 +78840,7 @@ M1K1 BEND US ENC CNT pytmc - pv: SIM:LRG_Grating_IN + pv: @(PREFIX)LRG_Grating_IN field: ZNAM FALSE field: ONAM TRUE @@ -79688,7 +79538,7 @@ M1K1 BEND US ENC CNT pytmc - pv: SIM:ZOS_IN + pv: @(PREFIX)ZOS_IN field: ZNAM FALSE field: ONAM TRUE @@ -79704,7 +79554,7 @@ M1K1 BEND US ENC CNT pytmc - pv: SIM:ZOB_on_Lower_Stopper + pv: :@(PREFIX)ZOB_on_Lower_Stopper field: ZNAM FALSE field: ONAM TRUE @@ -79720,7 +79570,7 @@ M1K1 BEND US ENC CNT pytmc - pv: SIM:MR1K1_Inserted + pv: @(PREFIX)MR1K1_Inserted field: ZNAM FALSE field: ONAM TRUE @@ -79729,14 +79579,14 @@ M1K1 BEND US ENC CNT 1287227824 - PRG_ZeroOrder_PMPS.bZeroOrderBeam + PRG_ZeroOrder_PMPS.bBeamPermitted 8 BOOL pytmc - pv: SIM:ZeroOrderBeam + pv: @(PREFIX)BeamPermitted field: ZNAM FALSE field: ONAM TRUE @@ -84001,12 +83851,59 @@ M4K2 KBV X ENC CNT 1302231008 + + PRG_ZeroOrder_PMPS.nMachineMode + 16 + INT + + + pytmc + + pv: @(PREFIX)MachineMode + field: ZRST NC + field: ONST SC + field: TWST Misconfig + field: THST UnInit + + + + 1302264976 + + + PRG_ZeroOrder_PMPS.Pm1Offset + =18310-129 + 64 + LREAL + + 18181 + + 1302617600 + + + PRG_ZeroOrder_PMPS.Pm2Offset + 64 + LREAL + + -90641 + + 1302617664 + + + PRG_ZeroOrder_PMPS.Pm3Offset + urad, could depend on the inserted grating + 64 + LREAL + + -63300 + + 1302617728 + 52 PlcTask Retains 3 - 163774464 + 163840000 PMPS_GVL.SuccessfulPreemption Any time BPTM applies a new BP request which is confirmed @@ -84086,11 +83983,11 @@ M4K2 KBV X ENC CNT ChangeDate - 2023-08-24T10:17:58 + 2023-09-19T15:32:28 GeneratedCodeSize - 880640 + 876544 GlobalDataSize