Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Veto IM1K3 when MR1K3 is OUT #126

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions plc-kfe-motion.sln
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,22 @@ Global
{63CBF008-0762-41FB-908E-CCE4E38CC038}.Release|TwinCAT RT (x64).Build.0 = Release|TwinCAT RT (x64)
{63CBF008-0762-41FB-908E-CCE4E38CC038}.Release|TwinCAT RT (x86).ActiveCfg = Release|TwinCAT RT (x86)
{63CBF008-0762-41FB-908E-CCE4E38CC038}.Release|TwinCAT RT (x86).Build.0 = Release|TwinCAT RT (x86)
{4CB52DF2-BB08-42C8-8F14-671947063F6D}.Debug|TwinCAT CE7 (ARMV7).ActiveCfg = Debug|TwinCAT CE7 (ARMV7)
{4CB52DF2-BB08-42C8-8F14-671947063F6D}.Debug|TwinCAT CE7 (ARMV7).Build.0 = Debug|TwinCAT CE7 (ARMV7)
{4CB52DF2-BB08-42C8-8F14-671947063F6D}.Debug|TwinCAT OS (ARMT2).ActiveCfg = Debug|TwinCAT OS (ARMT2)
{4CB52DF2-BB08-42C8-8F14-671947063F6D}.Debug|TwinCAT OS (ARMT2).Build.0 = Debug|TwinCAT OS (ARMT2)
{4CB52DF2-BB08-42C8-8F14-671947063F6D}.Debug|TwinCAT RT (x64).ActiveCfg = Debug|TwinCAT RT (x64)
{4CB52DF2-BB08-42C8-8F14-671947063F6D}.Debug|TwinCAT RT (x64).Build.0 = Debug|TwinCAT RT (x64)
{4CB52DF2-BB08-42C8-8F14-671947063F6D}.Debug|TwinCAT RT (x86).ActiveCfg = Debug|TwinCAT RT (x86)
{4CB52DF2-BB08-42C8-8F14-671947063F6D}.Debug|TwinCAT RT (x86).Build.0 = Debug|TwinCAT RT (x86)
{4CB52DF2-BB08-42C8-8F14-671947063F6D}.Release|TwinCAT CE7 (ARMV7).ActiveCfg = Release|TwinCAT CE7 (ARMV7)
{4CB52DF2-BB08-42C8-8F14-671947063F6D}.Release|TwinCAT CE7 (ARMV7).Build.0 = Release|TwinCAT CE7 (ARMV7)
{4CB52DF2-BB08-42C8-8F14-671947063F6D}.Release|TwinCAT OS (ARMT2).ActiveCfg = Release|TwinCAT OS (ARMT2)
{4CB52DF2-BB08-42C8-8F14-671947063F6D}.Release|TwinCAT OS (ARMT2).Build.0 = Release|TwinCAT OS (ARMT2)
{4CB52DF2-BB08-42C8-8F14-671947063F6D}.Release|TwinCAT RT (x64).ActiveCfg = Release|TwinCAT RT (x64)
{4CB52DF2-BB08-42C8-8F14-671947063F6D}.Release|TwinCAT RT (x64).Build.0 = Release|TwinCAT RT (x64)
{4CB52DF2-BB08-42C8-8F14-671947063F6D}.Release|TwinCAT RT (x86).ActiveCfg = Release|TwinCAT RT (x86)
{4CB52DF2-BB08-42C8-8F14-671947063F6D}.Release|TwinCAT RT (x86).Build.0 = Release|TwinCAT RT (x86)
{4B72BB13-08B4-4AB1-86B6-277D50D421AD}.Debug|TwinCAT CE7 (ARMV7).ActiveCfg = Debug|TwinCAT CE7 (ARMV7)
{4B72BB13-08B4-4AB1-86B6-277D50D421AD}.Debug|TwinCAT CE7 (ARMV7).Build.0 = Debug|TwinCAT CE7 (ARMV7)
{4B72BB13-08B4-4AB1-86B6-277D50D421AD}.Debug|TwinCAT OS (ARMT2).ActiveCfg = Debug|TwinCAT OS (ARMT2)
{4B72BB13-08B4-4AB1-86B6-277D50D421AD}.Debug|TwinCAT OS (ARMT2).Build.0 = Debug|TwinCAT OS (ARMT2)
{4B72BB13-08B4-4AB1-86B6-277D50D421AD}.Debug|TwinCAT RT (x64).ActiveCfg = Debug|TwinCAT RT (x64)
{4B72BB13-08B4-4AB1-86B6-277D50D421AD}.Debug|TwinCAT RT (x64).Build.0 = Debug|TwinCAT RT (x64)
{4B72BB13-08B4-4AB1-86B6-277D50D421AD}.Debug|TwinCAT RT (x86).ActiveCfg = Debug|TwinCAT RT (x86)
{4B72BB13-08B4-4AB1-86B6-277D50D421AD}.Debug|TwinCAT RT (x86).Build.0 = Debug|TwinCAT RT (x86)
{4B72BB13-08B4-4AB1-86B6-277D50D421AD}.Release|TwinCAT CE7 (ARMV7).ActiveCfg = Release|TwinCAT CE7 (ARMV7)
{4B72BB13-08B4-4AB1-86B6-277D50D421AD}.Release|TwinCAT CE7 (ARMV7).Build.0 = Release|TwinCAT CE7 (ARMV7)
{4B72BB13-08B4-4AB1-86B6-277D50D421AD}.Release|TwinCAT OS (ARMT2).ActiveCfg = Release|TwinCAT OS (ARMT2)
{4B72BB13-08B4-4AB1-86B6-277D50D421AD}.Release|TwinCAT OS (ARMT2).Build.0 = Release|TwinCAT OS (ARMT2)
{4B72BB13-08B4-4AB1-86B6-277D50D421AD}.Release|TwinCAT RT (x64).ActiveCfg = Release|TwinCAT RT (x64)
{4B72BB13-08B4-4AB1-86B6-277D50D421AD}.Release|TwinCAT RT (x64).Build.0 = Release|TwinCAT RT (x64)
{4B72BB13-08B4-4AB1-86B6-277D50D421AD}.Release|TwinCAT RT (x86).ActiveCfg = Release|TwinCAT RT (x86)
{4B72BB13-08B4-4AB1-86B6-277D50D421AD}.Release|TwinCAT RT (x86).Build.0 = Release|TwinCAT RT (x86)
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
8 changes: 4 additions & 4 deletions plc-kfe-motion/_Config/IO/Device 1 (EtherCAT).xti
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TcSmItem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.beckhoff.com/schemas/2012/07/TcSmItem" TcSmVersion="1.0" TcVersion="3.1.4022.30" ClassName="CDevEtherCATDef" SubType="111">
<Device Id="1" DevType="111" DevFlags="#x0003" AmsPort="28673" AmsNetId="172.21.92.58.2.1" RemoteName="Device 1 (EtherCAT)">
<Name>Device 1 (EtherCAT)</Name>
<?xml version="1.0"?>
<TcSmItem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.beckhoff.com/schemas/2012/07/TcSmProject" TcSmVersion="1.0" TcVersion="3.1.4024.35" ClassName="CDevEtherCATDef" SubType="111">
<Device Id="1" DevType="111" DevFlags="#x0003" AmsPort="28673" AmsNetId="172.21.92.58.2.1" RemoteName="Device 1 (EtherCAT)" InfoImageId="2">
<Name>__FILENAME__</Name>
<AddressInfo>
<Ccat>
<Address>-268435456</Address>
Expand Down
4 changes: 4 additions & 0 deletions plc-kfe-motion/_Config/PLC/kfe_motion.xti
Original file line number Diff line number Diff line change
Expand Up @@ -8431,6 +8431,10 @@ External Setpoint Generation:
<Name>GVL.fbFastFaultOutput2.q_xFastFaultOut</Name>
<Type>BOOL</Type>
</Var>
<Var>
<Name>GVL.fbFastFaultOutput3.q_xFastFaultOut</Name>
<Type>BOOL</Type>
</Var>
<Var>
<Name>GVL.rCurTrans</Name>
<Type GUID="{6D319B26-4590-2152-3DE7-3BA9B629CA65}">ARRAY [1..16] OF ST_PMPS_Attenuator_IO</Type>
Expand Down
4 changes: 4 additions & 0 deletions plc-kfe-motion/kfe_motion/GVLs/GVL.TcGVL
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,16 @@ VAR_GLOBAL
fbArbiter: FB_Arbiter(1);
{attribute 'pytmc' := 'pv: PLC:KFE:MOTION:ARB:02'}
fbArbiter2: FB_Arbiter(2);
{attribute 'pytmc' := 'pv: PLC:KFE:MOTION:ARB:03'}
fbArbiter3: FB_Arbiter(3);
{attribute 'pytmc' := 'pv: PLC:KFE:MOTION:FFO:01'}
{attribute 'TcLinkTo' := '.q_xFastFaultOut:=TIIB[PMPS_FFO]^Channel 1^Output'}
fbFastFaultOutput1: FB_HardwareFFOutput := (bAutoReset := TRUE, i_sNetID:='172.21.92.73.1.1');
{attribute 'pytmc' := 'pv: PLC:KFE:MOTION:FFO:02'}
{attribute 'TcLinkTo' := '.q_xFastFaultOut:=TIIB[PMPS_FFO]^Channel 2^Output'}
fbFastFaultOutput2: FB_HardwareFFOutput := (bAutoReset := TRUE, i_sNetID:='172.21.92.73.1.1');
{attribute 'pytmc' := 'pv: PLC:KFE:MOTION:FFO:03'}
fbFastFaultOutput3: FB_HardwareFFOutput := (bAutoReset := TRUE, i_sNetID:='172.21.92.73.1.1');

{attribute 'pytmc' := 'pv: PLC:KFE:MOTION:PMPS:ReqTrans'}
rReqTrans AT %I* : ARRAY [1..PMPS_GVL.AUX_ATTENUATORS] OF ST_PMPS_Attenuator_IO;
Expand Down
19 changes: 17 additions & 2 deletions plc-kfe-motion/kfe_motion/POUs/PRG_3_PMPS_POST.TcPOU
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,19 @@
VAR
fbArbiterIO: FB_SubSysToArbiter_IO;
fb_vetoArbiter: FB_VetoArbiter;
bM1K1_Veto_IN: BOOL;
ff3_ff2_link: FB_FastFault := (i_xAutoReset := TRUE, i_DevName := 'FF3 to FF2 Link', i_Desc := 'This is virtual FF3 fault, Please check the Group 3 faulting device ', i_TypeCode := 16#9999);

bM1K1_Veto_IN: BOOL;
bM1K3_Veto_OUT: 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 MR1K3 as veto for IM1K3
bM1K3_Veto_OUT := NOT PMPS_GVL.stCurrentBeamParameters.aVetoDevices[PMPS.K_Stopper.MR1K3_IN]
AND PMPS_GVL.stCurrentBeamParameters.aVetoDevices[PMPS.K_Stopper.MR1K3_OUT];



Expand All @@ -22,16 +27,26 @@ fb_vetoArbiter(bVeto:=bM1K1_Veto_IN,
HigherAuthority := GVL.fbArbiter,
LowerAuthority := GVL.fbArbiter2,
FFO := GVL.fbFastFaultOutput2);

fb_vetoArbiter(bVeto:=(bM1K1_Veto_IN OR bM1K3_VETO_OUT),
HigherAuthority := GVL.fbArbiter,
LowerAuthority := GVL.fbArbiter3,
FFO := GVL.fbFastFaultOutput2);


GVL.fbFastFaultOutput1.Execute();

GVL.fbFastFaultOutput2.Execute(i_xVeto:=bM1K1_Veto_IN);

GVL.fbFastFaultOutput3.Execute(i_xVeto:=(bM1K1_Veto_IN OR bM1K3_Veto_OUT));

fbArbiterIO(
Arbiter:=GVL.fbArbiter,
fbFFHWO:=GVL.fbFastFaultOutput1);

ff3_ff2_link(
io_fbFFHWO := GVL.fbFastFaultOutput2,
i_xOK := GVL.fbFastFaultOutput3.q_xFastFaultOut);

]]></ST>
</Implementation>
</POU>
Expand Down
5 changes: 3 additions & 2 deletions plc-kfe-motion/kfe_motion/POUs/PRG_IM1K3_PPM.TcPOU
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ VAR
bMoveOk := TRUE,
bValid := TRUE
);

END_VAR
]]></Declaration>
<Implementation>
Expand All @@ -35,8 +36,8 @@ fbStateSetup(stPositionState:=fbIM1K3.stYag1, fPosition:=-72.2, sPmpsState:='IM1
fbStateSetup(stPositionState:=fbIM1K3.stYag2, fPosition:=-98.21, sPmpsState:='IM1K3:PPM-YAG2');

fbIM1K3(
fbFFHWO := GVL.fbFastFaultOutput2,
fbArbiter := GVL.fbArbiter2,
fbFFHWO := GVL.fbFastFaultOutput3,
fbArbiter := GVL.fbArbiter3,
stYStage := Main.M4,
sDeviceName := 'IM1K3:PPM',
sTransitionKey := 'IM1K3:PPM-TRANSITION',
Expand Down
Loading