I have some questions about powerlink stack and Object Dictionary.
I have functional communication between PC with i210 chip and PLC X20, where PLC is as a mannaging node. I am sending full 16 bytes from PC to PLC, which allows me CiA 401 (DigitalOuput_AU_8 4x subindex, AnalogueOutput_AU_8 4x subindex, AnalogueAOutput_AI_8 2x subindex, AnalogueOutput_AI32 1x subindex). I have 4000us cycle time and the communication is stable. I have classical Ubuntu Linux without RT kernel. I have read some information about device profiles CIA 401 - CIA 406 and I have figured out, that OpenPowerlink stack uses CIA 401 - device profile for generic input/output modules.
My questions sound:
Device profile is equal to object dictionary? Is it possible to send more than 16 bytes? Is it possible to change object dictionary and map some more variables on side of PLC and Linux controled node application?
Thank you for your answers.
Best regards,
Jan Bacik
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Of course, you can create your own objdict.h. Easiest is to copy the objdict.h of the CiA401_CN to a new directory and include this directory instead in your builds. Then you can edit the objdict.h file according to your requirements.
If you don't want to follow a specific profile, you should make use of the index range of 0x2000 - 0x5FFF for your objects.
Additionally, you have to adapt the XDD file according to your object dictionary and use that new XDD in your MN configuration project (e.g. in Automation Studio or openCONFIGURATOR).
Refer also to the documentation of the obd module and the linking of objects to your application variables as demonstrated in the demo application.
Best regards,
Wolfgang
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
this gives the offset in the process image where the object is linked to. What index to be set depends on how you have set up your process image. Please refer to the app.c of the CN demos (demo_cn_console or demo_cn_embedded)! For your example it should work this way:
/* structure for input process image */
typedefstruct
{INT32aAnalogInput[32];}PI_IN;/* structure for output process image */
typedefstruct
{UINT32aAnalogOutput[32];}PI_OUT;/* process image */
staticPI_IN*pProcessImageIn_l;
staticPI_OUT*pProcessImageOut_l;//...//Fortheanaloginput
obdSize=sizeof(pProcessImageIn_l->aAnalogInput[0]);
varEntries=32;
ret=oplk_linkProcessImageObject(0x2000,0x01,offsetof(PI_IN,aAnalogInput),FALSE,obdSize,&varEntries);//Fortheanalogoutputs
obdSize=sizeof(pProcessImageOut_l->aAnalogOutput[0]);
varEntries=32;
ret=oplk_linkProcessImageObject(0x3000,0x01,offsetof(PI_OUT,aAnalogOutput),TRUE,obdSize,&varEntries);
Best regards,
Joerg
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have tried it but my demo application is still reseted.
openPOWERLINK console CN DEMO application
using openPOWERLINK Stack: V2.4.0
2016/08/06-09:57:52 INFO GENERIC demo_cn_console: Stack Version:V2.4.0 Stack Configuration:0x00000002
Initializing openPOWERLINK stack...
2016/08/06-09:57:52 INFO CONTROL Initializing openPOWERLINK stack
Initializing process image...
Size of process image: Input = 128 Output = 128
2016/08/06-09:57:54 INFO GENERIC Allocating process image: Input:128 Output:128
Linking process image vars:
Linking process vars... ok
start POWERLINK Stack... ok
Digital I/O interface with openPOWERLINK is ready!
Press Esc to leave the programm
Press r to reset the node
I have found out the problem. I had to expand PDO Tx (0x1A00) an Rd map (0x1600) in objdict.h and also in .xdd file. Now it works nicely, but I have warnings in Automation Studio during importing of CN .xdd file.
Is it this correct way how to map more variables?
Warning : Max. number of mapping-entries per channel (subObjects of 1600h) exceeded. 57 existing, 25 allowed
Warning : Max. number of mapping-entries per channel (subObjects of 1A00h) exceeded. 57 existing, 25 allowed
Probably you did not update the xdd file in the network parameter section.
Go to the end of the xdd file and adapt the number of channel objects accordingly:
Hello,
I have some questions about powerlink stack and Object Dictionary.
I have functional communication between PC with i210 chip and PLC X20, where PLC is as a mannaging node. I am sending full 16 bytes from PC to PLC, which allows me CiA 401 (DigitalOuput_AU_8 4x subindex, AnalogueOutput_AU_8 4x subindex, AnalogueAOutput_AI_8 2x subindex, AnalogueOutput_AI32 1x subindex). I have 4000us cycle time and the communication is stable. I have classical Ubuntu Linux without RT kernel. I have read some information about device profiles CIA 401 - CIA 406 and I have figured out, that OpenPowerlink stack uses CIA 401 - device profile for generic input/output modules.
My questions sound:
Device profile is equal to object dictionary? Is it possible to send more than 16 bytes? Is it possible to change object dictionary and map some more variables on side of PLC and Linux controled node application?
Thank you for your answers.
Best regards,
Jan Bacik
Hello Jan,
Of course, you can create your own objdict.h. Easiest is to copy the objdict.h of the CiA401_CN to a new directory and include this directory instead in your builds. Then you can edit the objdict.h file according to your requirements.
If you don't want to follow a specific profile, you should make use of the index range of 0x2000 - 0x5FFF for your objects.
Additionally, you have to adapt the XDD file according to your object dictionary and use that new XDD in your MN configuration project (e.g. in Automation Studio or openCONFIGURATOR).
Refer also to the documentation of the obd module and the linking of objects to your application variables as demonstrated in the demo application.
Best regards,
Wolfgang
Hello Wolfgang,
I will try it.
Best regards,
Jan Bacik
Last edit: Jan Bacik 2016-08-05
Hello,
I have added to objdict.h two objects:
OBD_BEGIN_PART_MANUFACTURER ()
When I want to start communication, it is still resets. Probably I have something wrong, but I dont know what.
Jan Bacik
Last edit: Jan Bacik 2016-08-05
Hello Jan,
this gives the offset in the process image where the object is linked to. What index to be set depends on how you have set up your process image. Please refer to the app.c of the CN demos (demo_cn_console or demo_cn_embedded)! For your example it should work this way:
Best regards,
Joerg
Hi Joerg,
I have tried it but my demo application is still reseted.
openPOWERLINK console CN DEMO application
using openPOWERLINK Stack: V2.4.0
2016/08/06-09:57:52 INFO GENERIC demo_cn_console: Stack Version:V2.4.0 Stack Configuration:0x00000002
Initializing openPOWERLINK stack...
2016/08/06-09:57:52 INFO CONTROL Initializing openPOWERLINK stack
Initializing process image...
Size of process image: Input = 128 Output = 128
2016/08/06-09:57:54 INFO GENERIC Allocating process image: Input:128 Output:128
Linking process image vars:
Linking process vars... ok
start POWERLINK Stack... ok
Digital I/O interface with openPOWERLINK is ready!
Press Esc to leave the programm
Press r to reset the node
Synchronous data thread is starting...
2016/08/06-09:57:54 EVENT STATE_CHANGE NmtGsOff->NmtGsInitializing Originating event:NmtEventSwReset
Stack entered state: NmtGsInitializing
2016/08/06-09:57:54 EVENT STATE_CHANGE NmtGsInitializing->NmtGsResetApplication Originating event:NmtEventEnterResetApp
Stack entered state: NmtGsResetApplication
2016/08/06-09:57:54 EVENT STATE_CHANGE NmtGsResetApplication->NmtGsResetCommunication Originating event:NmtEventEnterResetCom
Stack entered state: NmtGsResetCommunication
2016/08/06-09:57:55 EVENT STATE_CHANGE NmtGsResetCommunication->NmtGsResetConfiguration Originating event:NmtEventEnterResetConfig
Stack entered state: NmtGsResetConfiguration
2016/08/06-09:57:55 EVENT STATE_CHANGE NmtGsResetConfiguration->NmtCsNotActive Originating event:NmtEventEnterCsNotActive
Stack entered state: NmtCsNotActive
2016/08/06-09:57:55 EVENT STATE_CHANGE NmtCsNotActive->NmtCsPreOperational1 Originating event:NmtEventDllCeSoc
Stack entered state: NmtCsPreOperational1
2016/08/06-09:57:55 EVENT STATE_CHANGE NmtCsPreOperational1->NmtCsPreOperational2 Originating event:NmtEventDllCeSoc
Stack entered state: NmtCsPreOperational2
2016/08/06-09:57:56 EVENT STATE_CHANGE NmtCsPreOperational2->NmtGsResetApplication Originating event:NmtEventResetNode
Stack entered state: NmtGsResetApplication
2016/08/06-09:57:56 EVENT STATE_CHANGE NmtGsResetApplication->NmtGsResetCommunication Originating event:NmtEventEnterResetCom
Stack entered state: NmtGsResetCommunication
2016/08/06-09:57:57 EVENT STATE_CHANGE NmtGsResetCommunication->NmtGsResetConfiguration Originating event:NmtEventEnterResetConfig
Stack entered state: NmtGsResetConfiguration
2016/08/06-09:57:57 EVENT STATE_CHANGE NmtGsResetConfiguration->NmtCsNotActive Originating event:NmtEventEnterCsNotActive
Stack entered state: NmtCsNotActive
2016/08/06-09:57:57 EVENT STATE_CHANGE NmtCsNotActive->NmtCsPreOperational1 Originating event:NmtEventDllCeSoc
Stack entered state: NmtCsPreOperational1
2016/08/06-09:57:57 EVENT STATE_CHANGE NmtCsPreOperational1->NmtCsPreOperational2 Originating event:NmtEventDllCeSoc
Stack entered state: NmtCsPreOperational2
Hello,
I have found out the problem. I had to expand PDO Tx (0x1A00) an Rd map (0x1600) in objdict.h and also in .xdd file. Now it works nicely, but I have warnings in Automation Studio during importing of CN .xdd file.
Is it this correct way how to map more variables?
Warning : Max. number of mapping-entries per channel (subObjects of 1600h) exceeded. 57 existing, 25 allowed
Warning : Max. number of mapping-entries per channel (subObjects of 1A00h) exceeded. 57 existing, 25 allowed
Best regards,
Jan Bacik
// Object 1600h: PDO_RxMappParam_00h_AU64
OBD_BEGIN_INDEX_RAM(0x1600, 0x3A, oplk_cbGenericObdAccess)
OBD_SUBINDEX_RAM_VAR(0x1600, 0x00, kObdTypeUInt8, kObdAccRW, tObdUnsigned8, NumberOfEntries, 0x00)
OBD_SUBINDEX_RAM_VAR(0x1600, 0x01, kObdTypeUInt64, kObdAccRW, tObdUnsigned64, ObjectMapping, 0x00LL)
OBD_SUBINDEX_RAM_VAR(0x1600, 0x02, kObdTypeUInt64, kObdAccRW, tObdUnsigned64, ObjectMapping, 0x00LL)
OBD_SUBINDEX_RAM_VAR(0x1600, 0x03, kObdTypeUInt64, kObdAccRW, tObdUnsigned64, ObjectMapping, 0x00LL)
OBD_SUBINDEX_RAM_VAR(0x1600, 0x04, kObdTypeUInt64, kObdAccRW, tObdUnsigned64, ObjectMapping, 0x00LL)
OBD_SUBINDEX_RAM_VAR(0x1600, 0x05, kObdTypeUInt64, kObdAccRW, tObdUnsigned64, ObjectMapping, 0x00LL)
OBD_SUBINDEX_RAM_VAR(0x1600, 0x06, kObdTypeUInt64, kObdAccRW, tObdUnsigned64, ObjectMapping, 0x00LL)
OBD_SUBINDEX_RAM_VAR(0x1600, 0x07, kObdTypeUInt64, kObdAccRW, tObdUnsigned64, ObjectMapping, 0x00LL)
OBD_SUBINDEX_RAM_VAR(0x1600, 0x08, kObdTypeUInt64, kObdAccRW, tObdUnsigned64, ObjectMapping, 0x00LL)
OBD_SUBINDEX_RAM_VAR(0x1600, 0x09, kObdTypeUInt64, kObdAccRW, tObdUnsigned64, ObjectMapping, 0x00LL)
OBD_SUBINDEX_RAM_VAR(0x1600, 0x0A, kObdTypeUInt64, kObdAccRW, tObdUnsigned64, ObjectMapping, 0x00LL)
OBD_SUBINDEX_RAM_VAR(0x1600, 0x0B, kObdTypeUInt64, kObdAccRW, tObdUnsigned64, ObjectMapping, 0x00LL)
OBD_SUBINDEX_RAM_VAR(0x1600, 0x0C, kObdTypeUInt64, kObdAccRW, tObdUnsigned64, ObjectMapping, 0x00LL)
OBD_SUBINDEX_RAM_VAR(0x1600, 0x0D, kObdTypeUInt64, kObdAccRW, tObdUnsigned64, ObjectMapping, 0x00LL)
OBD_SUBINDEX_RAM_VAR(0x1600, 0x0E, kObdTypeUInt64, kObdAccRW, tObdUnsigned64, ObjectMapping, 0x00LL)
OBD_SUBINDEX_RAM_VAR(0x1600, 0x0F, kObdTypeUInt64, kObdAccRW, tObdUnsigned64, ObjectMapping, 0x00LL)
OBD_SUBINDEX_RAM_VAR(0x1600, 0x10, kObdTypeUInt64, kObdAccRW, tObdUnsigned64, ObjectMapping, 0x00LL)
OBD_SUBINDEX_RAM_VAR(0x1600, 0x11, kObdTypeUInt64, kObdAccRW, tObdUnsigned64, ObjectMapping, 0x00LL)
OBD_SUBINDEX_RAM_VAR(0x1600, 0x12, kObdTypeUInt64, kObdAccRW, tObdUnsigned64, ObjectMapping, 0x00LL)
OBD_SUBINDEX_RAM_VAR(0x1600, 0x13, kObdTypeUInt64, kObdAccRW, tObdUnsigned64, ObjectMapping, 0x00LL)
OBD_SUBINDEX_RAM_VAR(0x1600, 0x14, kObdTypeUInt64, kObdAccRW, tObdUnsigned64, ObjectMapping, 0x00LL)
OBD_SUBINDEX_RAM_VAR(0x1600, 0x15, kObdTypeUInt64, kObdAccRW, tObdUnsigned64, ObjectMapping, 0x00LL)
OBD_SUBINDEX_RAM_VAR(0x1600, 0x16, kObdTypeUInt64, kObdAccRW, tObdUnsigned64, ObjectMapping, 0x00LL)
OBD_SUBINDEX_RAM_VAR(0x1600, 0x17, kObdTypeUInt64, kObdAccRW, tObdUnsigned64, ObjectMapping, 0x00LL)
OBD_SUBINDEX_RAM_VAR(0x1600, 0x18, kObdTypeUInt64, kObdAccRW, tObdUnsigned64, ObjectMapping, 0x00LL)
OBD_SUBINDEX_RAM_VAR(0x1600, 0x19, kObdTypeUInt64, kObdAccRW, tObdUnsigned64, ObjectMapping, 0x00LL)
Hi Jan,
Probably you did not update the xdd file in the network parameter section.
Go to the end of the xdd file and adapt the number of channel objects accordingly:
Best regards,
Wolfgang