Skip to content

Commit

Permalink
Merge pull request pcdshub#112 from tongju12/st1k4
Browse files Browse the repository at this point in the history
 adding IN and OUT states for ST1K4
  • Loading branch information
tongju12 authored Aug 7, 2023
2 parents a0ee5ef + c1ff05c commit 3f4ebb5
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 18 deletions.
5 changes: 5 additions & 0 deletions plc-kfe-motion/kfe_motion/POUs/PRG_3_PMPS_POST.TcPOU
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,17 @@ VAR
fbArbiterIO: FB_SubSysToArbiter_IO;
fb_vetoArbiter: FB_VetoArbiter;
bM1K1_Veto_IN: BOOL;
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[// create MR1K1 as veto for K4 lines
bM1K1_Veto_IN := NOT PMPS_GVL.stCurrentBeamParameters.aVetoDevices[PMPS.K_Stopper.MR1K1_OUT]
AND PMPS_GVL.stCurrentBeamParameters.aVetoDevices[PMPS.K_Stopper.MR1K1_IN];
//create a preemptive request from Arbiter 2 in Arbiter 1
fb_vetoArbiter(bVeto:=bM1K1_Veto_IN,
HigherAuthority := GVL.fbArbiter,
Expand Down
24 changes: 16 additions & 8 deletions plc-kfe-motion/kfe_motion/POUs/PRG_ST1K4_TEST.TcPOU
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,26 @@ VAR
'}
{* fbST1K4_InOut_States:FB_PositionStateInOut;
fbST1K4_InOut_States:FB_PositionStateInOut;
ST1K4_In:DUT_PositionState:= (
bUseRawCounts := FALSE,
bMoveOK := TRUE,
bValid := TRUE,
sName := 'IN',
fPosition := -30.997,
fPosition := 0,
fDelta := 1,
fVelocity := 6);
fVelocity := 12);
ST1K4_Out:DUT_PositionState:= (
bUseRawCounts := FALSE,
bMoveOK := TRUE,
bValid := TRUE,
sName := 'OUT',
fPosition := 8.080,
fPosition := 40,
fDelta := 1,
fVelocity := 6);
*}
fVelocity := 12);
END_VAR
Expand All @@ -46,12 +46,20 @@ Main.M33.nBrakeMode := ENUM_StageBrakeMode.IF_ENABLED;
fbMotion1(stMotionStage:=Main.M33);
// in and out position
{* fbST1K4_InOut_States(
fbST1K4_InOut_States(
bEnable := TRUE,
stIn := ST1K4_In,
stOut := ST1K4_OUT,
stMotionStage := Main.M33);
{* bIn := PMPS_GVL.stCurrentBeamParameters.aVetoDevices[PMPS.K_Stopper.ST3K4];
IF bIn
fbST1K4_InOut_States.enumSet:= ENUM_EpicsInOut.IN;
fbST1K4_Out_States;
*}
]]></ST>
Expand Down
30 changes: 20 additions & 10 deletions plc-kfe-motion/kfe_motion/kfe_motion.tmc

Large diffs are not rendered by default.

0 comments on commit 3f4ebb5

Please sign in to comment.