Updated encoder
This commit is contained in:
@@ -90,7 +90,7 @@
|
||||
</SubItem>
|
||||
<SubItem>
|
||||
<SubIdx>1</SubIdx>
|
||||
<Name>Scale</Name>
|
||||
<Name>EncScale</Name>
|
||||
<Type>UDINT</Type>
|
||||
<BitSize>32</BitSize>
|
||||
<BitOffs>16</BitOffs>
|
||||
@@ -507,6 +507,30 @@
|
||||
</Flags>
|
||||
</SubItem>
|
||||
</DataType>
|
||||
<DataType>
|
||||
<Name>DT1612</Name>
|
||||
<BitSize>48</BitSize>
|
||||
<SubItem>
|
||||
<SubIdx>0</SubIdx>
|
||||
<Name>Max SubIndex</Name>
|
||||
<Type>USINT</Type>
|
||||
<BitSize>8</BitSize>
|
||||
<BitOffs>0</BitOffs>
|
||||
<Flags>
|
||||
<Access>ro</Access>
|
||||
</Flags>
|
||||
</SubItem>
|
||||
<SubItem>
|
||||
<SubIdx>1</SubIdx>
|
||||
<Name>EncIndexLatchEnable</Name>
|
||||
<Type>UDINT</Type>
|
||||
<BitSize>32</BitSize>
|
||||
<BitOffs>16</BitOffs>
|
||||
<Flags>
|
||||
<Access>ro</Access>
|
||||
</Flags>
|
||||
</SubItem>
|
||||
</DataType>
|
||||
<DataType>
|
||||
<Name>DT1A00</Name>
|
||||
<BitSize>48</BitSize>
|
||||
@@ -522,7 +546,7 @@
|
||||
</SubItem>
|
||||
<SubItem>
|
||||
<SubIdx>1</SubIdx>
|
||||
<Name>Velocity</Name>
|
||||
<Name>EncPosition</Name>
|
||||
<Type>UDINT</Type>
|
||||
<BitSize>32</BitSize>
|
||||
<BitOffs>16</BitOffs>
|
||||
@@ -546,7 +570,7 @@
|
||||
</SubItem>
|
||||
<SubItem>
|
||||
<SubIdx>1</SubIdx>
|
||||
<Name>Frequency</Name>
|
||||
<Name>EncVelocity</Name>
|
||||
<Type>UDINT</Type>
|
||||
<BitSize>32</BitSize>
|
||||
<BitOffs>16</BitOffs>
|
||||
@@ -675,6 +699,54 @@
|
||||
</Flags>
|
||||
</SubItem>
|
||||
</DataType>
|
||||
<DataType>
|
||||
<Name>DT1A07</Name>
|
||||
<BitSize>48</BitSize>
|
||||
<SubItem>
|
||||
<SubIdx>0</SubIdx>
|
||||
<Name>Max SubIndex</Name>
|
||||
<Type>USINT</Type>
|
||||
<BitSize>8</BitSize>
|
||||
<BitOffs>0</BitOffs>
|
||||
<Flags>
|
||||
<Access>ro</Access>
|
||||
</Flags>
|
||||
</SubItem>
|
||||
<SubItem>
|
||||
<SubIdx>1</SubIdx>
|
||||
<Name>IndexByte</Name>
|
||||
<Type>UDINT</Type>
|
||||
<BitSize>32</BitSize>
|
||||
<BitOffs>16</BitOffs>
|
||||
<Flags>
|
||||
<Access>ro</Access>
|
||||
</Flags>
|
||||
</SubItem>
|
||||
</DataType>
|
||||
<DataType>
|
||||
<Name>DT1A08</Name>
|
||||
<BitSize>48</BitSize>
|
||||
<SubItem>
|
||||
<SubIdx>0</SubIdx>
|
||||
<Name>Max SubIndex</Name>
|
||||
<Type>USINT</Type>
|
||||
<BitSize>8</BitSize>
|
||||
<BitOffs>0</BitOffs>
|
||||
<Flags>
|
||||
<Access>ro</Access>
|
||||
</Flags>
|
||||
</SubItem>
|
||||
<SubItem>
|
||||
<SubIdx>1</SubIdx>
|
||||
<Name>IndexStatus</Name>
|
||||
<Type>UDINT</Type>
|
||||
<BitSize>32</BitSize>
|
||||
<BitOffs>16</BitOffs>
|
||||
<Flags>
|
||||
<Access>ro</Access>
|
||||
</Flags>
|
||||
</SubItem>
|
||||
</DataType>
|
||||
<DataType>
|
||||
<Name>DT1C00ARR</Name>
|
||||
<BaseType>USINT</BaseType>
|
||||
@@ -710,15 +782,15 @@
|
||||
<DataType>
|
||||
<Name>DT1C12ARR</Name>
|
||||
<BaseType>UINT</BaseType>
|
||||
<BitSize>288</BitSize>
|
||||
<BitSize>304</BitSize>
|
||||
<ArrayInfo>
|
||||
<LBound>1</LBound>
|
||||
<Elements>18</Elements>
|
||||
<Elements>19</Elements>
|
||||
</ArrayInfo>
|
||||
</DataType>
|
||||
<DataType>
|
||||
<Name>DT1C12</Name>
|
||||
<BitSize>304</BitSize>
|
||||
<BitSize>320</BitSize>
|
||||
<SubItem>
|
||||
<SubIdx>0</SubIdx>
|
||||
<Name>Max SubIndex</Name>
|
||||
@@ -732,7 +804,7 @@
|
||||
<SubItem>
|
||||
<Name>Elements</Name>
|
||||
<Type>DT1C12ARR</Type>
|
||||
<BitSize>288</BitSize>
|
||||
<BitSize>304</BitSize>
|
||||
<BitOffs>16</BitOffs>
|
||||
<Flags>
|
||||
<Access>ro</Access>
|
||||
@@ -742,15 +814,15 @@
|
||||
<DataType>
|
||||
<Name>DT1C13ARR</Name>
|
||||
<BaseType>UINT</BaseType>
|
||||
<BitSize>112</BitSize>
|
||||
<BitSize>144</BitSize>
|
||||
<ArrayInfo>
|
||||
<LBound>1</LBound>
|
||||
<Elements>7</Elements>
|
||||
<Elements>9</Elements>
|
||||
</ArrayInfo>
|
||||
</DataType>
|
||||
<DataType>
|
||||
<Name>DT1C13</Name>
|
||||
<BitSize>128</BitSize>
|
||||
<BitSize>160</BitSize>
|
||||
<SubItem>
|
||||
<SubIdx>0</SubIdx>
|
||||
<Name>Max SubIndex</Name>
|
||||
@@ -764,7 +836,7 @@
|
||||
<SubItem>
|
||||
<Name>Elements</Name>
|
||||
<Type>DT1C13ARR</Type>
|
||||
<BitSize>112</BitSize>
|
||||
<BitSize>144</BitSize>
|
||||
<BitOffs>16</BitOffs>
|
||||
<Flags>
|
||||
<Access>ro</Access>
|
||||
@@ -889,7 +961,7 @@
|
||||
</Object>
|
||||
<Object>
|
||||
<Index>#x1600</Index>
|
||||
<Name>Scale</Name>
|
||||
<Name>EncScale</Name>
|
||||
<Type>DT1600</Type>
|
||||
<BitSize>48</BitSize>
|
||||
<Info>
|
||||
@@ -900,7 +972,7 @@
|
||||
</Info>
|
||||
</SubItem>
|
||||
<SubItem>
|
||||
<Name>Scale</Name>
|
||||
<Name>EncScale</Name>
|
||||
<Info>
|
||||
<DefaultValue>#x70000020</DefaultValue>
|
||||
</Info>
|
||||
@@ -1283,9 +1355,31 @@
|
||||
<Flags>
|
||||
</Flags>
|
||||
</Object>
|
||||
<Object>
|
||||
<Index>#x1612</Index>
|
||||
<Name>EncIndexLatchEnable</Name>
|
||||
<Type>DT1612</Type>
|
||||
<BitSize>48</BitSize>
|
||||
<Info>
|
||||
<SubItem>
|
||||
<Name>Max SubIndex</Name>
|
||||
<Info>
|
||||
<DefaultValue>1</DefaultValue>
|
||||
</Info>
|
||||
</SubItem>
|
||||
<SubItem>
|
||||
<Name>EncIndexLatchEnable</Name>
|
||||
<Info>
|
||||
<DefaultValue>#x70120008</DefaultValue>
|
||||
</Info>
|
||||
</SubItem>
|
||||
</Info>
|
||||
<Flags>
|
||||
</Flags>
|
||||
</Object>
|
||||
<Object>
|
||||
<Index>#x1A00</Index>
|
||||
<Name>Velocity</Name>
|
||||
<Name>EncPosition</Name>
|
||||
<Type>DT1A00</Type>
|
||||
<BitSize>48</BitSize>
|
||||
<Info>
|
||||
@@ -1296,7 +1390,7 @@
|
||||
</Info>
|
||||
</SubItem>
|
||||
<SubItem>
|
||||
<Name>Velocity</Name>
|
||||
<Name>EncPosition</Name>
|
||||
<Info>
|
||||
<DefaultValue>#x60000020</DefaultValue>
|
||||
</Info>
|
||||
@@ -1307,7 +1401,7 @@
|
||||
</Object>
|
||||
<Object>
|
||||
<Index>#x1A01</Index>
|
||||
<Name>Frequency</Name>
|
||||
<Name>EncVelocity</Name>
|
||||
<Type>DT1A01</Type>
|
||||
<BitSize>48</BitSize>
|
||||
<Info>
|
||||
@@ -1318,7 +1412,7 @@
|
||||
</Info>
|
||||
</SubItem>
|
||||
<SubItem>
|
||||
<Name>Frequency</Name>
|
||||
<Name>EncVelocity</Name>
|
||||
<Info>
|
||||
<DefaultValue>#x60010020</DefaultValue>
|
||||
</Info>
|
||||
@@ -1437,6 +1531,50 @@
|
||||
<Flags>
|
||||
</Flags>
|
||||
</Object>
|
||||
<Object>
|
||||
<Index>#x1A07</Index>
|
||||
<Name>IndexByte</Name>
|
||||
<Type>DT1A07</Type>
|
||||
<BitSize>48</BitSize>
|
||||
<Info>
|
||||
<SubItem>
|
||||
<Name>Max SubIndex</Name>
|
||||
<Info>
|
||||
<DefaultValue>1</DefaultValue>
|
||||
</Info>
|
||||
</SubItem>
|
||||
<SubItem>
|
||||
<Name>IndexByte</Name>
|
||||
<Info>
|
||||
<DefaultValue>#x60070020</DefaultValue>
|
||||
</Info>
|
||||
</SubItem>
|
||||
</Info>
|
||||
<Flags>
|
||||
</Flags>
|
||||
</Object>
|
||||
<Object>
|
||||
<Index>#x1A08</Index>
|
||||
<Name>IndexStatus</Name>
|
||||
<Type>DT1A08</Type>
|
||||
<BitSize>48</BitSize>
|
||||
<Info>
|
||||
<SubItem>
|
||||
<Name>Max SubIndex</Name>
|
||||
<Info>
|
||||
<DefaultValue>1</DefaultValue>
|
||||
</Info>
|
||||
</SubItem>
|
||||
<SubItem>
|
||||
<Name>IndexStatus</Name>
|
||||
<Info>
|
||||
<DefaultValue>#x60080020</DefaultValue>
|
||||
</Info>
|
||||
</SubItem>
|
||||
</Info>
|
||||
<Flags>
|
||||
</Flags>
|
||||
</Object>
|
||||
<Object>
|
||||
<Index>#x1C00</Index>
|
||||
<Name>Sync Manager Communication Type</Name>
|
||||
@@ -1481,12 +1619,12 @@
|
||||
<Index>#x1C12</Index>
|
||||
<Name>Sync Manager 2 PDO Assignment</Name>
|
||||
<Type>DT1C12</Type>
|
||||
<BitSize>304</BitSize>
|
||||
<BitSize>320</BitSize>
|
||||
<Info>
|
||||
<SubItem>
|
||||
<Name>Max SubIndex</Name>
|
||||
<Info>
|
||||
<DefaultValue>18</DefaultValue>
|
||||
<DefaultValue>19</DefaultValue>
|
||||
</Info>
|
||||
</SubItem>
|
||||
<SubItem>
|
||||
@@ -1597,6 +1735,12 @@
|
||||
<DefaultValue>#x1611</DefaultValue>
|
||||
</Info>
|
||||
</SubItem>
|
||||
<SubItem>
|
||||
<Name>PDO Mapping</Name>
|
||||
<Info>
|
||||
<DefaultValue>#x1612</DefaultValue>
|
||||
</Info>
|
||||
</SubItem>
|
||||
</Info>
|
||||
<Flags>
|
||||
</Flags>
|
||||
@@ -1605,12 +1749,12 @@
|
||||
<Index>#x1C13</Index>
|
||||
<Name>Sync Manager 3 PDO Assignment</Name>
|
||||
<Type>DT1C13</Type>
|
||||
<BitSize>128</BitSize>
|
||||
<BitSize>160</BitSize>
|
||||
<Info>
|
||||
<SubItem>
|
||||
<Name>Max SubIndex</Name>
|
||||
<Info>
|
||||
<DefaultValue>7</DefaultValue>
|
||||
<DefaultValue>9</DefaultValue>
|
||||
</Info>
|
||||
</SubItem>
|
||||
<SubItem>
|
||||
@@ -1655,6 +1799,18 @@
|
||||
<DefaultValue>#x1A06</DefaultValue>
|
||||
</Info>
|
||||
</SubItem>
|
||||
<SubItem>
|
||||
<Name>PDO Mapping</Name>
|
||||
<Info>
|
||||
<DefaultValue>#x1A07</DefaultValue>
|
||||
</Info>
|
||||
</SubItem>
|
||||
<SubItem>
|
||||
<Name>PDO Mapping</Name>
|
||||
<Info>
|
||||
<DefaultValue>#x1A08</DefaultValue>
|
||||
</Info>
|
||||
</SubItem>
|
||||
</Info>
|
||||
<Flags>
|
||||
</Flags>
|
||||
@@ -1673,7 +1829,7 @@
|
||||
</Object>
|
||||
<Object>
|
||||
<Index>#x6000</Index>
|
||||
<Name>Velocity</Name>
|
||||
<Name>EncPosition</Name>
|
||||
<Type>REAL</Type>
|
||||
<BitSize>32</BitSize>
|
||||
<Info>
|
||||
@@ -1686,7 +1842,7 @@
|
||||
</Object>
|
||||
<Object>
|
||||
<Index>#x6001</Index>
|
||||
<Name>Frequency</Name>
|
||||
<Name>EncVelocity</Name>
|
||||
<Type>REAL</Type>
|
||||
<BitSize>32</BitSize>
|
||||
<Info>
|
||||
@@ -1762,9 +1918,35 @@
|
||||
<PdoMapping>T</PdoMapping>
|
||||
</Flags>
|
||||
</Object>
|
||||
<Object>
|
||||
<Index>#x6007</Index>
|
||||
<Name>IndexByte</Name>
|
||||
<Type>UDINT</Type>
|
||||
<BitSize>32</BitSize>
|
||||
<Info>
|
||||
<DefaultValue>0</DefaultValue>
|
||||
</Info>
|
||||
<Flags>
|
||||
<Access>ro</Access>
|
||||
<PdoMapping>T</PdoMapping>
|
||||
</Flags>
|
||||
</Object>
|
||||
<Object>
|
||||
<Index>#x6008</Index>
|
||||
<Name>IndexStatus</Name>
|
||||
<Type>UDINT</Type>
|
||||
<BitSize>32</BitSize>
|
||||
<Info>
|
||||
<DefaultValue>0</DefaultValue>
|
||||
</Info>
|
||||
<Flags>
|
||||
<Access>ro</Access>
|
||||
<PdoMapping>T</PdoMapping>
|
||||
</Flags>
|
||||
</Object>
|
||||
<Object>
|
||||
<Index>#x7000</Index>
|
||||
<Name>Scale</Name>
|
||||
<Name>EncScale</Name>
|
||||
<Type>REAL</Type>
|
||||
<BitSize>32</BitSize>
|
||||
<Info>
|
||||
@@ -1996,6 +2178,19 @@
|
||||
<PdoMapping>R</PdoMapping>
|
||||
</Flags>
|
||||
</Object>
|
||||
<Object>
|
||||
<Index>#x7012</Index>
|
||||
<Name>EncIndexLatchEnable</Name>
|
||||
<Type>USINT</Type>
|
||||
<BitSize>8</BitSize>
|
||||
<Info>
|
||||
<DefaultValue>0</DefaultValue>
|
||||
</Info>
|
||||
<Flags>
|
||||
<Access>ro</Access>
|
||||
<PdoMapping>R</PdoMapping>
|
||||
</Flags>
|
||||
</Object>
|
||||
</Objects>
|
||||
</Dictionary>
|
||||
</Profile>
|
||||
@@ -2008,12 +2203,12 @@
|
||||
<Sm StartAddress="#x1A00" ControlByte="#x20" Enable="1">Inputs</Sm>
|
||||
<RxPdo Fixed="true" Mandatory="true" Sm="2">
|
||||
<Index>#x1600</Index>
|
||||
<Name>Scale</Name>
|
||||
<Name>EncScale</Name>
|
||||
<Entry>
|
||||
<Index>#x7000</Index>
|
||||
<SubIndex>#x0</SubIndex>
|
||||
<BitLen>32</BitLen>
|
||||
<Name>Scale</Name>
|
||||
<Name>EncScale</Name>
|
||||
<DataType>REAL</DataType>
|
||||
</Entry>
|
||||
</RxPdo>
|
||||
@@ -2204,25 +2399,36 @@
|
||||
<DataType>USINT</DataType>
|
||||
</Entry>
|
||||
</RxPdo>
|
||||
<RxPdo Fixed="true" Mandatory="true" Sm="2">
|
||||
<Index>#x1612</Index>
|
||||
<Name>EncIndexLatchEnable</Name>
|
||||
<Entry>
|
||||
<Index>#x7012</Index>
|
||||
<SubIndex>#x0</SubIndex>
|
||||
<BitLen>8</BitLen>
|
||||
<Name>EncIndexLatchEnable</Name>
|
||||
<DataType>USINT</DataType>
|
||||
</Entry>
|
||||
</RxPdo>
|
||||
<TxPdo Fixed="true" Mandatory="true" Sm="3">
|
||||
<Index>#x1A00</Index>
|
||||
<Name>Velocity</Name>
|
||||
<Name>EncPosition</Name>
|
||||
<Entry>
|
||||
<Index>#x6000</Index>
|
||||
<SubIndex>#x0</SubIndex>
|
||||
<BitLen>32</BitLen>
|
||||
<Name>Velocity</Name>
|
||||
<Name>EncPosition</Name>
|
||||
<DataType>REAL</DataType>
|
||||
</Entry>
|
||||
</TxPdo>
|
||||
<TxPdo Fixed="true" Mandatory="true" Sm="3">
|
||||
<Index>#x1A01</Index>
|
||||
<Name>Frequency</Name>
|
||||
<Name>EncVelocity</Name>
|
||||
<Entry>
|
||||
<Index>#x6001</Index>
|
||||
<SubIndex>#x0</SubIndex>
|
||||
<BitLen>32</BitLen>
|
||||
<Name>Frequency</Name>
|
||||
<Name>EncVelocity</Name>
|
||||
<DataType>REAL</DataType>
|
||||
</Entry>
|
||||
</TxPdo>
|
||||
@@ -2281,6 +2487,28 @@
|
||||
<DataType>REAL</DataType>
|
||||
</Entry>
|
||||
</TxPdo>
|
||||
<TxPdo Fixed="true" Mandatory="true" Sm="3">
|
||||
<Index>#x1A07</Index>
|
||||
<Name>IndexByte</Name>
|
||||
<Entry>
|
||||
<Index>#x6007</Index>
|
||||
<SubIndex>#x0</SubIndex>
|
||||
<BitLen>32</BitLen>
|
||||
<Name>IndexByte</Name>
|
||||
<DataType>UDINT</DataType>
|
||||
</Entry>
|
||||
</TxPdo>
|
||||
<TxPdo Fixed="true" Mandatory="true" Sm="3">
|
||||
<Index>#x1A08</Index>
|
||||
<Name>IndexStatus</Name>
|
||||
<Entry>
|
||||
<Index>#x6008</Index>
|
||||
<SubIndex>#x0</SubIndex>
|
||||
<BitLen>32</BitLen>
|
||||
<Name>IndexStatus</Name>
|
||||
<DataType>UDINT</DataType>
|
||||
</Entry>
|
||||
</TxPdo>
|
||||
<Mailbox DataLinkLayer="true">
|
||||
<CoE SdoInfo="true" PdoAssign="false" PdoConfig="false" PdoUpload="true" CompleteAccess="false" />
|
||||
</Mailbox>
|
||||
|
||||
@@ -33,8 +33,8 @@
|
||||
#define SM3_smc 0x20
|
||||
#define SM3_act 1
|
||||
|
||||
#define MAX_MAPPINGS_SM2 18
|
||||
#define MAX_MAPPINGS_SM3 7
|
||||
#define MAX_MAPPINGS_SM2 19
|
||||
#define MAX_MAPPINGS_SM3 9
|
||||
|
||||
#define MAX_RXPDO_SIZE 512
|
||||
#define MAX_TXPDO_SIZE 512
|
||||
|
||||
@@ -72,25 +72,25 @@
|
||||
},
|
||||
"6000": {
|
||||
"otype": "VAR",
|
||||
"name": "Velocity",
|
||||
"name": "EncPosition",
|
||||
"access": "RO",
|
||||
"pdo_mappings": [
|
||||
"txpdo"
|
||||
],
|
||||
"dtype": "REAL32",
|
||||
"value": "0",
|
||||
"data": "&Obj.Velocity"
|
||||
"data": "&Obj.EncPosition"
|
||||
},
|
||||
"6001": {
|
||||
"otype": "VAR",
|
||||
"name": "Frequency",
|
||||
"name": "EncVelocity",
|
||||
"access": "RO",
|
||||
"pdo_mappings": [
|
||||
"txpdo"
|
||||
],
|
||||
"dtype": "REAL32",
|
||||
"value": "0",
|
||||
"data": "&Obj.Frequency"
|
||||
"data": "&Obj.EncVelocity"
|
||||
},
|
||||
"6002": {
|
||||
"otype": "VAR",
|
||||
@@ -146,19 +146,41 @@
|
||||
"dtype": "REAL32",
|
||||
"value": "0",
|
||||
"data": "&Obj.ActualPosition4"
|
||||
},
|
||||
"6007": {
|
||||
"otype": "VAR",
|
||||
"name": "IndexByte",
|
||||
"access": "RO",
|
||||
"pdo_mappings": [
|
||||
"txpdo"
|
||||
],
|
||||
"dtype": "UNSIGNED32",
|
||||
"value": "0",
|
||||
"data": "&Obj.IndexByte"
|
||||
},
|
||||
"6008": {
|
||||
"otype": "VAR",
|
||||
"name": "IndexStatus",
|
||||
"access": "RO",
|
||||
"pdo_mappings": [
|
||||
"txpdo"
|
||||
],
|
||||
"dtype": "UNSIGNED32",
|
||||
"value": "0",
|
||||
"data": "&Obj.IndexStatus"
|
||||
}
|
||||
},
|
||||
"rxpdo": {
|
||||
"7000": {
|
||||
"otype": "VAR",
|
||||
"name": "Scale",
|
||||
"name": "EncScale",
|
||||
"access": "RO",
|
||||
"pdo_mappings": [
|
||||
"rxpdo"
|
||||
],
|
||||
"dtype": "REAL32",
|
||||
"value": "0",
|
||||
"data": "&Obj.Scale"
|
||||
"data": "&Obj.EncScale"
|
||||
},
|
||||
"7001": {
|
||||
"otype": "VAR",
|
||||
@@ -281,6 +303,17 @@
|
||||
"value": "0",
|
||||
"data": "&Obj.Enable4"
|
||||
},
|
||||
"7012": {
|
||||
"otype": "VAR",
|
||||
"name": "EncIndexLatchEnable",
|
||||
"access": "RO",
|
||||
"pdo_mappings": [
|
||||
"rxpdo"
|
||||
],
|
||||
"dtype": "UNSIGNED8",
|
||||
"value": "0",
|
||||
"data": "&Obj.EncIndexLatchEnable"
|
||||
},
|
||||
"60664": {
|
||||
"otype": "VAR",
|
||||
"name": "ActualPosition",
|
||||
|
||||
@@ -13,9 +13,9 @@ static const char acName1018_01[] = "Vendor ID";
|
||||
static const char acName1018_02[] = "Product Code";
|
||||
static const char acName1018_03[] = "Revision Number";
|
||||
static const char acName1018_04[] = "Serial Number";
|
||||
static const char acName1600[] = "Scale";
|
||||
static const char acName1600[] = "EncScale";
|
||||
static const char acName1600_00[] = "Max SubIndex";
|
||||
static const char acName1600_01[] = "Scale";
|
||||
static const char acName1600_01[] = "EncScale";
|
||||
static const char acName1601[] = "Output4";
|
||||
static const char acName1601_00[] = "Max SubIndex";
|
||||
static const char acName1601_01[] = "Output4";
|
||||
@@ -67,12 +67,15 @@ static const char acName1610_01[] = "Enable3";
|
||||
static const char acName1611[] = "Enable4";
|
||||
static const char acName1611_00[] = "Max SubIndex";
|
||||
static const char acName1611_01[] = "Enable4";
|
||||
static const char acName1A00[] = "Velocity";
|
||||
static const char acName1612[] = "EncIndexLatchEnable";
|
||||
static const char acName1612_00[] = "Max SubIndex";
|
||||
static const char acName1612_01[] = "EncIndexLatchEnable";
|
||||
static const char acName1A00[] = "EncPosition";
|
||||
static const char acName1A00_00[] = "Max SubIndex";
|
||||
static const char acName1A00_01[] = "Velocity";
|
||||
static const char acName1A01[] = "Frequency";
|
||||
static const char acName1A00_01[] = "EncPosition";
|
||||
static const char acName1A01[] = "EncVelocity";
|
||||
static const char acName1A01_00[] = "Max SubIndex";
|
||||
static const char acName1A01_01[] = "Frequency";
|
||||
static const char acName1A01_01[] = "EncVelocity";
|
||||
static const char acName1A02[] = "Input8";
|
||||
static const char acName1A02_00[] = "Max SubIndex";
|
||||
static const char acName1A02_01[] = "Input8";
|
||||
@@ -88,6 +91,12 @@ static const char acName1A05_01[] = "ActualPosition3";
|
||||
static const char acName1A06[] = "ActualPosition4";
|
||||
static const char acName1A06_00[] = "Max SubIndex";
|
||||
static const char acName1A06_01[] = "ActualPosition4";
|
||||
static const char acName1A07[] = "IndexByte";
|
||||
static const char acName1A07_00[] = "Max SubIndex";
|
||||
static const char acName1A07_01[] = "IndexByte";
|
||||
static const char acName1A08[] = "IndexStatus";
|
||||
static const char acName1A08_00[] = "Max SubIndex";
|
||||
static const char acName1A08_01[] = "IndexStatus";
|
||||
static const char acName1C00[] = "Sync Manager Communication Type";
|
||||
static const char acName1C00_00[] = "Max SubIndex";
|
||||
static const char acName1C00_01[] = "Communications Type SM0";
|
||||
@@ -114,6 +123,7 @@ static const char acName1C12_0f[] = "PDO Mapping";
|
||||
static const char acName1C12_010[] = "PDO Mapping";
|
||||
static const char acName1C12_11[] = "PDO Mapping";
|
||||
static const char acName1C12_12[] = "PDO Mapping";
|
||||
static const char acName1C12_13[] = "PDO Mapping";
|
||||
static const char acName1C13[] = "Sync Manager 3 PDO Assignment";
|
||||
static const char acName1C13_00[] = "Max SubIndex";
|
||||
static const char acName1C13_01[] = "PDO Mapping";
|
||||
@@ -123,15 +133,19 @@ static const char acName1C13_04[] = "PDO Mapping";
|
||||
static const char acName1C13_05[] = "PDO Mapping";
|
||||
static const char acName1C13_06[] = "PDO Mapping";
|
||||
static const char acName1C13_07[] = "PDO Mapping";
|
||||
static const char acName1C13_08[] = "PDO Mapping";
|
||||
static const char acName1C13_09[] = "PDO Mapping";
|
||||
static const char acName2000[] = "BasePeriod";
|
||||
static const char acName6000[] = "Velocity";
|
||||
static const char acName6001[] = "Frequency";
|
||||
static const char acName6000[] = "EncPosition";
|
||||
static const char acName6001[] = "EncVelocity";
|
||||
static const char acName6002[] = "Input8";
|
||||
static const char acName6003[] = "ActualPosition1";
|
||||
static const char acName6004[] = "ActualPosition2";
|
||||
static const char acName6005[] = "ActualPosition3";
|
||||
static const char acName6006[] = "ActualPosition4";
|
||||
static const char acName7000[] = "Scale";
|
||||
static const char acName6007[] = "IndexByte";
|
||||
static const char acName6008[] = "IndexStatus";
|
||||
static const char acName7000[] = "EncScale";
|
||||
static const char acName7001[] = "Output4";
|
||||
static const char acName7002[] = "CommandedPosition1";
|
||||
static const char acName7003[] = "CommandedPosition2";
|
||||
@@ -149,6 +163,7 @@ static const char acName700E[] = "Enable1";
|
||||
static const char acName700F[] = "Enable2";
|
||||
static const char acName7010[] = "Enable3";
|
||||
static const char acName7011[] = "Enable4";
|
||||
static const char acName7012[] = "EncIndexLatchEnable";
|
||||
|
||||
const _objd SDO1000[] =
|
||||
{
|
||||
@@ -264,6 +279,11 @@ const _objd SDO1611[] =
|
||||
{0x00, DTYPE_UNSIGNED8, 8, ATYPE_RO, acName1611_00, 1, NULL},
|
||||
{0x01, DTYPE_UNSIGNED32, 32, ATYPE_RO, acName1611_01, 0x70110008, NULL},
|
||||
};
|
||||
const _objd SDO1612[] =
|
||||
{
|
||||
{0x00, DTYPE_UNSIGNED8, 8, ATYPE_RO, acName1612_00, 1, NULL},
|
||||
{0x01, DTYPE_UNSIGNED32, 32, ATYPE_RO, acName1612_01, 0x70120008, NULL},
|
||||
};
|
||||
const _objd SDO1A00[] =
|
||||
{
|
||||
{0x00, DTYPE_UNSIGNED8, 8, ATYPE_RO, acName1A00_00, 1, NULL},
|
||||
@@ -299,6 +319,16 @@ const _objd SDO1A06[] =
|
||||
{0x00, DTYPE_UNSIGNED8, 8, ATYPE_RO, acName1A06_00, 1, NULL},
|
||||
{0x01, DTYPE_UNSIGNED32, 32, ATYPE_RO, acName1A06_01, 0x60060020, NULL},
|
||||
};
|
||||
const _objd SDO1A07[] =
|
||||
{
|
||||
{0x00, DTYPE_UNSIGNED8, 8, ATYPE_RO, acName1A07_00, 1, NULL},
|
||||
{0x01, DTYPE_UNSIGNED32, 32, ATYPE_RO, acName1A07_01, 0x60070020, NULL},
|
||||
};
|
||||
const _objd SDO1A08[] =
|
||||
{
|
||||
{0x00, DTYPE_UNSIGNED8, 8, ATYPE_RO, acName1A08_00, 1, NULL},
|
||||
{0x01, DTYPE_UNSIGNED32, 32, ATYPE_RO, acName1A08_01, 0x60080020, NULL},
|
||||
};
|
||||
const _objd SDO1C00[] =
|
||||
{
|
||||
{0x00, DTYPE_UNSIGNED8, 8, ATYPE_RO, acName1C00_00, 4, NULL},
|
||||
@@ -309,7 +339,7 @@ const _objd SDO1C00[] =
|
||||
};
|
||||
const _objd SDO1C12[] =
|
||||
{
|
||||
{0x00, DTYPE_UNSIGNED8, 8, ATYPE_RO, acName1C12_00, 18, NULL},
|
||||
{0x00, DTYPE_UNSIGNED8, 8, ATYPE_RO, acName1C12_00, 19, NULL},
|
||||
{0x01, DTYPE_UNSIGNED16, 16, ATYPE_RO, acName1C12_01, 0x1600, NULL},
|
||||
{0x02, DTYPE_UNSIGNED16, 16, ATYPE_RO, acName1C12_02, 0x1601, NULL},
|
||||
{0x03, DTYPE_UNSIGNED16, 16, ATYPE_RO, acName1C12_03, 0x1602, NULL},
|
||||
@@ -328,10 +358,11 @@ const _objd SDO1C12[] =
|
||||
{0x010, DTYPE_UNSIGNED16, 16, ATYPE_RO, acName1C12_010, 0x160F, NULL},
|
||||
{0x11, DTYPE_UNSIGNED16, 16, ATYPE_RO, acName1C12_11, 0x1610, NULL},
|
||||
{0x12, DTYPE_UNSIGNED16, 16, ATYPE_RO, acName1C12_12, 0x1611, NULL},
|
||||
{0x13, DTYPE_UNSIGNED16, 16, ATYPE_RO, acName1C12_13, 0x1612, NULL},
|
||||
};
|
||||
const _objd SDO1C13[] =
|
||||
{
|
||||
{0x00, DTYPE_UNSIGNED8, 8, ATYPE_RO, acName1C13_00, 7, NULL},
|
||||
{0x00, DTYPE_UNSIGNED8, 8, ATYPE_RO, acName1C13_00, 9, NULL},
|
||||
{0x01, DTYPE_UNSIGNED16, 16, ATYPE_RO, acName1C13_01, 0x1A00, NULL},
|
||||
{0x02, DTYPE_UNSIGNED16, 16, ATYPE_RO, acName1C13_02, 0x1A01, NULL},
|
||||
{0x03, DTYPE_UNSIGNED16, 16, ATYPE_RO, acName1C13_03, 0x1A02, NULL},
|
||||
@@ -339,6 +370,8 @@ const _objd SDO1C13[] =
|
||||
{0x05, DTYPE_UNSIGNED16, 16, ATYPE_RO, acName1C13_05, 0x1A04, NULL},
|
||||
{0x06, DTYPE_UNSIGNED16, 16, ATYPE_RO, acName1C13_06, 0x1A05, NULL},
|
||||
{0x07, DTYPE_UNSIGNED16, 16, ATYPE_RO, acName1C13_07, 0x1A06, NULL},
|
||||
{0x08, DTYPE_UNSIGNED16, 16, ATYPE_RO, acName1C13_08, 0x1A07, NULL},
|
||||
{0x09, DTYPE_UNSIGNED16, 16, ATYPE_RO, acName1C13_09, 0x1A08, NULL},
|
||||
};
|
||||
const _objd SDO2000[] =
|
||||
{
|
||||
@@ -346,11 +379,11 @@ const _objd SDO2000[] =
|
||||
};
|
||||
const _objd SDO6000[] =
|
||||
{
|
||||
{0x0, DTYPE_REAL32, 32, ATYPE_RO | ATYPE_TXPDO, acName6000, 0x00000000, &Obj.Velocity},
|
||||
{0x0, DTYPE_REAL32, 32, ATYPE_RO | ATYPE_TXPDO, acName6000, 0x00000000, &Obj.EncPosition},
|
||||
};
|
||||
const _objd SDO6001[] =
|
||||
{
|
||||
{0x0, DTYPE_REAL32, 32, ATYPE_RO | ATYPE_TXPDO, acName6001, 0x00000000, &Obj.Frequency},
|
||||
{0x0, DTYPE_REAL32, 32, ATYPE_RO | ATYPE_TXPDO, acName6001, 0x00000000, &Obj.EncVelocity},
|
||||
};
|
||||
const _objd SDO6002[] =
|
||||
{
|
||||
@@ -372,9 +405,17 @@ const _objd SDO6006[] =
|
||||
{
|
||||
{0x0, DTYPE_REAL32, 32, ATYPE_RO | ATYPE_TXPDO, acName6006, 0x00000000, &Obj.ActualPosition4},
|
||||
};
|
||||
const _objd SDO6007[] =
|
||||
{
|
||||
{0x0, DTYPE_UNSIGNED32, 32, ATYPE_RO | ATYPE_TXPDO, acName6007, 0, &Obj.IndexByte},
|
||||
};
|
||||
const _objd SDO6008[] =
|
||||
{
|
||||
{0x0, DTYPE_UNSIGNED32, 32, ATYPE_RO | ATYPE_TXPDO, acName6008, 0, &Obj.IndexStatus},
|
||||
};
|
||||
const _objd SDO7000[] =
|
||||
{
|
||||
{0x0, DTYPE_REAL32, 32, ATYPE_RO | ATYPE_RXPDO, acName7000, 0x00000000, &Obj.Scale},
|
||||
{0x0, DTYPE_REAL32, 32, ATYPE_RO | ATYPE_RXPDO, acName7000, 0x00000000, &Obj.EncScale},
|
||||
};
|
||||
const _objd SDO7001[] =
|
||||
{
|
||||
@@ -444,6 +485,10 @@ const _objd SDO7011[] =
|
||||
{
|
||||
{0x0, DTYPE_UNSIGNED8, 8, ATYPE_RO | ATYPE_RXPDO, acName7011, 0, &Obj.Enable4},
|
||||
};
|
||||
const _objd SDO7012[] =
|
||||
{
|
||||
{0x0, DTYPE_UNSIGNED8, 8, ATYPE_RO | ATYPE_RXPDO, acName7012, 0, &Obj.EncIndexLatchEnable},
|
||||
};
|
||||
|
||||
const _objectlist SDOobjects[] =
|
||||
{
|
||||
@@ -470,6 +515,7 @@ const _objectlist SDOobjects[] =
|
||||
{0x160F, OTYPE_RECORD, 1, 0, acName160F, SDO160F},
|
||||
{0x1610, OTYPE_RECORD, 1, 0, acName1610, SDO1610},
|
||||
{0x1611, OTYPE_RECORD, 1, 0, acName1611, SDO1611},
|
||||
{0x1612, OTYPE_RECORD, 1, 0, acName1612, SDO1612},
|
||||
{0x1A00, OTYPE_RECORD, 1, 0, acName1A00, SDO1A00},
|
||||
{0x1A01, OTYPE_RECORD, 1, 0, acName1A01, SDO1A01},
|
||||
{0x1A02, OTYPE_RECORD, 1, 0, acName1A02, SDO1A02},
|
||||
@@ -477,9 +523,11 @@ const _objectlist SDOobjects[] =
|
||||
{0x1A04, OTYPE_RECORD, 1, 0, acName1A04, SDO1A04},
|
||||
{0x1A05, OTYPE_RECORD, 1, 0, acName1A05, SDO1A05},
|
||||
{0x1A06, OTYPE_RECORD, 1, 0, acName1A06, SDO1A06},
|
||||
{0x1A07, OTYPE_RECORD, 1, 0, acName1A07, SDO1A07},
|
||||
{0x1A08, OTYPE_RECORD, 1, 0, acName1A08, SDO1A08},
|
||||
{0x1C00, OTYPE_ARRAY, 4, 0, acName1C00, SDO1C00},
|
||||
{0x1C12, OTYPE_ARRAY, 18, 0, acName1C12, SDO1C12},
|
||||
{0x1C13, OTYPE_ARRAY, 7, 0, acName1C13, SDO1C13},
|
||||
{0x1C12, OTYPE_ARRAY, 19, 0, acName1C12, SDO1C12},
|
||||
{0x1C13, OTYPE_ARRAY, 9, 0, acName1C13, SDO1C13},
|
||||
{0x2000, OTYPE_VAR, 0, 0, acName2000, SDO2000},
|
||||
{0x6000, OTYPE_VAR, 0, 0, acName6000, SDO6000},
|
||||
{0x6001, OTYPE_VAR, 0, 0, acName6001, SDO6001},
|
||||
@@ -488,6 +536,8 @@ const _objectlist SDOobjects[] =
|
||||
{0x6004, OTYPE_VAR, 0, 0, acName6004, SDO6004},
|
||||
{0x6005, OTYPE_VAR, 0, 0, acName6005, SDO6005},
|
||||
{0x6006, OTYPE_VAR, 0, 0, acName6006, SDO6006},
|
||||
{0x6007, OTYPE_VAR, 0, 0, acName6007, SDO6007},
|
||||
{0x6008, OTYPE_VAR, 0, 0, acName6008, SDO6008},
|
||||
{0x7000, OTYPE_VAR, 0, 0, acName7000, SDO7000},
|
||||
{0x7001, OTYPE_VAR, 0, 0, acName7001, SDO7001},
|
||||
{0x7002, OTYPE_VAR, 0, 0, acName7002, SDO7002},
|
||||
@@ -506,5 +556,6 @@ const _objectlist SDOobjects[] =
|
||||
{0x700F, OTYPE_VAR, 0, 0, acName700F, SDO700F},
|
||||
{0x7010, OTYPE_VAR, 0, 0, acName7010, SDO7010},
|
||||
{0x7011, OTYPE_VAR, 0, 0, acName7011, SDO7011},
|
||||
{0x7012, OTYPE_VAR, 0, 0, acName7012, SDO7012},
|
||||
{0xffff, 0xff, 0xff, 0xff, NULL, NULL}
|
||||
};
|
||||
|
||||
@@ -13,17 +13,19 @@ typedef struct
|
||||
|
||||
/* Inputs */
|
||||
|
||||
float Velocity;
|
||||
float Frequency;
|
||||
float EncPosition;
|
||||
float EncVelocity;
|
||||
uint8_t Input8;
|
||||
float ActualPosition1;
|
||||
float ActualPosition2;
|
||||
float ActualPosition3;
|
||||
float ActualPosition4;
|
||||
uint32_t IndexByte;
|
||||
uint32_t IndexStatus;
|
||||
|
||||
/* Outputs */
|
||||
|
||||
float Scale;
|
||||
float EncScale;
|
||||
uint8_t Output4;
|
||||
float CommandedPosition1;
|
||||
float CommandedPosition2;
|
||||
@@ -41,6 +43,7 @@ typedef struct
|
||||
uint8_t Enable2;
|
||||
uint8_t Enable3;
|
||||
uint8_t Enable4;
|
||||
uint8_t EncIndexLatchEnable;
|
||||
|
||||
/* Parameters */
|
||||
|
||||
|
||||
@@ -83,8 +83,8 @@ void cb_set_outputs(void) // Get Master outputs, slave inputs, first operation
|
||||
for (int i = 0; i < 4; i++)
|
||||
digitalWrite(OUTPUTS[i], bitcheck(Obj.Output4, i) ? HIGH : LOW);
|
||||
// analogWrite(DAC1_pin, Obj.Voltage);
|
||||
// Encoder1.setLatch(Obj.IndexLatchEnable);
|
||||
// Encoder1.setScale(2000);
|
||||
Encoder1.setLatch(Obj.EncIndexLatchEnable);
|
||||
Encoder1.setScale(Obj.EncScale);
|
||||
|
||||
posScale1 = Obj.StepsPerMM1; // Scale perhaps changed
|
||||
posScale2 = Obj.StepsPerMM2;
|
||||
@@ -108,25 +108,21 @@ void cb_set_outputs(void) // Get Master outputs, slave inputs, first operation
|
||||
|
||||
void cb_get_inputs(void) // Set Master inputs, slave outputs, last operation
|
||||
{
|
||||
Obj.Velocity = Obj.Scale * FrequencyMeasured;
|
||||
float scale = 1;
|
||||
if (Obj.Scale != 0.0)
|
||||
scale = Obj.Scale;
|
||||
Obj.Velocity = scale * sin(ESCvar.Time * 1e-8 * 6.28); // Test
|
||||
float scale = 1;
|
||||
if (Obj.EncScale != 0.0)
|
||||
scale = Obj.EncScale;
|
||||
|
||||
for (int i = 0; i < 8; i++)
|
||||
if (digitalRead(INPUTS[i]) == HIGH)
|
||||
bitSet(Obj.Input8, i);
|
||||
else
|
||||
bitClear(Obj.Input8, i);
|
||||
#if 0
|
||||
Obj.IndexStatus = Encoder1.indexHappened();
|
||||
Obj.EncPos = Encoder1.currentPos();
|
||||
Obj.EncFrequency = Encoder1.frequency(longTime.extendTime(micros()));
|
||||
Obj.IndexByte = Encoder1.getIndexState();
|
||||
|
||||
Obj.Velocity = Obj.Scale * FrequencyMeasured;
|
||||
#endif
|
||||
Obj.IndexStatus = Encoder1.indexHappened();
|
||||
Obj.EncPosition = Encoder1.currentPos();
|
||||
Obj.IndexByte = Encoder1.getIndexState();
|
||||
Obj.EncVelocity = Obj.EncScale * FrequencyMeasured;
|
||||
|
||||
Obj.ActualPosition1 = Step->stepgen_array[0].pos_fb;
|
||||
Obj.ActualPosition2 = Step->stepgen_array[1].pos_fb;
|
||||
Obj.ActualPosition3 = Step->stepgen_array[2].pos_fb;
|
||||
|
||||
Reference in New Issue
Block a user