Loading PDO information from the EtherCAT device
Some EtherCAT slaves have a dynamic CoE interface whose PDO configuration is not statically defined in the ESI file. In this case, the PDO information can be retrieved directly from the connected device. In addition, the complete CoE object directory – the online dictionary – can be loaded via an SDO upload. This is useful for determining a device's actual object indexes and types.
Requirements
- An EtherCAT slave with CoE support is connected and operational.
- TwinCAT is active.
C# sample
ITcSmTreeItem ecSlave = sysManager.LookupTreeItem(@"TIID^EtherCAT Master^EK1100^Term 3 (EL5101)");
// Load PDO information from device
// (corresponds to "Load PDO Info from Device" in TwinCAT XAE)
ecSlave.ConsumeXml(
@"<TreeItem><EtherCAT><Slave><Mailbox><CoE>
<LoadPdoInfoFromDevice>1</LoadPdoInfoFromDevice>
</CoE></Mailbox></Slave></EtherCAT></TreeItem>");
// Load online dictionary from device
// (corresponds to CoE dictionary upload via SDO)
ecSlave.ConsumeXml(
@"<TreeItem><EtherCAT><Slave><Mailbox><CoE>
<LoadOnlineDictionary>1</LoadOnlineDictionary>
</CoE></Mailbox></Slave></EtherCAT></TreeItem>");
PowerShell sample
$ecSlave = $sysManager.LookupTreeItem("TIID^EtherCAT Master^EK1100^Term 3 (EL5101)")
# Load PDO information from device
$ecSlave.ConsumeXml("<TreeItem><EtherCAT><Slave><Mailbox><CoE><LoadPdoInfoFromDevice>1</LoadPdoInfoFromDevice></CoE></Mailbox></Slave></EtherCAT></TreeItem>")
# Load online dictionary from device
$ecSlave.ConsumeXml("<TreeItem><EtherCAT><Slave><Mailbox><CoE><LoadOnlineDictionary>1</LoadOnlineDictionary></CoE></Mailbox></Slave></EtherCAT></TreeItem>")
![]() |
|
