ECS dynamic PDO and MDP

1 Example project

The location for the ECS dynamicPDO Example is in our Knowledge Base

KB → Software → LFW Host Examples → EtherCAT Slave

For netX90:

2 ECS Sources

The ECS Sources in the ECS dynamicPDO Example are in the folder:

netXStudio_ECSV5_simpleConfig_V2.1.0.0\netX 90 - EtherCAT Slave - simpleConfig V2.1.0.0\Components\cifXApplicationDemoECS\Sources

3 Configuration packet

The configuration packet is the same like in the customOD example.

4 Create Object dictionary with 2 PDOs

To show dynamic PDO it is a good idea to create several PDOs

0x1600  → RxPDO

0x1601  → RxPDO

0x1A00 → TxPDO

0x1A01 → TxPDO

0x2000 → Manufacture specific Outputs

0x2001 → Manufacture specific Outputs

0x3000 → Manufacture specific Inptus

0x3001 → Manufacture specific Inptus

5 PDO Assignment in TwinCAT

In TwinCAT a List of PDOs is now available. It is possible to select the PDOs

It is necessary to activate the PDO Assigment and reload this configuration to TwinCat Master. Than the Sync Manager 2 and 3 Object can be found in the list of startup parameter.

The EtherCAT Master writes these parameters to the slave in the statechange from pre-operation to save-operational.

The application needs a write handling for Index 0x1C12 and Index 0x1C13:

That means, the slave application gets the information about the PDO (processdata) the EtherCAT Master wants from the slave.

The application needs to adapt his processdata and match it to the processdata the EtherCAT Master expects. For that it sends SET_IO_SIZE_REQ to the ECS Stack.

The EtherCAT Slave can go to save-operational state after adapting the processdata. For that the application neesd to take over the control of statechanges.

The application uses for that the Register for Control Indication Request in startup to deal with the statechange. Between AL Control Changed Response and Set Al Status Request the application makes the adapting of the processdata.

6 MDP (Modular Device Profile)

MDP includes different modular specifications. For example IO Link. The application need to use a value for theDeviceType != 0 in the configuration packet.

ptCoECfg->ulDeviceType          = ....;

We can't give you here an example for a complete profile specification. We only show, that the mechanics of the MDP are the same like in the dynamicPDO Example.

That means we can use the sourcecode from the dynamicPDO Example.

The only difference is now the ESI file: Hilscher NETX90 RE ECS V5.0.X_MDP.xml

In this ESI file is now a definition for Slots and modules

For Example Slot 1.

In this Slot it is possible to put aModule with the ID 1001 or 1003

The processdata definition is now part of the module 1001 or 1003. Here the example:

7 MDP in TwinCAT

With the new ESI the TwinCAT tool shows now a Slots tab. On the left side are the slots that can be used. On the right side is the list of the moduls that can be plugged in the selected slot.

Do not forget to activate PDO Assignment.