Use SDO to compare the data in hardware and an ESI file
When you use the ESI file to configure your EtherCAT slave, the slave may return errors for Service Data Objects (SDO) that are defined in the ESI. The consistency between the data in hardware and the ESI file is important. If the data doesn't work like the ESI file describes, the hardware won't be properly configured, and the value you get will be incorrect. To check the consistency between the data of the hardware and the ESI, you can use the SDO Info API functions KINGSTAR provides.
CoeReadSdoODList
To get the object you want, first you need to read the object dictionary. To do this, you use CoeReadSdoODList, which returns the array of the object index. After you get the index, you can use CoeReadSdoObjectDescription to get the details of the object.
CoeReadSdoObjectDescription
Before you use this function, you need to define the SdoObjectDescription structure, in which you need to fill Index with the object index you got from the CoeReadSdoODList, other fields such as DataType, MaxSubIndex, ObjectCode will be filled when you call the function. Notice that the DataType field contains a number. You need to look up the ESI file to know what this number means, because the data type of the object varies between hardware.
Take Kollmorgen AKD drive as an example. If you request its DataType and get "0," it corresponds to the first entry under the DataTypes tag in the drive's ESI file, 32-bit DINT. If you get "1," it corresponds to the second entry, 16-bit INT.
CoeReadSdoEntryDescription
An object may have many entries that contain different data. You can use CoeReadSdoEntryDescription to get these data. Just CoeReadSdoObjectDescription, you need to define the SdoEntryDescription structure before you use this function. In the structure you need to fill Index, SubIndex, and ValueInfo with the object index, entry index, and bit mask of data selection respectively. The returned data appears in the Data field. You need to check the ESI file or the user guide for your hardware to know what the returned data means.