Modification of the dictionnary to support NVRAM.
(Object 0x1010, 0x1011.)
--- a/examples/TestMasterSlave/TestMaster.c Mon May 22 09:46:29 2006 +0200
+++ b/examples/TestMasterSlave/TestMaster.c Tue May 23 01:15:22 2006 +0200
@@ -63,21 +63,21 @@
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
/* index 0x1000 : Device Type. */
- UNS32 TestMaster_obj1000 = 0x12D;
+ UNS32 TestMaster_obj1000 = 0x12D; // 301
subindex TestMaster_Index1000[] =
{
{ RO, uint32, sizeof (UNS32), (void*)&TestMaster_obj1000 }
};
/* index 0x1001 : Error Register. */
- UNS8 TestMaster_obj1001 = 0x0;
+ UNS8 TestMaster_obj1001 = 0x0; // 0
subindex TestMaster_Index1001[] =
{
{ RO, uint8, sizeof (UNS8), (void*)&TestMaster_obj1001 }
};
/* index 0x1005 : SYNC COB ID. */
- UNS32 TestMaster_obj1005 = 0x40000080;
+ UNS32 TestMaster_obj1005 = 0x40000080; // 1073741952
ODCallback_t TestMaster_Index1005_callbacks[] =
{
NULL,
@@ -88,7 +88,7 @@
};
/* index 0x1006 : Communication / Cycle Period. */
- UNS32 TestMaster_obj1006 = 0xC350;
+ UNS32 TestMaster_obj1006 = 0xC350; // 50000
ODCallback_t TestMaster_Index1006_callbacks[] =
{
NULL,
@@ -98,11 +98,57 @@
{ RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1006 }
};
+/* index 0x1010 : Store parameters. */
+ UNS8 TestMaster_highestSubIndex_obj1010 = 4; // number of subindex - 1
+ UNS32 TestMaster_obj1010_Save_All_Parameters = 0x0; // 0
+ UNS32 TestMaster_obj1010_Save_Communication_Parameters = 0x0; // 0
+ UNS32 TestMaster_obj1010_Save_Application_Parameters = 0x0; // 0
+ UNS32 TestMaster_obj1010_Save_Manufacturer_Parameters = 0x0; // 0
+ ODCallback_t TestMaster_Index1010_callbacks[] =
+ {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ };
+ subindex TestMaster_Index1010[] =
+ {
+ { RO, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1010 },
+ { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1010_Save_All_Parameters },
+ { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1010_Save_Communication_Parameters },
+ { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1010_Save_Application_Parameters },
+ { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1010_Save_Manufacturer_Parameters }
+ };
+
+/* index 0x1011 : Restore Default Parameters. */
+ UNS8 TestMaster_highestSubIndex_obj1011 = 4; // number of subindex - 1
+ UNS32 TestMaster_obj1011_Restore_All_Default_Parameters = 0x0; // 0
+ UNS32 TestMaster_obj1011_Restore_Communication_Default_Parameters = 0x0; // 0
+ UNS32 TestMaster_obj1011_Restore_Application_Default_Parameters = 0x0; // 0
+ UNS32 TestMaster_obj1011_Restore_Manufacturer_Default_Parameters = 0x0; // 0
+ ODCallback_t TestMaster_Index1011_callbacks[] =
+ {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ };
+ subindex TestMaster_Index1011[] =
+ {
+ { RO, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1011 },
+ { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1011_Restore_All_Default_Parameters },
+ { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1011_Restore_Communication_Default_Parameters },
+ { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1011_Restore_Application_Default_Parameters },
+ { RW, uint32, sizeof (UNS32), (void*)&TestMaster_obj1011_Restore_Manufacturer_Default_Parameters }
+ };
+
/* index 0x1016 : Consumer Heartbeat Time. */
UNS8 TestMaster_highestSubIndex_obj1016 = 1; // number of subindex - 1
UNS32 TestMaster_obj1016[] =
{
- 133122
+ 0x20802 // 133122
};
subindex TestMaster_Index1016[] =
{
@@ -111,14 +157,14 @@
};
/* index 0x1017 : Producer Heartbeat Time */
- UNS16 TestMaster_obj1017 = 0;
+ UNS16 TestMaster_obj1017 = 0x0; // 0
/* index 0x1018 : Identity. */
UNS8 TestMaster_highestSubIndex_obj1018 = 4; // number of subindex - 1
- UNS32 TestMaster_obj1018_Vendor_ID = 0x0;
- UNS32 TestMaster_obj1018_Product_Code = 0x0;
- UNS32 TestMaster_obj1018_Revision_Number = 0x0;
- UNS32 TestMaster_obj1018_Serial_Number = 0x0;
+ UNS32 TestMaster_obj1018_Vendor_ID = 0x0; // 0
+ UNS32 TestMaster_obj1018_Product_Code = 0x0; // 0
+ UNS32 TestMaster_obj1018_Revision_Number = 0x0; // 0
+ UNS32 TestMaster_obj1018_Serial_Number = 0x0; // 0
subindex TestMaster_Index1018[] =
{
{ RO, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1018 },
@@ -130,9 +176,9 @@
/* index 0x1280 : Client SDO 1 Parameter. */
UNS8 TestMaster_highestSubIndex_obj1280 = 3; // number of subindex - 1
- UNS32 TestMaster_obj1280_COB_ID_Client_to_Server_Transmit_SDO = 0x602;
- UNS32 TestMaster_obj1280_COB_ID_Server_to_Client_Receive_SDO = 0x582;
- UNS32 TestMaster_obj1280_Node_ID_of_the_SDO_Server = 0x2;
+ UNS32 TestMaster_obj1280_COB_ID_Client_to_Server_Transmit_SDO = 0x602; // 1538
+ UNS32 TestMaster_obj1280_COB_ID_Server_to_Client_Receive_SDO = 0x582; // 1410
+ UNS32 TestMaster_obj1280_Node_ID_of_the_SDO_Server = 0x2; // 2
subindex TestMaster_Index1280[] =
{
{ RO, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1280 },
@@ -143,11 +189,11 @@
/* index 0x1400 : Receive PDO 1 Parameter. */
UNS8 TestMaster_highestSubIndex_obj1400 = 5; // number of subindex - 1
- UNS32 TestMaster_obj1400_COB_ID_used_by_PDO = 0x182;
- UNS8 TestMaster_obj1400_Transmission_Type = 0x1;
- UNS16 TestMaster_obj1400_Inhibit_Time = 0x0;
- UNS16 TestMaster_obj1400_Compatibility_Entry = 0x0;
- UNS16 TestMaster_obj1400_Event_Timer = 0x0;
+ UNS32 TestMaster_obj1400_COB_ID_used_by_PDO = 0x182; // 386
+ UNS8 TestMaster_obj1400_Transmission_Type = 0x1; // 1
+ UNS16 TestMaster_obj1400_Inhibit_Time = 0x0; // 0
+ UNS16 TestMaster_obj1400_Compatibility_Entry = 0x0; // 0
+ UNS16 TestMaster_obj1400_Event_Timer = 0x0; // 0
subindex TestMaster_Index1400[] =
{
{ RO, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1400 },
@@ -160,11 +206,11 @@
/* index 0x1401 : Receive PDO 2 Parameter. */
UNS8 TestMaster_highestSubIndex_obj1401 = 5; // number of subindex - 1
- UNS32 TestMaster_obj1401_COB_ID_used_by_PDO = 0x282;
- UNS8 TestMaster_obj1401_Transmission_Type = 0x1;
- UNS16 TestMaster_obj1401_Inhibit_Time = 0x0;
- UNS16 TestMaster_obj1401_Compatibility_Entry = 0x0;
- UNS16 TestMaster_obj1401_Event_Timer = 0x0;
+ UNS32 TestMaster_obj1401_COB_ID_used_by_PDO = 0x282; // 642
+ UNS8 TestMaster_obj1401_Transmission_Type = 0x1; // 1
+ UNS16 TestMaster_obj1401_Inhibit_Time = 0x0; // 0
+ UNS16 TestMaster_obj1401_Compatibility_Entry = 0x0; // 0
+ UNS16 TestMaster_obj1401_Event_Timer = 0x0; // 0
subindex TestMaster_Index1401[] =
{
{ RO, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1401 },
@@ -179,8 +225,8 @@
UNS8 TestMaster_highestSubIndex_obj1600 = 2; // number of subindex - 1
UNS32 TestMaster_obj1600[] =
{
- 536870920,
- 536936456
+ 0x20000008, // 536870920
+ 0x20010008 // 536936456
};
subindex TestMaster_Index1600[] =
{
@@ -193,8 +239,8 @@
UNS8 TestMaster_highestSubIndex_obj1601 = 2; // number of subindex - 1
UNS32 TestMaster_obj1601[] =
{
- 537001992,
- 537067528
+ 0x20020008, // 537001992
+ 0x20030008 // 537067528
};
subindex TestMaster_Index1601[] =
{
@@ -237,6 +283,8 @@
{ (subindex*)TestMaster_Index1001,sizeof(TestMaster_Index1001)/sizeof(TestMaster_Index1001[0]), 0x1001},
{ (subindex*)TestMaster_Index1005,sizeof(TestMaster_Index1005)/sizeof(TestMaster_Index1005[0]), 0x1005},
{ (subindex*)TestMaster_Index1006,sizeof(TestMaster_Index1006)/sizeof(TestMaster_Index1006[0]), 0x1006},
+ { (subindex*)TestMaster_Index1010,sizeof(TestMaster_Index1010)/sizeof(TestMaster_Index1010[0]), 0x1010},
+ { (subindex*)TestMaster_Index1011,sizeof(TestMaster_Index1011)/sizeof(TestMaster_Index1011[0]), 0x1011},
{ (subindex*)TestMaster_Index1016,sizeof(TestMaster_Index1016)/sizeof(TestMaster_Index1016[0]), 0x1016},
{ (subindex*)TestMaster_Index1018,sizeof(TestMaster_Index1018)/sizeof(TestMaster_Index1018[0]), 0x1018},
{ (subindex*)TestMaster_Index1280,sizeof(TestMaster_Index1280)/sizeof(TestMaster_Index1280[0]), 0x1280},
@@ -253,22 +301,25 @@
const indextable * TestMaster_scanIndexOD (UNS16 wIndex, UNS32 * errorCode, ODCallback_t **callbacks)
{
int i;
+ *callbacks = NULL;
switch(wIndex){
- case 0x1000: i = 0; *callbacks = NULL; break;
- case 0x1001: i = 1; *callbacks = NULL; break;
- case 0x1005: i = 2; *callbacks = TestMaster_Index1005_callbacks; break;
- case 0x1006: i = 3; *callbacks = TestMaster_Index1006_callbacks; break;
- case 0x1016: i = 4; *callbacks = NULL; break;
- case 0x1018: i = 5; *callbacks = NULL; break;
- case 0x1280: i = 6; *callbacks = NULL; break;
- case 0x1400: i = 7; *callbacks = NULL; break;
- case 0x1401: i = 8; *callbacks = NULL; break;
- case 0x1600: i = 9; *callbacks = NULL; break;
- case 0x1601: i = 10; *callbacks = NULL; break;
- case 0x2000: i = 11; *callbacks = MasterMap1_callbacks; break;
- case 0x2001: i = 12; *callbacks = NULL; break;
- case 0x2002: i = 13; *callbacks = NULL; break;
- case 0x2003: i = 14; *callbacks = NULL; break;
+ case 0x1000: i = 0;break;
+ case 0x1001: i = 1;break;
+ case 0x1005: i = 2;*callbacks = TestMaster_Index1005_callbacks; break;
+ case 0x1006: i = 3;*callbacks = TestMaster_Index1006_callbacks; break;
+ case 0x1010: i = 4;*callbacks = TestMaster_Index1010_callbacks; break;
+ case 0x1011: i = 5;*callbacks = TestMaster_Index1011_callbacks; break;
+ case 0x1016: i = 6;break;
+ case 0x1018: i = 7;break;
+ case 0x1280: i = 8;break;
+ case 0x1400: i = 9;break;
+ case 0x1401: i = 10;break;
+ case 0x1600: i = 11;break;
+ case 0x1601: i = 12;break;
+ case 0x2000: i = 13;*callbacks = MasterMap1_callbacks; break;
+ case 0x2001: i = 14;break;
+ case 0x2002: i = 15;break;
+ case 0x2003: i = 16;break;
default:
*errorCode = OD_NO_SUCH_OBJECT;
return NULL;
@@ -284,18 +335,18 @@
quick_index TestMaster_firstIndex = {
SDO_SVR : 0,
- SDO_CLT : 6,
- PDO_RCV : 7,
- PDO_RCV_MAP : 9,
+ SDO_CLT : 8,
+ PDO_RCV : 9,
+ PDO_RCV_MAP : 11,
PDO_TRS : 0,
PDO_TRS_MAP : 0
};
quick_index TestMaster_lastIndex = {
SDO_SVR : 0,
- SDO_CLT : 6,
- PDO_RCV : 8,
- PDO_RCV_MAP : 10,
+ SDO_CLT : 8,
+ PDO_RCV : 10,
+ PDO_RCV_MAP : 12,
PDO_TRS : 0,
PDO_TRS_MAP : 0
};
--- a/examples/TestMasterSlave/TestMaster.h Mon May 22 09:46:29 2006 +0200
+++ b/examples/TestMasterSlave/TestMaster.h Tue May 23 01:15:22 2006 +0200
@@ -41,6 +41,8 @@
// Master node data struct
extern CO_Data TestMaster_Data;
+extern ODCallback_t Store_parameters_callbacks[]; // Callbacks of index0x1010
+extern ODCallback_t Restore_Default_Parameters_callbacks[]; // Callbacks of index0x1011
extern UNS8 MasterMap1; // Mapped at index 0x2000, subindex 0x00
extern ODCallback_t MasterMap1_callbacks[]; // Callbacks of index0x2000
extern UNS8 MasterMap2; // Mapped at index 0x2001, subindex 0x00
--- a/examples/TestMasterSlave/TestMaster.od Mon May 22 09:46:29 2006 +0200
+++ b/examples/TestMasterSlave/TestMaster.od Tue May 23 01:15:22 2006 +0200
@@ -1,10 +1,10 @@
<?xml version="1.0"?>
<!DOCTYPE PyObject SYSTEM "PyObjects.dtd">
-<PyObject module="node" class="Node" id="46912513799520">
-<attr name="Profile" type="dict" id="15189360" >
+<PyObject module="node" class="Node" id="146364268">
+<attr name="Profile" type="dict" id="146655540" >
</attr>
<attr name="Name" type="string" value="TestMaster" />
-<attr name="Dictionary" type="dict" id="15882768" >
+<attr name="Dictionary" type="dict" id="146655676" >
<entry>
<key type="numeric" value="4096" />
<val type="numeric" value="301" />
@@ -22,8 +22,14 @@
<val type="numeric" value="0" />
</entry>
<entry>
- <key type="numeric" value="8193" />
- <val type="numeric" value="0" />
+ <key type="numeric" value="5121" />
+ <val type="list" id="146871116" >
+ <item type="numeric" value="642" />
+ <item type="numeric" value="1" />
+ <item type="numeric" value="0" />
+ <item type="numeric" value="0" />
+ <item type="numeric" value="0" />
+ </val>
</entry>
<entry>
<key type="numeric" value="4101" />
@@ -34,35 +40,12 @@
<val type="numeric" value="50000" />
</entry>
<entry>
- <key type="numeric" value="5121" />
- <val type="list" id="46912515256904" >
- <item type="numeric" value="642" />
- <item type="numeric" value="1" />
- <item type="numeric" value="0" />
- <item type="numeric" value="0" />
- <item type="numeric" value="0" />
- </val>
- </entry>
- <entry>
- <key type="numeric" value="8192" />
- <val type="numeric" value="0" />
- </entry>
- <entry>
- <key type="numeric" value="4118" />
- <val type="list" id="46912515257840" >
- <item type="numeric" value="133122" />
- </val>
- </entry>
- <entry>
- <key type="numeric" value="5633" />
- <val type="list" id="46912515257696" >
- <item type="numeric" value="537001992" />
- <item type="numeric" value="537067528" />
- </val>
+ <key type="numeric" value="8193" />
+ <val type="numeric" value="0" />
</entry>
<entry>
<key type="numeric" value="5120" />
- <val type="list" id="46912515233048" >
+ <val type="list" id="146380268" >
<item type="numeric" value="386" />
<item type="numeric" value="1" />
<item type="numeric" value="0" />
@@ -71,15 +54,17 @@
</val>
</entry>
<entry>
- <key type="numeric" value="5632" />
- <val type="list" id="46912515257480" >
- <item type="numeric" value="536870920" />
- <item type="numeric" value="536936456" />
- </val>
- </entry>
- <entry>
- <key type="numeric" value="4120" />
- <val type="list" id="46912515256400" >
+ <key type="numeric" value="4112" />
+ <val type="list" id="146362700" >
+ <item type="numeric" value="0" />
+ <item type="numeric" value="0" />
+ <item type="numeric" value="0" />
+ <item type="numeric" value="0" />
+ </val>
+ </entry>
+ <entry>
+ <key type="numeric" value="4113" />
+ <val type="list" id="146365740" >
<item type="numeric" value="0" />
<item type="numeric" value="0" />
<item type="numeric" value="0" />
@@ -88,38 +73,89 @@
</entry>
<entry>
<key type="numeric" value="4736" />
- <val type="list" id="46912515257408" >
+ <val type="list" id="146871852" >
<item type="numeric" value="1538" />
<item type="numeric" value="1410" />
<item type="numeric" value="2" />
</val>
</entry>
-</attr>
-<attr name="SpecificMenu" type="list" id="46912515257624" >
-</attr>
-<attr name="ParamsDictionary" type="dict" id="16009744" >
+ <entry>
+ <key type="numeric" value="5633" />
+ <val type="list" id="146379724" >
+ <item type="numeric" value="537001992" />
+ <item type="numeric" value="537067528" />
+ </val>
+ </entry>
<entry>
<key type="numeric" value="8192" />
- <val type="dict" id="15883056" >
+ <val type="numeric" value="0" />
+ </entry>
+ <entry>
+ <key type="numeric" value="5632" />
+ <val type="list" id="146871756" >
+ <item type="numeric" value="536870920" />
+ <item type="numeric" value="536936456" />
+ </val>
+ </entry>
+ <entry>
+ <key type="numeric" value="4120" />
+ <val type="list" id="146379916" >
+ <item type="numeric" value="0" />
+ <item type="numeric" value="0" />
+ <item type="numeric" value="0" />
+ <item type="numeric" value="0" />
+ </val>
+ </entry>
+ <entry>
+ <key type="numeric" value="4118" />
+ <val type="list" id="146380140" >
+ <item type="numeric" value="133122" />
+ </val>
+ </entry>
+</attr>
+<attr name="SpecificMenu" type="list" id="146382668" >
+</attr>
+<attr name="ParamsDictionary" type="dict" id="146655812" >
+ <entry>
+ <key type="numeric" value="8192" />
+ <val type="dict" id="146655948" >
<entry>
<key type="string" value="callback" />
<val type="True" value="" />
</entry>
</val>
</entry>
-</attr>
-<attr name="UserMapping" type="dict" id="16000080" >
+ <entry>
+ <key type="numeric" value="4112" />
+ <val type="dict" id="146665788" >
+ <entry>
+ <key type="string" value="callback" />
+ <val type="True" value="" />
+ </entry>
+ </val>
+ </entry>
+ <entry>
+ <key type="numeric" value="4113" />
+ <val type="dict" id="146652124" >
+ <entry>
+ <key type="string" value="callback" />
+ <val type="True" value="" />
+ </entry>
+ </val>
+ </entry>
+</attr>
+<attr name="UserMapping" type="dict" id="146656084" >
<entry>
<key type="numeric" value="8192" />
- <val type="dict" id="16029824" >
+ <val type="dict" id="146656220" >
<entry>
<key type="string" value="need" />
<val type="False" value="" />
</entry>
<entry>
<key type="string" value="values" />
- <val type="list" id="46912515257984" >
- <item type="dict" id="16028256" >
+ <val type="list" id="146379852" >
+ <item type="dict" id="146656356" >
<entry>
<key type="string" value="access" />
<val type="string" value="rw" />
@@ -151,15 +187,15 @@
</entry>
<entry>
<key type="numeric" value="8193" />
- <val type="dict" id="16028688" >
+ <val type="dict" id="146656492" >
<entry>
<key type="string" value="need" />
<val type="False" value="" />
</entry>
<entry>
<key type="string" value="values" />
- <val type="list" id="46912515257768" >
- <item type="dict" id="16030112" >
+ <val type="list" id="146379660" >
+ <item type="dict" id="146656628" >
<entry>
<key type="string" value="access" />
<val type="string" value="rw" />
@@ -191,15 +227,15 @@
</entry>
<entry>
<key type="numeric" value="8194" />
- <val type="dict" id="16030448" >
+ <val type="dict" id="146656764" >
<entry>
<key type="string" value="need" />
<val type="False" value="" />
</entry>
<entry>
<key type="string" value="values" />
- <val type="list" id="46912515258128" >
- <item type="dict" id="16030736" >
+ <val type="list" id="146380204" >
+ <item type="dict" id="146656900" >
<entry>
<key type="string" value="access" />
<val type="string" value="rw" />
@@ -231,15 +267,15 @@
</entry>
<entry>
<key type="numeric" value="8195" />
- <val type="dict" id="16031072" >
+ <val type="dict" id="146657036" >
<entry>
<key type="string" value="need" />
<val type="False" value="" />
</entry>
<entry>
<key type="string" value="values" />
- <val type="list" id="46912515257912" >
- <item type="dict" id="16031360" >
+ <val type="list" id="146379756" >
+ <item type="dict" id="146665516" >
<entry>
<key type="string" value="access" />
<val type="string" value="rw" />
@@ -270,7 +306,7 @@
</val>
</entry>
</attr>
-<attr name="DS302" type="dict" id="16040992" >
+<attr name="DS302" type="dict" id="146665652" >
</attr>
<attr name="ProfileName" type="string" value="DS-301" />
<attr name="Type" type="string" value="master" />
--- a/examples/TestMasterSlave/TestSlave.c Mon May 22 09:46:29 2006 +0200
+++ b/examples/TestMasterSlave/TestSlave.c Tue May 23 01:15:22 2006 +0200
@@ -63,21 +63,21 @@
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
/* index 0x1000 : Device Type. */
- UNS32 TestSlave_obj1000 = 0x12D;
+ UNS32 TestSlave_obj1000 = 0x12D; // 301
subindex TestSlave_Index1000[] =
{
{ RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1000 }
};
/* index 0x1001 : Error Register. */
- UNS8 TestSlave_obj1001 = 0x0;
+ UNS8 TestSlave_obj1001 = 0x0; // 0
subindex TestSlave_Index1001[] =
{
{ RO, uint8, sizeof (UNS8), (void*)&TestSlave_obj1001 }
};
/* index 0x1005 : SYNC COB ID. */
- UNS32 TestSlave_obj1005 = 0x80;
+ UNS32 TestSlave_obj1005 = 0x80; // 128
ODCallback_t TestSlave_Index1005_callbacks[] =
{
NULL,
@@ -88,7 +88,7 @@
};
/* index 0x1006 : Communication / Cycle Period. */
- UNS32 TestSlave_obj1006 = 0x0;
+ UNS32 TestSlave_obj1006 = 0x0; // 0
ODCallback_t TestSlave_Index1006_callbacks[] =
{
NULL,
@@ -98,13 +98,59 @@
{ RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1006 }
};
+/* index 0x1010 : Store parameters. */
+ UNS8 TestSlave_highestSubIndex_obj1010 = 4; // number of subindex - 1
+ UNS32 TestSlave_obj1010_Save_All_Parameters = 0x0; // 0
+ UNS32 TestSlave_obj1010_Save_Communication_Parameters = 0x0; // 0
+ UNS32 TestSlave_obj1010_Save_Application_Parameters = 0x0; // 0
+ UNS32 TestSlave_obj1010_Save_Manufacturer_Parameters = 0x0; // 0
+ ODCallback_t TestSlave_Index1010_callbacks[] =
+ {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ };
+ subindex TestSlave_Index1010[] =
+ {
+ { RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1010 },
+ { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1010_Save_All_Parameters },
+ { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1010_Save_Communication_Parameters },
+ { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1010_Save_Application_Parameters },
+ { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1010_Save_Manufacturer_Parameters }
+ };
+
+/* index 0x1011 : Restore Default Parameters. */
+ UNS8 TestSlave_highestSubIndex_obj1011 = 4; // number of subindex - 1
+ UNS32 TestSlave_obj1011_Restore_All_Default_Parameters = 0x0; // 0
+ UNS32 TestSlave_obj1011_Restore_Communication_Default_Parameters = 0x0; // 0
+ UNS32 TestSlave_obj1011_Restore_Application_Default_Parameters = 0x0; // 0
+ UNS32 TestSlave_obj1011_Restore_Manufacturer_Default_Parameters = 0x0; // 0
+ ODCallback_t TestSlave_Index1011_callbacks[] =
+ {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ };
+ subindex TestSlave_Index1011[] =
+ {
+ { RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1011 },
+ { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1011_Restore_All_Default_Parameters },
+ { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1011_Restore_Communication_Default_Parameters },
+ { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1011_Restore_Application_Default_Parameters },
+ { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1011_Restore_Manufacturer_Default_Parameters }
+ };
+
/* index 0x1016 : Consumer Heartbeat Time */
UNS8 TestSlave_highestSubIndex_obj1016 = 0;
UNS32 TestSlave_obj1016[0];
subindex TestSlave_Index1016[0];
/* index 0x1017 : Producer Heartbeat Time. */
- UNS16 TestSlave_obj1017 = 0x3E8;
+ UNS16 TestSlave_obj1017 = 0x3E8; // 1000
subindex TestSlave_Index1017[] =
{
{ RW, uint16, sizeof (UNS16), (void*)&TestSlave_obj1017 }
@@ -112,10 +158,10 @@
/* index 0x1018 : Identity. */
UNS8 TestSlave_highestSubIndex_obj1018 = 4; // number of subindex - 1
- UNS32 TestSlave_obj1018_Vendor_ID = 0x0;
- UNS32 TestSlave_obj1018_Product_Code = 0x0;
- UNS32 TestSlave_obj1018_Revision_Number = 0x0;
- UNS32 TestSlave_obj1018_Serial_Number = 0x0;
+ UNS32 TestSlave_obj1018_Vendor_ID = 0x0; // 0
+ UNS32 TestSlave_obj1018_Product_Code = 0x0; // 0
+ UNS32 TestSlave_obj1018_Revision_Number = 0x0; // 0
+ UNS32 TestSlave_obj1018_Serial_Number = 0x0; // 0
subindex TestSlave_Index1018[] =
{
{ RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1018 },
@@ -127,8 +173,8 @@
/* index 0x1200 : Server SDO Parameter. */
UNS8 TestSlave_highestSubIndex_obj1200 = 2; // number of subindex - 1
- UNS32 TestSlave_obj1200_COB_ID_Client_to_Server_Receive_SDO = 0x601;
- UNS32 TestSlave_obj1200_COB_ID_Server_to_Client_Transmit_SDO = 0x581;
+ UNS32 TestSlave_obj1200_COB_ID_Client_to_Server_Receive_SDO = 0x601; // 1537
+ UNS32 TestSlave_obj1200_COB_ID_Server_to_Client_Transmit_SDO = 0x581; // 1409
subindex TestSlave_Index1200[] =
{
{ RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1200 },
@@ -138,11 +184,11 @@
/* index 0x1800 : Transmit PDO 1 Parameter. */
UNS8 TestSlave_highestSubIndex_obj1800 = 5; // number of subindex - 1
- UNS32 TestSlave_obj1800_COB_ID_used_by_PDO = 0x182;
- UNS8 TestSlave_obj1800_Transmission_Type = 0x1;
- UNS16 TestSlave_obj1800_Inhibit_Time = 0x0;
- UNS16 TestSlave_obj1800_Compatibility_Entry = 0x0;
- UNS16 TestSlave_obj1800_Event_Timer = 0x0;
+ UNS32 TestSlave_obj1800_COB_ID_used_by_PDO = 0x182; // 386
+ UNS8 TestSlave_obj1800_Transmission_Type = 0x1; // 1
+ UNS16 TestSlave_obj1800_Inhibit_Time = 0x0; // 0
+ UNS16 TestSlave_obj1800_Compatibility_Entry = 0x0; // 0
+ UNS16 TestSlave_obj1800_Event_Timer = 0x0; // 0
subindex TestSlave_Index1800[] =
{
{ RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1800 },
@@ -155,11 +201,11 @@
/* index 0x1801 : Transmit PDO 2 Parameter. */
UNS8 TestSlave_highestSubIndex_obj1801 = 5; // number of subindex - 1
- UNS32 TestSlave_obj1801_COB_ID_used_by_PDO = 0x282;
- UNS8 TestSlave_obj1801_Transmission_Type = 0x1;
- UNS16 TestSlave_obj1801_Inhibit_Time = 0x0;
- UNS16 TestSlave_obj1801_Compatibility_Entry = 0x0;
- UNS16 TestSlave_obj1801_Event_Timer = 0x0;
+ UNS32 TestSlave_obj1801_COB_ID_used_by_PDO = 0x282; // 642
+ UNS8 TestSlave_obj1801_Transmission_Type = 0x1; // 1
+ UNS16 TestSlave_obj1801_Inhibit_Time = 0x0; // 0
+ UNS16 TestSlave_obj1801_Compatibility_Entry = 0x0; // 0
+ UNS16 TestSlave_obj1801_Event_Timer = 0x0; // 0
subindex TestSlave_Index1801[] =
{
{ RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1801 },
@@ -174,8 +220,8 @@
UNS8 TestSlave_highestSubIndex_obj1A00 = 2; // number of subindex - 1
UNS32 TestSlave_obj1A00[] =
{
- 536870920,
- 536936456
+ 0x20000008, // 536870920
+ 0x20010008 // 536936456
};
subindex TestSlave_Index1A00[] =
{
@@ -188,8 +234,8 @@
UNS8 TestSlave_highestSubIndex_obj1A01 = 2; // number of subindex - 1
UNS32 TestSlave_obj1A01[] =
{
- 537001992,
- 537067528
+ 0x20020008, // 537001992
+ 0x20030008 // 537067528
};
subindex TestSlave_Index1A01[] =
{
@@ -228,6 +274,8 @@
{ (subindex*)TestSlave_Index1001,sizeof(TestSlave_Index1001)/sizeof(TestSlave_Index1001[0]), 0x1001},
{ (subindex*)TestSlave_Index1005,sizeof(TestSlave_Index1005)/sizeof(TestSlave_Index1005[0]), 0x1005},
{ (subindex*)TestSlave_Index1006,sizeof(TestSlave_Index1006)/sizeof(TestSlave_Index1006[0]), 0x1006},
+ { (subindex*)TestSlave_Index1010,sizeof(TestSlave_Index1010)/sizeof(TestSlave_Index1010[0]), 0x1010},
+ { (subindex*)TestSlave_Index1011,sizeof(TestSlave_Index1011)/sizeof(TestSlave_Index1011[0]), 0x1011},
{ (subindex*)TestSlave_Index1017,sizeof(TestSlave_Index1017)/sizeof(TestSlave_Index1017[0]), 0x1017},
{ (subindex*)TestSlave_Index1018,sizeof(TestSlave_Index1018)/sizeof(TestSlave_Index1018[0]), 0x1018},
{ (subindex*)TestSlave_Index1200,sizeof(TestSlave_Index1200)/sizeof(TestSlave_Index1200[0]), 0x1200},
@@ -244,22 +292,25 @@
const indextable * TestSlave_scanIndexOD (UNS16 wIndex, UNS32 * errorCode, ODCallback_t **callbacks)
{
int i;
+ *callbacks = NULL;
switch(wIndex){
- case 0x1000: i = 0; *callbacks = NULL; break;
- case 0x1001: i = 1; *callbacks = NULL; break;
- case 0x1005: i = 2; *callbacks = TestSlave_Index1005_callbacks; break;
- case 0x1006: i = 3; *callbacks = TestSlave_Index1006_callbacks; break;
- case 0x1017: i = 4; *callbacks = NULL; break;
- case 0x1018: i = 5; *callbacks = NULL; break;
- case 0x1200: i = 6; *callbacks = NULL; break;
- case 0x1800: i = 7; *callbacks = NULL; break;
- case 0x1801: i = 8; *callbacks = NULL; break;
- case 0x1A00: i = 9; *callbacks = NULL; break;
- case 0x1A01: i = 10; *callbacks = NULL; break;
- case 0x2000: i = 11; *callbacks = NULL; break;
- case 0x2001: i = 12; *callbacks = NULL; break;
- case 0x2002: i = 13; *callbacks = NULL; break;
- case 0x2003: i = 14; *callbacks = NULL; break;
+ case 0x1000: i = 0;break;
+ case 0x1001: i = 1;break;
+ case 0x1005: i = 2;*callbacks = TestSlave_Index1005_callbacks; break;
+ case 0x1006: i = 3;*callbacks = TestSlave_Index1006_callbacks; break;
+ case 0x1010: i = 4;*callbacks = TestSlave_Index1010_callbacks; break;
+ case 0x1011: i = 5;*callbacks = TestSlave_Index1011_callbacks; break;
+ case 0x1017: i = 6;break;
+ case 0x1018: i = 7;break;
+ case 0x1200: i = 8;break;
+ case 0x1800: i = 9;break;
+ case 0x1801: i = 10;break;
+ case 0x1A00: i = 11;break;
+ case 0x1A01: i = 12;break;
+ case 0x2000: i = 13;break;
+ case 0x2001: i = 14;break;
+ case 0x2002: i = 15;break;
+ case 0x2003: i = 16;break;
default:
*errorCode = OD_NO_SUCH_OBJECT;
return NULL;
@@ -274,21 +325,21 @@
UNS8 TestSlave_count_sync[2] = {0,};
quick_index TestSlave_firstIndex = {
- SDO_SVR : 6,
+ SDO_SVR : 8,
SDO_CLT : 0,
PDO_RCV : 0,
PDO_RCV_MAP : 0,
- PDO_TRS : 7,
- PDO_TRS_MAP : 9
+ PDO_TRS : 9,
+ PDO_TRS_MAP : 11
};
quick_index TestSlave_lastIndex = {
- SDO_SVR : 6,
+ SDO_SVR : 8,
SDO_CLT : 0,
PDO_RCV : 0,
PDO_RCV_MAP : 0,
- PDO_TRS : 8,
- PDO_TRS_MAP : 10
+ PDO_TRS : 10,
+ PDO_TRS_MAP : 12
};
UNS16 TestSlave_ObjdictSize = sizeof(TestSlave_objdict)/sizeof(TestSlave_objdict[0]);
--- a/examples/TestMasterSlave/TestSlave.h Mon May 22 09:46:29 2006 +0200
+++ b/examples/TestMasterSlave/TestSlave.h Tue May 23 01:15:22 2006 +0200
@@ -41,6 +41,8 @@
// Master node data struct
extern CO_Data TestSlave_Data;
+extern ODCallback_t Store_parameters_callbacks[]; // Callbacks of index0x1010
+extern ODCallback_t Restore_Default_Parameters_callbacks[]; // Callbacks of index0x1011
extern UNS8 SlaveMap1; // Mapped at index 0x2000, subindex 0x00
extern UNS8 SlaveMap2; // Mapped at index 0x2001, subindex 0x00
extern UNS8 SlaveMap3; // Mapped at index 0x2002, subindex 0x00
--- a/examples/TestMasterSlave/TestSlave.od Mon May 22 09:46:29 2006 +0200
+++ b/examples/TestMasterSlave/TestSlave.od Tue May 23 01:15:22 2006 +0200
@@ -1,10 +1,10 @@
<?xml version="1.0"?>
<!DOCTYPE PyObject SYSTEM "PyObjects.dtd">
-<PyObject module="node" class="Node" id="46912513800672">
-<attr name="Profile" type="dict" id="14889664" >
+<PyObject module="node" class="Node" id="146839660">
+<attr name="Profile" type="dict" id="146845180" >
</attr>
<attr name="Name" type="string" value="TestSlave" />
-<attr name="Dictionary" type="dict" id="14889376" >
+<attr name="Dictionary" type="dict" id="146301924" >
<entry>
<key type="numeric" value="4096" />
<val type="numeric" value="301" />
@@ -23,7 +23,7 @@
</entry>
<entry>
<key type="numeric" value="6145" />
- <val type="list" id="46912515235352" >
+ <val type="list" id="146840204" >
<item type="numeric" value="642" />
<item type="numeric" value="1" />
<item type="numeric" value="0" />
@@ -45,7 +45,7 @@
</entry>
<entry>
<key type="numeric" value="6144" />
- <val type="list" id="46912515235280" >
+ <val type="list" id="146840492" >
<item type="numeric" value="386" />
<item type="numeric" value="1" />
<item type="numeric" value="0" />
@@ -54,22 +54,40 @@
</val>
</entry>
<entry>
+ <key type="numeric" value="4112" />
+ <val type="list" id="146839916" >
+ <item type="numeric" value="0" />
+ <item type="numeric" value="0" />
+ <item type="numeric" value="0" />
+ <item type="numeric" value="0" />
+ </val>
+ </entry>
+ <entry>
+ <key type="numeric" value="4113" />
+ <val type="list" id="146839788" >
+ <item type="numeric" value="0" />
+ <item type="numeric" value="0" />
+ <item type="numeric" value="0" />
+ <item type="numeric" value="0" />
+ </val>
+ </entry>
+ <entry>
<key type="numeric" value="4608" />
- <val type="list" id="46912515235568" >
+ <val type="list" id="146839884" >
<item type="numeric" value="1537" />
<item type="numeric" value="1409" />
</val>
</entry>
<entry>
<key type="numeric" value="6657" />
- <val type="list" id="46912515234848" >
+ <val type="list" id="146839692" >
<item type="numeric" value="537001992" />
<item type="numeric" value="537067528" />
</val>
</entry>
<entry>
<key type="numeric" value="6656" />
- <val type="list" id="46912515233696" >
+ <val type="list" id="146840428" >
<item type="numeric" value="536870920" />
<item type="numeric" value="536936456" />
</val>
@@ -80,7 +98,7 @@
</entry>
<entry>
<key type="numeric" value="4120" />
- <val type="list" id="46912515234200" >
+ <val type="list" id="146839980" >
<item type="numeric" value="0" />
<item type="numeric" value="0" />
<item type="numeric" value="0" />
@@ -92,31 +110,49 @@
<val type="numeric" value="0" />
</entry>
</attr>
-<attr name="SpecificMenu" type="list" id="46912515256688" >
-</attr>
-<attr name="ParamsDictionary" type="dict" id="14885152" >
+<attr name="SpecificMenu" type="list" id="146275244" >
+</attr>
+<attr name="ParamsDictionary" type="dict" id="146844772" >
<entry>
<key type="numeric" value="8192" />
- <val type="dict" id="14890736" >
+ <val type="dict" id="146846148" >
<entry>
<key type="string" value="callback" />
<val type="False" value="" />
</entry>
</val>
</entry>
-</attr>
-<attr name="UserMapping" type="dict" id="14889952" >
+ <entry>
+ <key type="numeric" value="4112" />
+ <val type="dict" id="146857740" >
+ <entry>
+ <key type="string" value="callback" />
+ <val type="True" value="" />
+ </entry>
+ </val>
+ </entry>
+ <entry>
+ <key type="numeric" value="4113" />
+ <val type="dict" id="147802964" >
+ <entry>
+ <key type="string" value="callback" />
+ <val type="True" value="" />
+ </entry>
+ </val>
+ </entry>
+</attr>
+<attr name="UserMapping" type="dict" id="146845876" >
<entry>
<key type="numeric" value="8192" />
- <val type="dict" id="14891808" >
+ <val type="dict" id="146844636" >
<entry>
<key type="string" value="need" />
<val type="False" value="" />
</entry>
<entry>
<key type="string" value="values" />
- <val type="list" id="46912515235640" >
- <item type="dict" id="14885728" >
+ <val type="list" id="146840396" >
+ <item type="dict" id="146846420" >
<entry>
<key type="string" value="access" />
<val type="string" value="rw" />
@@ -148,15 +184,15 @@
</entry>
<entry>
<key type="numeric" value="8193" />
- <val type="dict" id="14340160" >
+ <val type="dict" id="146845316" >
<entry>
<key type="string" value="need" />
<val type="False" value="" />
</entry>
<entry>
<key type="string" value="values" />
- <val type="list" id="46912515235496" >
- <item type="dict" id="14886064" >
+ <val type="list" id="146840268" >
+ <item type="dict" id="146846692" >
<entry>
<key type="string" value="access" />
<val type="string" value="rw" />
@@ -188,15 +224,15 @@
</entry>
<entry>
<key type="numeric" value="8194" />
- <val type="dict" id="14886352" >
+ <val type="dict" id="146845740" >
<entry>
<key type="string" value="need" />
<val type="False" value="" />
</entry>
<entry>
<key type="string" value="values" />
- <val type="list" id="46912515234560" >
- <item type="dict" id="14886976" >
+ <val type="list" id="146840908" >
+ <item type="dict" id="146846964" >
<entry>
<key type="string" value="access" />
<val type="string" value="rw" />
@@ -228,15 +264,15 @@
</entry>
<entry>
<key type="numeric" value="8195" />
- <val type="dict" id="14886688" >
+ <val type="dict" id="146845044" >
<entry>
<key type="string" value="need" />
<val type="False" value="" />
</entry>
<entry>
<key type="string" value="values" />
- <val type="list" id="46912515235784" >
- <item type="dict" id="14862688" >
+ <val type="list" id="146840108" >
+ <item type="dict" id="146847236" >
<entry>
<key type="string" value="access" />
<val type="string" value="rw" />
@@ -267,7 +303,7 @@
</val>
</entry>
</attr>
-<attr name="DS302" type="dict" id="14135568" >
+<attr name="DS302" type="dict" id="146846012" >
</attr>
<attr name="ProfileName" type="string" value="DS-301" />
<attr name="Type" type="string" value="slave" />