I took the openPOWERLINK_CN.xdd file that came with and added one 8bit input and one 8bit output like this:
<objectIndex="6000"name="DigitalInput_00h_AU8"objectType="8"dataType="0005"><SubObjectSubIndex="00"name="NumberOfEntries"objectType="7"#dataType="0005"accessType="const"defaultValue="0x1"PDOmapping="no"/><SubObjectSubIndex="01"name="DigitalInput"objectType="7"dataType="0005"accessType="rw"PDOmapping="TPDO"/></ Object><objectIndex="6200"name="DigitalOutput_00h_AU8"objectType="8"dataType="0005"><SubObjectSubIndex="00"name="NumberOfEntries"objectType="7"dataType="0005"accessType="const"defaultValue="0x1"PDOmapping="no"/><SubObjectSubIndex="01"name="DigitalOutput"objectType="7"dataType="0005"accessType="rw"PDOmapping="RPDO"/></ Object>
I then mapped my variables like this:
<objectIndex="1A00"name="PDO_TxMappParam_0h_AU64"objectType="8"><SubObjectSubIndex="00"name="NumberOfEntries"objectType="7"dataType="0005"accessType="rw"PDOmapping="no"defaultValue="1"/><SubObjectSubIndex="01"name="ObjectMapping"objectType="7"dataType="001B"accessType="rw"PDOmapping="no"defaultValue="0x0008000000016000"/></ object><objectIndex="1600"name="PDO_RxMappParam_0h_AU64"objectType="8"><SubObjectSubIndex="00"name="NumberOfEntries"objectType="7"dataType="0005"accessType="rw"defaultValue="0"PDOmapping="no"/><SubObjectSubIndex="01"name="ObjectMapping"objectType="7"dataType="001B"accessType="rw"PDOmapping="no"defaultValue="0x0008000000016200"/></ object>
Then I started the openConfigurator, startet a new project and added a CN node. I replaced xdd file by right-click CN node and choose my openPOWERLINK_CN.xdd modified file. After this auto generation conditioned I MN node and built the project. Everything seems to work and I get a xap.h file that looks like this:
/ * This file was auto-generated by openCONFIGURATOR-1.2.2 on 07-May-2013 18:18:30 * /
# ifndef XAP_h
# define XAP_h
# Define COMPUTED_PI_OUT_SIZE 4
typedef struct
{
unsigned CN1_M00_DigitalInput_00h_AU8_DigitalInput: 8;
unsigned PADDING_VAR_1: 24;
PI_OUT};
# Define COMPUTED_PI_IN_SIZE 4
typedef struct
{
unsigned CN1_M00_DigitalOutput_00h_AU8_DigitalOutput: 8;
unsigned PADDING_VAR_1: 24;
PI_IN};
# endif
The problem is that in my mnobd.txt file looks like this:
00000013
/ / / / Assignment nodeid
1F81 01 00000004 00000007
1A00 00 00000001 00
1600 00 00000001 00
1006 00 00000004 0000c350
1C02 01 00000004 00000028
1C02 03 00000004 00000028
1C09 01 00000004 00000028
1C14 00 00000004 02faf080
1F26 01 00000004 000029df
1F27 01 00000004 03edb4f0
1F92 01 00000004 00006978
1800 01 00000001 01
1A00 01 00000008 000800000001A040
1400 01 00000001 01
1600 01 00000008 000800000001A4C0
1A00 00 00000001 01
1600 00 00000001 01
/ / / / Configuration data for CN-1
1F22 01 00000066
0000000a
1600 00 00000001 00
1A00 00 00000001 00
1006 00 00000004 0000c350
1020 01 00000004 000029df
1020 02 00000004 03edb4f0
1C0B 03 00000004 00000050
1C0D 03 00000004 00000050
1C14 00 00000004 02faf080
1600 00 00000001 01
1A00 00 00000001 01
/ / / / Nodeid Reas Sign Ment
1F81 01 00000004 80000007
It's doing something with my PDO_TX / PDO_RX (1A00/1600) but the folders are not my registry 6000/01 and 6200/01. It should look like this at the end of my mnobd.txt file:
/ / / / Configuration data for CN-1
1F22 01 00000192
0000001E
1600 00 00000001 00
1A00 00 00000001 00
1006 00 00000004 0000C350
1020 01 00000004 000029df
1020 02 00000004 02f5a120
1C0B 03 00000004 00000050
1C0D 03 00000004 00000050
1C14 00 00000004 02faf080
1600 01 00000008 0008000000016200
1A00 01 00000008 0008000000016000
1600 00 00000001 01
1A00 00 00000001 01
/ / / / Nodeid Reassignment
1F81 01 00000004 80000007
Does anyone have an idea why this doesn't work? I will also include my XDD and project file below.
Last edit: Sixten Isaksson 2013-05-07
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
From your first post we see that in
object Index="1A00", SubIndex="01" the defaultValue field has been edited as "0x0008000000016000" but defaultValue field is not written to CDC file.
Instead the defaultValue field should be left as "0x0" and the actualValue field is to be added as shown below,
object Index="1A00", SubIndex="01" actualValue="0x0008000000016000" defaultValue="0x0"
The defaultValue in the XDD reflects - as the name indicates - the value that is contained in the object when it is not configured. If you want to set the mapping by default, you'd need to enter the value in the object dictionary of your device. Then your XDD would be correct.
Otherwise, you have to tell the MN to write the mapping via SDO. openCONFIGURATOR will write the setting only to the CDC if the actualValue (i.e. the value requested by you) differs from the defaultValue.
You can either do as Kalycito suggested (writing your value into an actualValue entry in the file) or you could enter the actualValue also in the openCONFIGURATOR GUI in the Value field of the mapping subobject (or via the PDO mapping table).
Best regards,
Wolfgang
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you so much for your help. Kalycito it worked just like you said. I had not noticed the ActualValue field. And thank you Wolfgang for your reply, it gave me a deeper understanding of the mapping between MN and CN.
Best regards,
Sixten
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Last edit: Sixten Isaksson 2013-05-07
Xdd file..
Last edit: Sixten Isaksson 2013-05-07
openConfigurator project..
Hello Sixten,
From your first post we see that in
object Index="1A00", SubIndex="01" the defaultValue field has been edited as "0x0008000000016000" but defaultValue field is not written to CDC file.
Instead the defaultValue field should be left as "0x0" and the actualValue field is to be added as shown below,
object Index="1A00", SubIndex="01" actualValue="0x0008000000016000" defaultValue="0x0"
Then the output would resemble the below,
/ / / / Configuration data for CN-1
1F22 01 00000084
0000000C
1600 00 00000001 00
1A00 00 00000001 00
1006 00 00000004 0000c350
1020 01 00000004 000029df
1020 02 00000004 02651150
1C0B 03 00000004 00000050
1C0D 03 00000004 00000050
1C14 00 00000004 02faf080
1600 01 00000008 0008000000016200
1A00 01 00000008 0008000000016000
1600 00 00000001 01
1A00 00 00000001 01
//// NodeId Reassignment
1F81 01 00000004 80000007
The same correction is to be done for object Index="1600" SubIndex="01" also.
Hope this solves your problem.
Regards,
Powerlink-team
Kalycito
Hi Sixten,
The defaultValue in the XDD reflects - as the name indicates - the value that is contained in the object when it is not configured. If you want to set the mapping by default, you'd need to enter the value in the object dictionary of your device. Then your XDD would be correct.
Otherwise, you have to tell the MN to write the mapping via SDO. openCONFIGURATOR will write the setting only to the CDC if the actualValue (i.e. the value requested by you) differs from the defaultValue.
You can either do as Kalycito suggested (writing your value into an actualValue entry in the file) or you could enter the actualValue also in the openCONFIGURATOR GUI in the Value field of the mapping subobject (or via the PDO mapping table).
Best regards,
Wolfgang
Thank you so much for your help. Kalycito it worked just like you said. I had not noticed the ActualValue field. And thank you Wolfgang for your reply, it gave me a deeper understanding of the mapping between MN and CN.
Best regards,
Sixten