[etherlab-users] write_sdo() function
HASSAN ZAHRAEE Ali
Ali.HASSANZAHRAEE at cea.fr
Mon Jul 27 17:47:05 CEST 2015
Hi all,
I am trying to write a simplified ethercat communication module on top of Igh master for some of my colleagues who do not want to know the details of how the master works.
Based on the sdo_read() function in the examples provided with the master, I have written the following write_sdo() function:
int write_sdo( ec_sdo_request_t *sdo, uint8_t *data)
{
int sdo_write_ret = 0;
size_t size = ecrt_sdo_request_data_size(sdo);
switch (ecrt_sdo_request_state(sdo)) {
case EC_REQUEST_UNUSED:
ecrt_sdo_request_write(sdo); // trigger first read
break;
case EC_REQUEST_BUSY:
fprintf(stderr, "Still busy...\n");
break;
case EC_REQUEST_SUCCESS:
if(!(sdo_write_ret = ec_sdo_request_copy_data(sdo_server, data, size))) {
printf("Failed to write to SDO channel.\n");
}
ecrt_sdo_request_write(sdo); // trigger next read
break;
case EC_REQUEST_ERROR:
fprintf(stderr, "Failed to write to SDO channel!\n");
ecrt_sdo_request_write(sdo); // retry reading
break;
}
return sdo_write_ret;
}
When compiling I get an undefined reference to `ec_sdo_request_copy_data' error. I tried adding
EXPORT_SYMBOL(ec_sdo_request_copy_data);
at the end of /master/sdo_request.c and rebuild the master, but it didn't help.
It would be great if someone could help with this issue.
Best Regards,
Ali
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20150727/5eab8370/attachment-0002.htm>
More information about the Etherlab-users
mailing list