-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66 from ZLLentz/enh_im4k2_24bits
ENH: quickly set up 24-bit readouts for IM4K2 (similar to HE-style)
- Loading branch information
Showing
10 changed files
with
2,120 additions
and
887 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
136 changes: 136 additions & 0 deletions
136
...K1521-0010)/Term 34 (EK1501-0010)/Term 50 (EK1122)/IM4K2-PPM (EK1100)/IM4K2-EL3602-E8.xti
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
<?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="CFlbTermDef" SubType="9099"> | ||
<DataTypes> | ||
<DataType> | ||
<Name GUID="{18071995-0000-0000-0000-002000000007}" IecBaseType="true" BitType="true" AutoDeleteType="true" HideSubItems="true">ARRAY [0..6] OF BIT</Name> | ||
<BitSize>7</BitSize> | ||
<BaseType GUID="{18071995-0000-0000-0000-000000000010}">BIT</BaseType> | ||
<ArrayInfo> | ||
<LBound>0</LBound> | ||
<Elements>7</Elements> | ||
</ArrayInfo> | ||
</DataType> | ||
</DataTypes> | ||
<ImageDatas> | ||
<ImageData Id="1000">424dd6020000000000003600000028000000100000000e0000000100180000000000a0020000c40e0000c40e00000000000000000000ff00ffff00ffff00ffff00ffff00ffff00ff808080808080808080808080808080ff00ffff00ffff00ffff00ffff00ffff00ffff00ffff00ffff00ffff00ffff00ffc0c0c0000000c0c0c0000000808080ff00ffff00ffff00ffff00ffff00ffff00ffff00ffff00ffff00ffff00ffff00ffc0c0c000ffffc0c0c000ffff808080ff00ffff00ffff00ffff00ffff00ffff00ffff00ffff00ffff00ffff00ffff00ffc0c0c0c0c0c0c0c0c0c0c0c0808080ff00ffff00ffff00ffff00ffff00ffff00ffff00ffff00ffff00ffff00ffff00ffc0c0c0000000c0c0c0000000808080ff00ffff00ffff00ffff00ffff00ffff00ffff00ffff00ffff00ffff00ffff00ffc0c0c0ff0000c0c0c0ff0000808080ff00ffff00ffff00ffff00ffff00ffff00ffff00ffff00ffff00ffff00ffff00ffc0c0c0c0c0c0c0c0c0c0c0c0808080ff00ffff00ffff00ffff00ffff00ff00ff0000ff0000ff0000ff0000ff0000ff00c0c0c0000000c0c0c0000000808080ff00ffff00ffff00ffff00ffff00ff00ff0000ff0000ff0000ff0000ff0000ff00c0c0c00000ffc0c0c00000ff808080ff00ffff00ffff00ffff00ffff00ff00ff0000ff0000ff0000ff0000ff0000ff00c0c0c0c0c0c0c0c0c0c0c0c0808080ff00ffff00ffff00ffff00ffff00ff00ff0000ff0000ff0000ff0000ff0000ff00c0c0c0000000c0c0c0000000808080ff00ffff00ffff00ffff00ffff00ff00ff0000ff0000ff0000ff0000ff0000ff00c0c0c0c0c0c0c0c0c0c0c0c0808080ff00ffff00ffff00ffff00ffff00ff00ff0000ff0000ff0000ff0000ff0000ff00c0c0c0008000c0c0c0008000808080ff00ffff00ffff00ffff00ffff00ff00ff0000ff0000ff0000ff0000ff0000ff00c0c0c0c0c0c0c0c0c0c0c0c0808080ff00ffff00ffff00ffff00ffff00ff</ImageData> | ||
</ImageDatas> | ||
<Box Id="76" BoxType="9099" BoxFlags="#x00000020"> | ||
<Name>__FILENAME__</Name> | ||
<ImageId>1000</ImageId> | ||
<EtherCAT SlaveType="2" PdiType="#x0005" MboxDataLinkLayer="true" StateMBoxPolling="true" CycleMBoxPollingTime="0" CoeType="7" FoeType="1" VendorId="#x00000002" ProductCode="#x0e123052" RevisionNo="#x00130000" InfoDataAddr="true" TimeoutMailbox2="2000" CheckRevisionNoType="3" PortPhys="51" MaxSlotCount="256" MaxSlotGroupCount="1" SlotPdoIncrement="1" SlotIndexIncrement="16" Type="EL3602 2Ch. Ana. Input +/-10Volt, Diff. 24bit" Desc="EL3602"> | ||
<SyncMan>001080002600010001000000800080008000001026010000</SyncMan> | ||
<SyncMan>801080002200010002000000800080008000801022010000</SyncMan> | ||
<SyncMan>001100000400000003000000000000000000001104000000</SyncMan> | ||
<SyncMan>80110c002000010004000000000000000c00801120010000</SyncMan> | ||
<Fmmu>0000000000000000801100010100000002000000000000000000000000000000</Fmmu> | ||
<Fmmu>00000000000000000d0800010100000003000000000000000000000000000000</Fmmu> | ||
<BootStrapData>0010f400f410f400</BootStrapData> | ||
<Pdo Name="AI Inputs Channel 1" Index="#x1a00" Flags="#x0010" SyncMan="3"> | ||
<Entry Name="Underrange" Index="#x6000" Sub="#x01"> | ||
<Type>BIT</Type> | ||
<Comment> | ||
<![CDATA[Underrange event active]]> | ||
</Comment> | ||
</Entry> | ||
<Entry Name="Overrange" Index="#x6000" Sub="#x02"> | ||
<Type>BIT</Type> | ||
<Comment> | ||
<![CDATA[Overrange event active]]> | ||
</Comment> | ||
</Entry> | ||
<Entry Name="Limit 1" Index="#x6000" Sub="#x03"> | ||
<Type>BIT2</Type> | ||
<Comment> | ||
<![CDATA[Bit0: Value smaller/equal Limit1 | ||
Bit1: Value bigger/equal Limit1]]> | ||
</Comment> | ||
</Entry> | ||
<Entry Name="Limit 2" Index="#x6000" Sub="#x05"> | ||
<Type>BIT2</Type> | ||
<Comment> | ||
<![CDATA[Bit0: Value smaller/equal Limit2 | ||
Bit1: Value bigger/equal Limit2]]> | ||
</Comment> | ||
</Entry> | ||
<Entry Name="Error" Index="#x6000" Sub="#x07"> | ||
<Type>BIT</Type> | ||
<Comment> | ||
<![CDATA[Bit set when Over- or Underrange]]> | ||
</Comment> | ||
</Entry> | ||
<Entry> | ||
<Type GUID="{18071995-0000-0000-0000-002000000007}">ARRAY [0..6] OF BIT</Type> | ||
</Entry> | ||
<Entry Name="TxPDO State" Index="#x1800" Sub="#x07"> | ||
<Type>BIT</Type> | ||
<Comment> | ||
<![CDATA[TRUE when this TxPDO is not valid]]> | ||
</Comment> | ||
</Entry> | ||
<Entry Name="TxPDO Toggle" Index="#x1800" Sub="#x09"> | ||
<Type>BIT</Type> | ||
<Comment> | ||
<![CDATA[Bit toggles everytime when new value available]]> | ||
</Comment> | ||
</Entry> | ||
<Entry Name="Value" Index="#x6000" Sub="#x11" Flags="#x00010000"> | ||
<Type>DINT</Type> | ||
</Entry> | ||
</Pdo> | ||
<Pdo Name="AI Inputs Channel 2" Index="#x1a01" Flags="#x0010" SyncMan="3"> | ||
<Entry Name="Underrange" Index="#x6010" Sub="#x01"> | ||
<Type>BIT</Type> | ||
<Comment> | ||
<![CDATA[Underrange event active]]> | ||
</Comment> | ||
</Entry> | ||
<Entry Name="Overrange" Index="#x6010" Sub="#x02"> | ||
<Type>BIT</Type> | ||
<Comment> | ||
<![CDATA[Overrange event active]]> | ||
</Comment> | ||
</Entry> | ||
<Entry Name="Limit 1" Index="#x6010" Sub="#x03"> | ||
<Type>BIT2</Type> | ||
<Comment> | ||
<![CDATA[Bit0: Value smaller/equal Limit1 | ||
Bit1: Value bigger/equal Limit1]]> | ||
</Comment> | ||
</Entry> | ||
<Entry Name="Limit 2" Index="#x6010" Sub="#x05"> | ||
<Type>BIT2</Type> | ||
<Comment> | ||
<![CDATA[Bit0: Value smaller/equal Limit2 | ||
Bit1: Value bigger/equal Limit2]]> | ||
</Comment> | ||
</Entry> | ||
<Entry Name="Error" Index="#x6010" Sub="#x07"> | ||
<Type>BIT</Type> | ||
<Comment> | ||
<![CDATA[Bit set when Over- or Underrange]]> | ||
</Comment> | ||
</Entry> | ||
<Entry> | ||
<Type GUID="{18071995-0000-0000-0000-002000000007}">ARRAY [0..6] OF BIT</Type> | ||
</Entry> | ||
<Entry Name="TxPDO State" Index="#x1801" Sub="#x07"> | ||
<Type>BIT</Type> | ||
<Comment> | ||
<![CDATA[TRUE when this TxPDO is not valid]]> | ||
</Comment> | ||
</Entry> | ||
<Entry Name="TxPDO Toggle" Index="#x1801" Sub="#x09"> | ||
<Type>BIT</Type> | ||
<Comment> | ||
<![CDATA[Bit toggles everytime when new value available]]> | ||
</Comment> | ||
</Entry> | ||
<Entry Name="Value" Index="#x6010" Sub="#x11" Flags="#x00010000"> | ||
<Type>DINT</Type> | ||
</Entry> | ||
</Pdo> | ||
<CoeProfile ProfileNo="19665801"/> | ||
<CoeProfile ProfileNo="19665801"/> | ||
</EtherCAT> | ||
</Box> | ||
</TcSmItem> |
4 changes: 2 additions & 2 deletions
4
...2)/IM4K2-PPM (EK1100)/IM4K2-EL9011-E8.xti → ...2)/IM4K2-PPM (EK1100)/IM4K2-EL9011-E9.xti
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
plc-kfe-rix-motion/kfe_rix_motion/POUs/IM4K2/FB_AnalogInput_IM4K2.TcPOU
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4022.18"> | ||
<POU Name="FB_AnalogInput_IM4K2" Id="{c3bf2f11-e399-406d-ba95-ae8960e90a27}" SpecialFunc="None"> | ||
<Declaration><![CDATA[FUNCTION_BLOCK FB_AnalogInput_IM4K2 | ||
(* | ||
Converts the integer from an analog input terminal to a real unit value (e.g., volts) | ||
2019-10-09 Zachary Lentz | ||
*) | ||
VAR_INPUT | ||
// Connect this input to the terminal | ||
iRaw AT %I*: DINT; | ||
// The number of bits correlated with the terminal's max value. This is not necessarily the resolution parameter. | ||
iTermBits: UINT; | ||
// The fReal value correlated with the terminal's max value | ||
fTermMax: LREAL; | ||
// The fReal value correlated with the terminal's min value | ||
fTermMin: LREAL; | ||
// Value to scale the end result to | ||
{attribute 'pytmc' := ' | ||
pv: RES | ||
io: io | ||
'} | ||
fResolution : LREAL := 1; | ||
{attribute 'pytmc' := ' | ||
pv: OFF | ||
io: io | ||
'} | ||
fOffset : LREAL; | ||
END_VAR | ||
VAR_OUTPUT | ||
// The real value read from the output | ||
{attribute 'pytmc' := ' | ||
pv: VAL | ||
io: i | ||
'} | ||
fReal: LREAL; | ||
END_VAR | ||
VAR | ||
fScale: LREAL; | ||
END_VAR]]></Declaration> | ||
<Implementation> | ||
<ST><![CDATA[IF fScale = 0 AND fTermMax > fTermMin THEN | ||
fScale := (EXPT(2, iTermBits) - 1) / (fTermMax - fTermMin); | ||
END_IF | ||
IF fScale <> 0 THEN | ||
fReal := iRaw / fScale + fTermMin; | ||
fReal := fReal * fResolution + fOffset; | ||
END_IF]]></ST> | ||
</Implementation> | ||
</POU> | ||
</TcPlcObject> |
Oops, something went wrong.