Slave PDO mapping
Process Data Object (PDO) is a type of periodic data object that can be used to exchange data between an EtherCAT master (KINGSTAR Runtime) and EtherCAT slaves (drives or IOs) during each EtherCAT communication cycle. The master can monitor and control the slave devices through PDO mapping.
With KINGSTAR, users are able to perform PDO mapping of slaves through KINGSTAR ESI Import Tool or Programmatical Configuration.
- KINGSTAR ESI Import Tool: the ESI (EtherCAT Slave Information) Import Tool allows users to import ESI files for their hardware, or modify ESI data and save it to the KINGSTAR ESI database. You can use the provided four data configuration modes, which will generate the necessary commands for process data exchange. For more details, please refer to Process Data.
- Default mode: select this mode to use the default PDO combinations specified in the ESI file of the device for process data exchange.
- Manual mode: select this mode to manually select the PDOs and the corresponding variables for process data exchange.
- Access Mode: select this mode to select different PDO combinations for different KsAccessMode.
- KINGSTAR EtherCAT API mode: select this mode and KINGSTAR will automatically select the variables for process data exchange through KINGSTAR EtherCAT API calls.
- Programmatical Configuration: the Programmatical Configuration method is designed for advanced users or special cases. If you already know which SDO commands to use, you can manually configure PDO mapping programmatically.
In the following content, we will guide you on how to programmatically create a PDO mapping.
Programmatically create PDO mapping
OverrideSlavePdoConfiguration can be used to programmatically set the PDO configuration of a device. It allows users to create the PDO mapping of a slave by changing its input and output PDO length to the new values. Please note that this API should be used in the Init and PreOP states only.
To configure the PDO mapping of a slave:
- Start the KINGSTAR ESI Import Tool, select a device and then click the Process Data tab in the right-side pane. Disable (uncheck) the PDO configuration and PDO assignment options, regardless of the selected mode (Default, Manual, Access Mode or KINGSTAR EtherCAT API). This is to prevent KINGSTAR from attempting to create a PDO mapping.
- In your application, call RequestState and set the state to ecatPreOP.
- Use mailbox commands to scan and configure the PDO configuration as needed.
- Use OverrideSlavePdoConfiguration to update the input and output length of the slave.
- Call RequestState and set the state to ecatOP.
See also
RT and Win32 — KINGSTAR Fieldbus — Slave control
.NET API — iApi Interface — Slave control
.NET API — Api Class — Slave control
OverrideSlavePdoConfiguration (Local)
OverrideSlavePdoConfiguration (Remote)