[etherlab-users] how to get the absolute slave position from userspace ?
Sebastien Blanchet
blanchet at iram.fr
Mon Jul 28 10:04:22 CEST 2014
Hi,
I am still facing a problem:
I would like to use ecrt_master_sdo_upload and ecrt_master_sdo_download
but I did not know how to get the absolute slave position (param #2)
ecrt.h says:
/** Executes an SDO download request to write data to a slave.
*
* This request is processed by the master state machine. This method blocks,
* until the request has been processed and may not be called in realtime
* context.
*
* \retval 0 Success.
* \retval <0 Error code.
*/
int ecrt_master_sdo_download(
ec_master_t *master, /**< EtherCAT master. */
uint16_t slave_position, /**< Slave position. */
uint16_t index, /**< Index of the SDO. */
uint8_t subindex, /**< Subindex of the SDO. */
uint8_t *data, /**< Data buffer to download. */
size_t data_size, /**< Size of the data buffer. */
uint32_t *abort_code /**< Abort code of the SDO download. */
);
I have tried to iterate over slaves info with ecrt_master_get_slave() to fill
ec_slave_info_t but indeed ec_slave_info_t contains the relative slave position
when the slave alias is not null.
I have also studied the source code of the 'ethercat slaves' tool (in
tool/CommandSlaves.cpp) but it uses functions that are not exported in ecrt.h
Finally, does someone have an idea ?
otherwise I will be forced to parse the output of 'ethercat slaves' to get
absolute slave position. (very ugly)
best regards,
--
Sebastien BLANCHET
More information about the Etherlab-users
mailing list