diff --git a/lcls-plc-rixs-optics/_Config/PLC/rixs_optics.xti b/lcls-plc-rixs-optics/_Config/PLC/rixs_optics.xti index 60b23c5..f5f7602 100644 --- a/lcls-plc-rixs-optics/_Config/PLC/rixs_optics.xti +++ b/lcls-plc-rixs-optics/_Config/PLC/rixs_optics.xti @@ -1349,7 +1349,7 @@ External Setpoint Generation: - + rixs_optics Instance {08500001-0000-0000-F000-000000000064} @@ -3708,6 +3708,123 @@ Emergency Stop for MR1K1]]> Main.sio_load UINT + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[1].Axis.NcToPlc + NCTOPLC_AXIS_REF + + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[1].bLimitForwardEnable + + BOOL + + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[1].bLimitBackwardEnable + + BOOL + + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[1].bHome + + BOOL + + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[1].bHardwareEnable + + BOOL + + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[1].nRawEncoderULINT + + ULINT + + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[1].nRawEncoderUINT + + UINT + + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[1].nRawEncoderINT + + INT + + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[2].Axis.NcToPlc + NCTOPLC_AXIS_REF + + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[2].bLimitForwardEnable + + BOOL + + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[2].bLimitBackwardEnable + + BOOL + + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[2].bHome + + BOOL + + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[2].bHardwareEnable + + BOOL + + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[2].nRawEncoderULINT + + ULINT + + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[2].nRawEncoderUINT + + UINT + + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[2].nRawEncoderINT + + INT + + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[3].Axis.NcToPlc + NCTOPLC_AXIS_REF + + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[3].bLimitForwardEnable + + BOOL + + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[3].bLimitBackwardEnable + + BOOL + + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[3].bHome + + BOOL + + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[3].bHardwareEnable + + BOOL + + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[3].nRawEncoderULINT + + ULINT + + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[3].nRawEncoderUINT + + UINT + + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[3].nRawEncoderINT + + INT + PRG_MR1K2_SWITCH.fbCoatingStates.astMotionStageMax[1].Axis.NcToPlc NCTOPLC_AXIS_REF @@ -4501,6 +4618,33 @@ Emergency Stop for MR1K1]]> Main.fbMotionStageM37.fbDriveVirtual.MasterAxis.PlcToNc PLCTONC_AXIS_REF + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[1].Axis.PlcToNc + PLCTONC_AXIS_REF + + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[1].bBrakeRelease + + BOOL + + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[2].Axis.PlcToNc + PLCTONC_AXIS_REF + + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[2].bBrakeRelease + + BOOL + + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[3].Axis.PlcToNc + PLCTONC_AXIS_REF + + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[3].bBrakeRelease + + BOOL + PRG_MR1K2_SWITCH.fbCoatingStates.astMotionStageMax[1].Axis.PlcToNc PLCTONC_AXIS_REF diff --git a/lcls-plc-rixs-optics/rixs_optics/DUTs/E_B4C_Rh_CoatingStates.TcDUT b/lcls-plc-rixs-optics/rixs_optics/DUTs/E_B4C_Rh_CoatingStates.TcDUT index dbda7fb..2b3a06a 100644 --- a/lcls-plc-rixs-optics/rixs_optics/DUTs/E_B4C_Rh_CoatingStates.TcDUT +++ b/lcls-plc-rixs-optics/rixs_optics/DUTs/E_B4C_Rh_CoatingStates.TcDUT @@ -7,8 +7,7 @@ TYPE E_B4C_Rh_CoatingStates : ( Unknown := 0, B4C := 1, - Rh := 2, - OUT := 3 + Rh := 2 ) UINT; END_TYPE ]]> diff --git a/lcls-plc-rixs-optics/rixs_optics/DUTs/E_MR1K1_States.TcDUT b/lcls-plc-rixs-optics/rixs_optics/DUTs/E_MR1K1_States.TcDUT new file mode 100644 index 0000000..1d3bd6f --- /dev/null +++ b/lcls-plc-rixs-optics/rixs_optics/DUTs/E_MR1K1_States.TcDUT @@ -0,0 +1,16 @@ + + + + + + \ No newline at end of file diff --git a/lcls-plc-rixs-optics/rixs_optics/POUs/PRG_MR1K1_BEND.TcPOU b/lcls-plc-rixs-optics/rixs_optics/POUs/PRG_MR1K1_BEND.TcPOU index 395970e..2daed21 100644 --- a/lcls-plc-rixs-optics/rixs_optics/POUs/PRG_MR1K1_BEND.TcPOU +++ b/lcls-plc-rixs-optics/rixs_optics/POUs/PRG_MR1K1_BEND.TcPOU @@ -185,27 +185,25 @@ VAR io: i '} fM1K1_Press_1_val : LREAL; -(* + {attribute 'pytmc' := 'pv: MR1K1:BEND:COATING'} fbCoatingStates: FB_PositionStatePMPS2D; {attribute 'pytmc' := ' pv: MR1K1:BEND:COATING:STATE:SET io: io '} - eStateSet: E_B4C_Rh_CoatingStates; + eStateSet: E_MR1K1_States; {attribute 'pytmc' := ' pv: MR1K1:BEND:COATING:STATE:GET io: i '} - eStateGet: E_B4C_Rh_CoatingStates; + eStateGet: E_MR1K1_States; fbYSetup: FB_StateSetupHelper; fbXSetup: FB_StateSetupHelper; astCoatingStatesY: ARRAY[1..GeneralConstants.MAX_STATES] OF ST_PositionState; astCoatingStatesX: ARRAY[1..GeneralConstants.MAX_STATES] OF ST_PositionState; -*) - END_VAR ]]> @@ -306,27 +304,27 @@ nEncRefPitchM1K1 := LREAL_TO_UDINT(ABS(fEncRefPitchM1K1_urad) * fEncLeverArm_mm) fM1K1_Press_1(iTermBits:=15, fTermMax:=4.0, fTermMin:=0); fM1K1_Press_1_val := fM1K1_Press_1.fReal; -(* + fbYSetup(stPositionState:=GVL_States.stDefaultOffsetY, bSetDefault:=TRUE); fbXSetup(stPositionState:=GVL_States.stDefaultOffsetX, bSetDefault:=TRUE); -fbYSetup(stPositionState:=astCoatingStatesY[E_B4C_Rh_CoatingStates.B4C], +fbYSetup(stPositionState:=astCoatingStatesY[E_MR1K1_States.B4C], sName:='B4C', sPmpsState:='MR1K1:BEND-B4C', - nEncoderCount:= + nEncoderCount:=31911452 ); -fbXSetup(stPositionState:=astCoatingStatesX[E_B4C_Rh_CoatingStates.B4C], +fbXSetup(stPositionState:=astCoatingStatesX[E_MR1K1_States.B4C], sName:='B4C', sPmpsState:='MR1K1:BEND-B4C', - nEncoderCount:=19829700 + nEncoderCount:=19829647 ); -fbYSetup(stPositionState:=astCoatingStatesY[E_B4C_Rh_CoatingStates.OUT], +fbYSetup(stPositionState:=astCoatingStatesY[E_MR1K1_States.OUT], sName:='OUT', sPmpsState:='MR1K1:BEND-OUT', nEncoderCount:=13412630 ); // Out position determined soley by X Axis -fbXSetup(stPositionState:=astCoatingStatesX[E_B4C_Rh_CoatingStates.OUT], +fbXSetup(stPositionState:=astCoatingStatesX[E_MR1K1_States.OUT], sName:='OUT', sPmpsState:='MR1K1:BEND-OUT', nEncoderCount:=ULINT_TO_UDINT(M14.nRawEncoderULINT) @@ -345,7 +343,7 @@ fbCoatingStates( sDeviceName:='MR1K1:BEND', sTransitionKey:='MR1K1:BEND-TRANSITION', ); -*)]]> +]]> \ No newline at end of file diff --git a/lcls-plc-rixs-optics/rixs_optics/rixs_optics.plcproj b/lcls-plc-rixs-optics/rixs_optics/rixs_optics.plcproj index 5847d70..13b5d3c 100644 --- a/lcls-plc-rixs-optics/rixs_optics/rixs_optics.plcproj +++ b/lcls-plc-rixs-optics/rixs_optics/rixs_optics.plcproj @@ -29,6 +29,9 @@ Code + + Code + Code diff --git a/lcls-plc-rixs-optics/rixs_optics/rixs_optics.tmc b/lcls-plc-rixs-optics/rixs_optics/rixs_optics.tmc index e5eaf6c..c597aad 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 @@ -27355,6 +27355,34 @@ contributing fast faults, unless the FFO is currently vetoed. + + E_MR1K1_States + 16 + UINT + + Unknown + 0 + + + B4C + 1 + + + OUT + 2 + + + + qualified_only + + + strict + + + generate_implicit_init_function + + + ST_PMPS_Attenuator_IO 64 @@ -72244,10 +72272,6 @@ The BPTM will throw an error if the arbiter does not have enough space for the t Rh 2 - - OUT - 3 - qualified_only @@ -81524,6 +81548,339 @@ The BPTM will throw an error if the arbiter does not have enough space for the t + + FB_PositionStatePMPS2D + 1541440 + + stMotionStage1 + ST_MotionStage + The 1st motor to move + 64 + 64 + + + ItemType + InOut + + + + + stMotionStage2 + ST_MotionStage + The 2nd motor to move + 64 + 128 + + + ItemType + InOut + + + + + astPositionState1 + ST_PositionState + + 1 + 15 + + All possible position states for motor 1, including unused/invalid states. + 64 + 192 + + + ItemType + InOut + + + pytmc + + pv: STATE:M1 + io: io + expand: :%.2d + + + + + + astPositionState2 + ST_PositionState + + 1 + 15 + + All possible position states for motor 2, including unused/invalid states. + 64 + 256 + + + ItemType + InOut + + + pytmc + + pv: STATE:M2 + io: io + expand: :%.2d + + + + + + eEnumSet + UINT + Set this to a nonzero value to request a new move. It will be reset to zero every cycle. This should be hooked up to a user's EPICS enum input. + 64 + 320 + + + ItemType + InOut + + + + + eEnumGet + UINT + The current state index, or zero if we are not at a state. This should be hooked up to a user's EPICS enum output. + 64 + 384 + + + ItemType + InOut + + + + + fbFFHWO + FB_HardwareFFOutput + The fast fault output to fault to. + 64 + 448 + + + ItemType + InOut + + + + + fbArbiter + FB_Arbiter + The arbiter to request beam conditions from. + 64 + 512 + + + ItemType + InOut + + + + + bEnableMotion + BOOL + Set this to TRUE to enable input state moves, or FALSE to disable them. + 8 + 576 + + + ItemType + Input + + + + + bEnableBeamParams + BOOL + Set this to TRUE to enable beam parameter checks, or FALSE to disable them. + 8 + 584 + + + ItemType + Input + + + + + bEnablePositionLimits + BOOL + Set this to TRUE to enable position limit checks, or FALSE to disable them. + 8 + 592 + + + ItemType + Input + + + + + sDeviceName + STRING(80) + The name of the device for use in the PMPS DB lookup and diagnostic screens. + 648 + 600 + + + ItemType + Input + + + + + sTransitionKey + STRING(80) + The name of the transition state in the PMPS database. + 648 + 1248 + + + ItemType + Input + + + + + stEpicsToPlc + ST_StateEpicsToPlc + Normal EPICS inputs, gathered into a single struct + PMPS EPICS inputs, gathered into a single struct + 32 + 1904 + + + ItemType + Input + + + pytmc + pv: STATE + + + + + stPMPSEpicsToPlc + ST_StatePMPSEpicsToPlc + 16 + 1936 + + + ItemType + Input + + + pytmc + pv: STATE + + + + + bReadDBNow + BOOL + Set this to TRUE to re-read the loaded database immediately (useful for debug) + 8 + 1952 + + + ItemType + Input + + + + + stPlcToEpics + ST_StatePlcToEpics + Normal EPICS outputs, gathered into a single struct + 768 + 1984 + + + ItemType + Output + + + pytmc + pv: STATE + + + + + stPMPSPlcToEpics + ST_StatePMPSPlcToEpics + PMPS EPICS outputs, gathered into a single struct + 2496 + 2752 + + + ItemType + Output + + + pytmc + pv: STATE + + + + + stDbStateParams + ST_DbStateParams + The PMPS database lookup associated with the current position state. + 2496 + 5248 + + + ItemType + Output + + + + + fbCore + FB_PositionStateND_Core + 609536 + 7744 + + + fbPMPSCore + FB_PositionStatePMPSND_Core + 682240 + 617280 + + + astMotionStageMax + ST_MotionStage + + 1 + 3 + + 77760 + 1299520 + + + astPositionStateMax + ST_PositionState + + 1 + 3 + + + 1 + 15 + + 164160 + 1377280 + + + + PouType + FunctionBlock + + + FB_PositionStatePMPS1D 1541312 @@ -89984,6 +90341,345 @@ Emergency Stop for MR1K1 1304133520 + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[1].Axis.NcToPlc + 2048 + NCTOPLC_AXIS_REF + + + TcAddressType + Input + + + 1317361024 + + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[1].bLimitForwardEnable + NC Forward Limit Switch: TRUE if ok to move + 8 + BOOL + + + TcAddressType + Input + + + 1317368960 + + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[1].bLimitBackwardEnable + NC Backward Limit Switch: TRUE if ok to move + 8 + BOOL + + + TcAddressType + Input + + + 1317368968 + + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[1].bHome + NO Home Switch: TRUE if at home + 8 + BOOL + + + TcAddressType + Input + + + 1317368976 + + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[1].bHardwareEnable + NC STO Input: TRUE if ok to move + 8 + BOOL + + + pytmc + + pv: PLC:bHardwareEnable + io: i + field: ZNAM FALSE + field: ONAM TRUE + field: DESC TRUE if STO not hit + + + + TcAddressType + Input + + + 1317368992 + + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[1].nRawEncoderULINT + Raw encoder IO for ULINT (Biss-C) + 64 + ULINT + + + TcAddressType + Input + + + 1317369024 + + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[1].nRawEncoderUINT + Raw encoder IO for UINT (Relative Encoders) + 16 + UINT + + + TcAddressType + Input + + + 1317369088 + + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[1].nRawEncoderINT + Raw encoder IO for INT (LVDT) + 16 + INT + + + TcAddressType + Input + + + 1317369104 + + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[2].Axis.NcToPlc + 2048 + NCTOPLC_AXIS_REF + + + TcAddressType + Input + + + 1317386944 + + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[2].bLimitForwardEnable + NC Forward Limit Switch: TRUE if ok to move + 8 + BOOL + + + TcAddressType + Input + + + 1317394880 + + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[2].bLimitBackwardEnable + NC Backward Limit Switch: TRUE if ok to move + 8 + BOOL + + + TcAddressType + Input + + + 1317394888 + + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[2].bHome + NO Home Switch: TRUE if at home + 8 + BOOL + + + TcAddressType + Input + + + 1317394896 + + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[2].bHardwareEnable + NC STO Input: TRUE if ok to move + 8 + BOOL + + + pytmc + + pv: PLC:bHardwareEnable + io: i + field: ZNAM FALSE + field: ONAM TRUE + field: DESC TRUE if STO not hit + + + + TcAddressType + Input + + + 1317394912 + + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[2].nRawEncoderULINT + Raw encoder IO for ULINT (Biss-C) + 64 + ULINT + + + TcAddressType + Input + + + 1317394944 + + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[2].nRawEncoderUINT + Raw encoder IO for UINT (Relative Encoders) + 16 + UINT + + + TcAddressType + Input + + + 1317395008 + + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[2].nRawEncoderINT + Raw encoder IO for INT (LVDT) + 16 + INT + + + TcAddressType + Input + + + 1317395024 + + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[3].Axis.NcToPlc + 2048 + NCTOPLC_AXIS_REF + + + TcAddressType + Input + + + 1317412864 + + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[3].bLimitForwardEnable + NC Forward Limit Switch: TRUE if ok to move + 8 + BOOL + + + TcAddressType + Input + + + 1317420800 + + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[3].bLimitBackwardEnable + NC Backward Limit Switch: TRUE if ok to move + 8 + BOOL + + + TcAddressType + Input + + + 1317420808 + + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[3].bHome + NO Home Switch: TRUE if at home + 8 + BOOL + + + TcAddressType + Input + + + 1317420816 + + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[3].bHardwareEnable + NC STO Input: TRUE if ok to move + 8 + BOOL + + + pytmc + + pv: PLC:bHardwareEnable + io: i + field: ZNAM FALSE + field: ONAM TRUE + field: DESC TRUE if STO not hit + + + + TcAddressType + Input + + + 1317420832 + + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[3].nRawEncoderULINT + Raw encoder IO for ULINT (Biss-C) + 64 + ULINT + + + TcAddressType + Input + + + 1317420864 + + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[3].nRawEncoderUINT + Raw encoder IO for UINT (Relative Encoders) + 16 + UINT + + + TcAddressType + Input + + + 1317420928 + + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[3].nRawEncoderINT + Raw encoder IO for INT (LVDT) + 16 + INT + + + TcAddressType + Input + + + 1317420944 + PRG_MR1K2_SWITCH.fbCoatingStates.astMotionStageMax[1].Axis.NcToPlc 2048 @@ -92404,6 +93100,81 @@ Emergency Stop for MR1K1 1303807680 + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[1].Axis.PlcToNc + 1024 + PLCTONC_AXIS_REF + + + TcAddressType + Output + + + 1317360000 + + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[1].bBrakeRelease + NC Brake Output: TRUE to release brake + 8 + BOOL + + + TcAddressType + Output + + + 1317368984 + + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[2].Axis.PlcToNc + 1024 + PLCTONC_AXIS_REF + + + TcAddressType + Output + + + 1317385920 + + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[2].bBrakeRelease + NC Brake Output: TRUE to release brake + 8 + BOOL + + + TcAddressType + Output + + + 1317394904 + + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[3].Axis.PlcToNc + 1024 + PLCTONC_AXIS_REF + + + TcAddressType + Output + + + 1317411840 + + + PRG_MR1K1_BEND.fbCoatingStates.astMotionStageMax[3].bBrakeRelease + NC Brake Output: TRUE to release brake + 8 + BOOL + + + TcAddressType + Output + + + 1317420824 + PRG_MR1K2_SWITCH.fbCoatingStates.astMotionStageMax[1].Axis.PlcToNc 1024 @@ -98358,6 +99129,36 @@ Emergency Stop for MR1K1 633593344 + + PRG_MR1K1_BEND.eStateSet + 16 + E_MR1K1_States + + + pytmc + + pv: MR1K1:BEND:COATING:STATE:SET + io: io + + + + 634550864 + + + PRG_MR1K1_BEND.eStateGet + 16 + E_MR1K1_States + + + pytmc + + pv: MR1K1:BEND:COATING:STATE:GET + io: i + + + + 634550880 + Global_Version.stLibVersion_lcls_twincat_motion 288 @@ -106611,6 +107412,38 @@ M4K2 KBV X ENC CNT 1311930688 + + PRG_MR1K1_BEND.fbYSetup + 92352 + FB_StateSetupHelper + 1312414272 + + + PRG_MR1K1_BEND.fbXSetup + 92352 + FB_StateSetupHelper + 1312506624 + + + PRG_MR1K1_BEND.astCoatingStatesY + 54720 + ST_PositionState + + 1 + 15 + + 1312598976 + + + PRG_MR1K1_BEND.astCoatingStatesX + 54720 + ST_PositionState + + 1 + 15 + + 1312653696 + PRG_MR1K2_SWITCH.fbYSetup 92352 @@ -106679,6 +107512,18 @@ M4K2 KBV X ENC CNT 1315739584 + + PRG_MR1K1_BEND.fbCoatingStates + 1541440 + FB_PositionStatePMPS2D + + + pytmc + pv: MR1K1:BEND:COATING + + + 1316060416 + PRG_MR1K2_SWITCH.fbCoatingStates 1541312 @@ -106794,15 +107639,15 @@ M4K2 KBV X ENC CNT ChangeDate - 2024-09-23T15:39:50 + 2024-09-24T14:37:08 GeneratedCodeSize - 1081344 + 1089536 GlobalDataSize - 163110912 + 163340288