Skip to content

Commit

Permalink
ENH: add pmps sync group
Browse files Browse the repository at this point in the history
  • Loading branch information
nrwslac committed Jun 20, 2024
1 parent fc147a9 commit 66ed293
Show file tree
Hide file tree
Showing 7 changed files with 2,318 additions and 2,236 deletions.
1 change: 1 addition & 0 deletions lcls-plc-txi-optics/_Config/IO/Device 1 (EtherCAT).xti
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
</Box>
<EtherCAT EnableVirtualSwitch="true" MaxSwitchPorts="3" MaxSwitchFrames="140">
<SyncUnit Name="m1k3" NoDeleteIfUnused="true"/>
<SyncUnit Name="PMPS" NoDeleteIfUnused="true"/>
</EtherCAT>
</Device>
</TcSmItem>
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<EtherCAT SlaveType="1" PdiType="#x0104" CycleMBoxPollingTime="0" VendorId="#x00000002" ProductCode="#x089a3052" RevisionNo="#x00130000" CheckRevisionNoType="3" PortPhys="51" MaxSlotCount="256" MaxSlotGroupCount="1" SlotPdoIncrement="1" SlotIndexIncrement="16" Type="EL2202 2Ch. Dig. Output 24V, 0.5A" Desc="EL2202">
<SyncMan>000f01004400010003000000000000000000000f44090000</SyncMan>
<Fmmu>0000000000000000000f00020100000001000000060000000000000000000000</Fmmu>
<SuName>PMPS</SuName>
<Pdo Name="Channel 1" Index="#x1600" InOut="1" Flags="#x0011" SyncMan="0">
<Entry Name="Output" Index="#x7000" Sub="#x01">
<Type>BIT</Type>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,10 @@
<Profile>
<Dictionary>
<DataTypes>
<DataType>
<Name>BOOL</Name>
<BitSize>1</BitSize>
</DataType>
<DataType>
<Name>BYTE</Name>
<BitSize>8</BitSize>
Expand Down Expand Up @@ -357,7 +361,7 @@
</DataType>
<DataType>
<Name>DT1A08</Name>
<BitSize>336</BitSize>
<BitSize>368</BitSize>
<SubItem>
<SubIdx>0</SubIdx>
<Name>SubIndex 000</Name>
Expand Down Expand Up @@ -479,6 +483,17 @@
<Category>o</Category>
</Flags>
</SubItem>
<SubItem>
<SubIdx>11</SubIdx>
<Name>SubIndex 011</Name>
<Type>UDINT</Type>
<BitSize>32</BitSize>
<BitOffs>336</BitOffs>
<Flags>
<Access WriteRestrictions="PreOP">rw</Access>
<Category>o</Category>
</Flags>
</SubItem>
</DataType>
<DataType>
<Name>DT1608</Name>
Expand Down Expand Up @@ -653,7 +668,7 @@
</DataType>
<DataType>
<Name>DT6000</Name>
<BitSize>1904</BitSize>
<BitSize>1912</BitSize>
<SubItem>
<SubIdx>0</SubIdx>
<Name>SubIndex 000</Name>
Expand Down Expand Up @@ -701,6 +716,18 @@
<PdoMapping>R</PdoMapping>
</Flags>
</SubItem>
<SubItem>
<SubIdx>4</SubIdx>
<Name>FFO</Name>
<Type>BOOL</Type>
<BitSize>8</BitSize>
<BitOffs>1904</BitOffs>
<Flags>
<Access>rw</Access>
<Category>o</Category>
<PdoMapping>R</PdoMapping>
</Flags>
</SubItem>
</DataType>
<DataType>
<Name>DT7000</Name>
Expand Down Expand Up @@ -735,12 +762,12 @@
<Index>#x1a08</Index>
<Name>IO Outputs</Name>
<Type>DT1A08</Type>
<BitSize>336</BitSize>
<BitSize>368</BitSize>
<Info>
<SubItem>
<Name>SubIndex 000</Name>
<Info>
<DefaultData>0a</DefaultData>
<DefaultData>0b</DefaultData>
</Info>
</SubItem>
<SubItem>
Expand Down Expand Up @@ -803,6 +830,12 @@
<DefaultData>40030060</DefaultData>
</Info>
</SubItem>
<SubItem>
<Name>SubIndex 011</Name>
<Info>
<DefaultData>08040060</DefaultData>
</Info>
</SubItem>
</Info>
<Flags>
<Access>ro</Access>
Expand Down Expand Up @@ -937,14 +970,14 @@
<Index>#x6000</Index>
<Name>Outputs</Name>
<Type>DT6000</Type>
<BitSize>1904</BitSize>
<BitSize>1912</BitSize>
<Info>
<SubItem>
<Name>SubIndex 000</Name>
<Info>
<MinValue>#x0</MinValue>
<MaxValue>#xff</MaxValue>
<DefaultValue>#x3</DefaultValue>
<DefaultValue>#x4</DefaultValue>
</Info>
</SubItem>
<SubItem>
Expand All @@ -965,6 +998,12 @@
<DefaultData>0000000000000000</DefaultData>
</Info>
</SubItem>
<SubItem>
<Name>FFO</Name>
<Info>
<DefaultData>00</DefaultData>
</Info>
</SubItem>
</Info>
<Flags>
<Access>ro</Access>
Expand Down Expand Up @@ -1003,13 +1042,14 @@
<EtherCAT SlaveType="3" AdsServerAddress="ac1558360205eb03" PdiType="#x0008" MboxDataLinkLayer="true" StateMBoxPolling="true" CycleMBoxPollingTime="0" CoeType="47" EoeType="1" FoeType="1" VendorId="#x00000002" ProductCode="#x1a273052" RevisionNo="#x00050000" InfoDataAddr="true" InfoDataNetId="true" TimeoutMailbox2="2000" GenerateOwnNetId="true" CheckRevisionNoType="3" PortPhys="51" DcTimeLoopControlOnly="true" MaxSlotCount="256" MaxSlotGroupCount="1" SlotPdoIncrement="1" SlotIndexIncrement="16" Type="EL6695 EtherCAT Bridge terminal (Primary)" Desc="EL6695">
<SyncMan>0010000426000100010000008000da050004001026010000</SyncMan>
<SyncMan>0016000422000100020000008000da050004001622010000</SyncMan>
<SyncMan>001cec006400010003000000000000000000001c64010000</SyncMan>
<SyncMan>001ced006400010003000000000000000000001c64010000</SyncMan>
<SyncMan>008ede002000010004000000000000000200008e20010000</SyncMan>
<Fmmu>0000000000000000001c00020100000001000000000000000000000000000000</Fmmu>
<Fmmu>0000000000000000008e00010100000002000000000000000000000000000000</Fmmu>
<Fmmu>00000000000000000d0800010100000003000000000000000000000000000000</Fmmu>
<SwitchPortData>00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000</SwitchPortData>
<BootStrapData>0010140200141402</BootStrapData>
<SuName>PMPS</SuName>
<DcMode>4672656552756e0000000000000000004672656552756e00000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000</DcMode>
<DcMode>4443000000000000000000000000000044432d53796e6368726f6e000000000000000000000000000000000000000000000000000000000000000000000020030100000000000000000000000000000000000000000000000000000000000000</DcMode>
<Pdo Name="SYNC Inputs" Index="#x1a01" Flags="#x0010" SyncMan="3">
Expand Down Expand Up @@ -1122,7 +1162,7 @@
</Entry>
</Pdo>
<Pdo Name="IO Inputs" Index="#x1a08" Flags="#x0020" SyncMan="3">
<Entry Name="CurrentBP" Index="#x6000" Sub="#x01">
<Entry Name="CurrentBP" BitLen="240" Index="#x6000" Sub="#x01">
<Type GUID="{292CD354-C7C0-4A61-AAD0-1C85DD69646B}">ST_BeamParams_IO</Type>
</Entry>
</Pdo>
Expand All @@ -1136,6 +1176,9 @@
<Entry Name="MR2K3_Y_ENC" BitLen="64" Index="#x7000" Sub="#x03">
<Type>ULINT</Type>
</Entry>
<Entry Name="FFO" BitLen="8" Index="#x7000" Sub="#x04">
<Type>BOOL</Type>
</Entry>
</Pdo>
<CoeProfile ProfileNo="5001"/>
</EtherCAT>
Expand Down
6 changes: 2 additions & 4 deletions lcls-plc-txi-optics/_Config/PLC/txi_optics.xti
Original file line number Diff line number Diff line change
Expand Up @@ -1349,7 +1349,7 @@ External Setpoint Generation:
</DataType>
</DataTypes>
<Project GUID="{6F8D8EEF-45CD-488B-9616-A25D9A723693}" Name="txi_optics" PrjFilePath="..\..\txi_optics\txi_optics.plcproj" TmcFilePath="..\..\txi_optics\txi_optics.tmc" ReloadTmc="true" AmsPort="851" FileArchiveSettings="#x000e" SymbolicMapping="true">
<Instance Id="#x08502000" TcSmClass="TComPlcObjDef" KeepUnrestoredLinks="2" TmcPath="txi_optics\txi_optics.tmc" TmcHash="{22DF2075-3C7E-62DF-E245-E5441A90D40C}">
<Instance Id="#x08502000" TcSmClass="TComPlcObjDef" KeepUnrestoredLinks="2" TmcPath="txi_optics\txi_optics.tmc" TmcHash="{D205155D-5F21-CE34-8022-FE8F9ECDCFE1}">
<Name>txi_optics Instance</Name>
<CLSID ClassFactory="TcPlc30">{08500001-0000-0000-F000-000000000064}</CLSID>
<Vars VarGrpType="1">
Expand Down Expand Up @@ -2198,13 +2198,11 @@ External Setpoint Generation:
</Project>
<Mappings>
<OwnerA Name="txi_optics Instance">
<OwnerB Name="TIID^Device 1 (EtherCAT)^Term 1 (EK1200)^PMPS_FFO">
<Link VarA="PlcTask Outputs^GVL_PMPS.fbFastFaultOutput1.q_xFastFaultOut" VarB="Channel 1^Output" AutoLink="true" Size="1"/>
</OwnerB>
<OwnerB Name="TIID^Device 1 (EtherCAT)^Term 1 (EK1200)^PMPS_PRE">
<Link VarA="PlcTask Inputs^PRG_2_PMPS_POST.fbArbiterIO.i_stCurrentBP" VarB="IO Inputs^CurrentBP" AutoLink="true"/>
<Link VarA="PlcTask Inputs^PRG_2_PMPS_POST.fbArbiterIO.xTxPDO_state" VarB="SYNC Inputs^TxPDO state" AutoLink="true"/>
<Link VarA="PlcTask Inputs^PRG_2_PMPS_POST.fbArbiterIO.xTxPDO_toggle" VarB="SYNC Inputs^TxPDO toggle" AutoLink="true"/>
<Link VarA="PlcTask Outputs^GVL_PMPS.fbFastFaultOutput1.q_xFastFaultOut" VarB="IO Outputs^FFO" AutoLink="true"/>
<Link VarA="PlcTask Outputs^PRG_2_PMPS_POST.fbArbiterIO.q_stRequestedBP" VarB="IO Outputs^RequestedBP" AutoLink="true"/>
<Link VarA="PlcTask Outputs^PRG_MR1K3_SOMS.nMR1K3_Y_ENC_PMPS" VarB="IO Outputs^MR1K3_Y_ENC" AutoLink="true"/>
<Link VarA="PlcTask Outputs^PRG_MR2K3_SOMS.nMR2K3_Y_ENC_PMPS" VarB="IO Outputs^MR2K3_Y_ENC" AutoLink="true"/>
Expand Down
2 changes: 1 addition & 1 deletion lcls-plc-txi-optics/txi_optics/GVLs/GVL_PMPS.TcGVL
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ VAR_GLOBAL
{attribute 'pytmc' := 'pv: PLC:TXI:KFE:OPTICS:ARB:02'}
fbArbiter2: FB_Arbiter(2);
{attribute 'pytmc' := 'pv: PLC:TXI:KFE:OPTICS:FFO:01'}
{attribute 'TcLinkTo' := '.q_xFastFaultOut:=TIIB[PMPS_FFO]^Channel 1^Output'}
{attribute 'TcLinkTo' := '.q_xFastFaultOut:=TIIB[PMPS_PRE]^IO Outputs^FFO'}
fbFastFaultOutput1: FB_HardwareFFOutput := (bAutoReset := TRUE , i_sNetID:='172.21.42.126.1.1' );
END_VAR]]></Declaration>
</GVL>
Expand Down
2 changes: 1 addition & 1 deletion lcls-plc-txi-optics/txi_optics/txi_optics.plcproj
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
<Resolution>lcls-twincat-motion, 4.1.1 (SLAC)</Resolution>
</PlaceholderResolution>
<PlaceholderResolution Include="PMPS">
<Resolution>PMPS, 3.2.1 (SLAC - LCLS)</Resolution>
<Resolution>PMPS, 3.3.0 (SLAC - LCLS)</Resolution>
</PlaceholderResolution>
</ItemGroup>
<ProjectExtensions>
Expand Down
Loading

0 comments on commit 66ed293

Please sign in to comment.