Skip to content

Commit

Permalink
Merge pull request pcdshub#133 from tongju12/pa1k4-newtargets-st1k4veto
Browse files Browse the repository at this point in the history
giving a new pa1k4-out position and add st1k4 veto
  • Loading branch information
tongju12 authored Sep 17, 2024
2 parents 5420f5d + 4ad5287 commit c6dc2d3
Show file tree
Hide file tree
Showing 6 changed files with 103 additions and 84 deletions.
2 changes: 1 addition & 1 deletion plc-tmo-motion/_Config/PLC/tmo_motion.xti
Original file line number Diff line number Diff line change
Expand Up @@ -1260,7 +1260,7 @@ External Setpoint Generation:
</DataType>
</DataTypes>
<Project GUID="{9DD0BA81-4A92-4D5E-8BD9-E101C02702D4}" Name="tmo_motion" PrjFilePath="..\..\tmo_motion\tmo_motion.plcproj" TmcFilePath="..\..\tmo_motion\tmo_motion.tmc" ReloadTmc="true" AmsPort="851" FileArchiveSettings="#x000e" SymbolicMapping="true">
<Instance Id="#x08502000" TcSmClass="TComPlcObjDef" KeepUnrestoredLinks="2" TmcPath="tmo_motion\tmo_motion.tmc" TmcHash="{5EA336A7-BBC1-CAA7-3118-CDD119B4865E}">
<Instance Id="#x08502000" TcSmClass="TComPlcObjDef" KeepUnrestoredLinks="2" TmcPath="tmo_motion\tmo_motion.tmc" TmcHash="{988ED73B-104A-87E2-7C33-4D26342B57D4}">
<Name>tmo_motion Instance</Name>
<CLSID ClassFactory="TcPlc30">{08500001-0000-0000-F000-000000000064}</CLSID>
<Vars VarGrpType="1">
Expand Down
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.18">
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.12">
<DUT Name="ENUM_Sample_Calibration_States" Id="{ec0185cf-305f-4026-a003-981a68b47dc0}">
<Declaration><![CDATA[{attribute 'qualified_only'}
{attribute 'strict'}
Expand All @@ -11,7 +11,9 @@ TYPE ENUM_Sample_Calibration_States :
Target2 := 3,
Target3 := 4,
Target4 := 5,
Target5 := 6
Target5 := 6,
Target6 := 7,
Target7 := 8
)UINT;
END_TYPE
Expand Down
14 changes: 7 additions & 7 deletions plc-tmo-motion/tmo_motion/POUs/PRG_3_PMPS_POST.TcPOU
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,33 @@ VAR
fb_vetoArbiter: FB_VetoArbiter;
bST3K4_Veto: BOOL;
// bST1K4_Veto: BOOL;
bST1K4_Veto: BOOL;
bM1K1Veto: BOOL;
bM1K3Veto: BOOL;
bST4K4_Veto:BOOL;
END_VAR]]></Declaration>
<Implementation>
<ST><![CDATA[bST3K4_Veto := PMPS_GVL.stCurrentBeamParameters.aVetoDevices[PMPS.K_Stopper.ST3K4];
//bST1K4_Veto := PMPS_GVL.stCurrentBeamParameters.aVetoDevices[PMPS.K_Stopper.ST1K4];
bST1K4_Veto := PMPS_GVL.stCurrentBeamParameters.aVetoDevices[PMPS.K_Stopper.ST1K4];
bST4K4_Veto := PMPS_GVL.stCurrentBeamParameters.aVetoDevices[PMPS.K_Stopper.ST4K4];
bM1K1Veto := NOT PMPS_GVL.stCurrentBeamParameters.aVetoDevices[PMPS.K_Stopper.MR1K1_OUT]
AND PMPS_GVL.stCurrentBeamParameters.aVetoDevices[PMPS.K_Stopper.MR1K1_IN];
bM1K3Veto := NOT PMPS_GVL.stCurrentBeamParameters.aVetoDevices[PMPS.K_Stopper.MR1K3_OUT]
AND PMPS_GVL.stCurrentBeamParameters.aVetoDevices[PMPS.K_Stopper.MR1K3_IN];
// Adding TXI MR1K3 veto in
fbArbiterIO(
i_bVeto:=bST3K4_Veto,
i_bVeto:=bST3K4_Veto OR bM1K1Veto OR bST1K4_Veto,
Arbiter:=fbArbiter,
fbFFHWO:=fbFastFaultOutput1);
fb_vetoArbiter(bVeto:=bST4K4_Veto OR bST3K4_Veto OR bM1K1Veto OR bM1K3Veto,
fb_vetoArbiter(bVeto:=bST4K4_Veto OR bST3K4_Veto OR bST1K4_Veto OR bM1K1Veto OR bM1K3Veto,
HigherAuthority := GVL_PMPS.fbArbiter,
LowerAuthority := GVL_PMPS.fbArbiter2,
FFO := GVL_PMPS.fbFastFaultOutput2);
fbFastFaultOutput1.Execute(i_xVeto:=bST3K4_Veto OR bM1K1Veto OR bM1K3Veto);
fbFastFaultOutput2.Execute(i_xVeto:=bST3K4_Veto OR bM1K1Veto OR bST4K4_Veto OR bM1K3Veto); // Adding TXI MR1K3 veto in
fbFastFaultOutput1.Execute(i_xVeto:=bST3K4_Veto OR bST1K4_Veto OR bM1K1Veto OR bM1K3Veto);
fbFastFaultOutput2.Execute(i_xVeto:=bST3K4_Veto OR bST1K4_Veto OR bM1K1Veto OR bST4K4_Veto OR bM1K3Veto); // Adding TXI MR1K3 veto in
]]></ST>
</Implementation>
Expand Down
8 changes: 6 additions & 2 deletions plc-tmo-motion/tmo_motion/POUs/PRG_PA1K4_PF.TcPOU
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ VAR
pa1k4_enumGet: ENUM_Sample_Calibration_States;
fbStateSetup: FB_StateSetupHelper;
stDefault: ST_PositionState :=(
fDelta :=0.5,
fDelta :=2.0,
fVelocity := 1.0,
bMoveOk := TRUE,
bValid := TRUE
Expand All @@ -35,19 +35,23 @@ END_VAR
<ST><![CDATA[fbMotionPA1K4(stMotionStage:=Main.M47);
fbStateSetup(stPositionState:=stDefault, bSetDefault:=TRUE);
fbStateSetup(stPositionState:=aPA1K4States[ENUM_Sample_Calibration_States.OUT], sName := 'OUT', fPosition:=102.7);
fbStateSetup(stPositionState:=aPA1K4States[ENUM_Sample_Calibration_States.OUT],fdelta := 2.0, sName := 'OUT', fPosition:=173.0);
fbStateSetup(stPositionState:=aPA1K4States[ENUM_Sample_Calibration_States.Target1], sName := 'TARGET1', fPosition:=200);
fbStateSetup(stPositionState:=aPA1K4States[ENUM_Sample_Calibration_States.Target2], sName := 'TARGET2', fPosition:=201);
fbStateSetup(stPositionState:=aPA1K4States[ENUM_Sample_Calibration_States.Target3], sName := 'TARGET3', fPosition:=203);
fbStateSetup(stPositionState:=aPA1K4States[ENUM_Sample_Calibration_States.Target4], sName := 'TARGET4', fPosition:=205);
fbStateSetup(stPositionState:=aPA1K4States[ENUM_Sample_Calibration_States.Target5], sName := 'TARGET5', fPosition:=209);
fbStateSetup(stPositionState:=aPA1K4States[ENUM_Sample_Calibration_States.Target6], sName := 'TARGET6', fPosition:=211);
fbStateSetup(stPositionState:=aPA1K4States[ENUM_Sample_Calibration_States.Target7], sName := 'TARGET7', fPosition:=215);
//PMPS
aPA1K4States[ENUM_Sample_Calibration_States.OUT].stPMPS.sPmpsState := 'PA1K4:PF-OUT';
aPA1K4States[ENUM_Sample_Calibration_States.Target1].stPMPS.sPmpsState := 'PA1K4:PF-TARGET1';
aPA1K4States[ENUM_Sample_Calibration_States.Target2].stPMPS.sPmpsState := 'PA1K4:PF-TARGET2';
aPA1K4States[ENUM_Sample_Calibration_States.Target3].stPMPS.sPmpsState := 'PA1K4:PF-TARGET3';
aPA1K4States[ENUM_Sample_Calibration_States.Target4].stPMPS.sPmpsState := 'PA1K4:PF-TARGET4';
aPA1K4States[ENUM_Sample_Calibration_States.Target5].stPMPS.sPmpsState := 'PA1K4:PF-TARGET5';
aPA1K4States[ENUM_Sample_Calibration_States.Target6].stPMPS.sPmpsState := 'PA1K4:PF-TARGET6';
aPA1K4States[ENUM_Sample_Calibration_States.Target7].stPMPS.sPmpsState := 'PA1K4:PF-TARGET7';
fbPA1K4States(
Expand Down
2 changes: 1 addition & 1 deletion plc-tmo-motion/tmo_motion/POUs/PRG_SP1K4.TcPOU
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ VAR
SP1K4_ATT_RTD_02 : FB_CC_TempSensor;
{attribute 'TcLinkTo' := '.iRaw := TIIB[EP3174-FWM-E2]^AI Standard Channel 2^Value'}
{attribute 'pytmc' :='pv: SP1K4'}
{attribute 'pytmc' :='pv: TMO:SPEC'}
fbFlowMeter: FB_FDQ_FlowMeter;
END_VAR
]]></Declaration>
Expand Down
Loading

0 comments on commit c6dc2d3

Please sign in to comment.