Become a leader in the IoT community!
Join our community of embedded and IoT practitioners to contribute experience, learn new skills and collaborate with other developers with complementary skillsets.
Join our community of embedded and IoT practitioners to contribute experience, learn new skills and collaborate with other developers with complementary skillsets.
hey guys, am developing a real-time industrial control system using a BeagleBone AI with Embedded Linux. The system should read data from an EtherCAT torque sensor. I have verified the `EtherCAT slave` connection and settings, checked the network interface and cable connections, made sure the EtherCAT library is correctly installed and configured. But am getting the error `No EtherCAT slaves found`.
this is my code
#include <stdio.h>
#include <ethercat.h>
int main() {
if (ec_init("eth0") <= 0) {
fprintf(stderr, "Failed to initialize EtherCATn");
return 1;
}
if (ec_config_init(FALSE) <= 0) {
fprintf(stderr, "No EtherCAT slaves foundn");
ec_close();
return 1;
}
ec_config_map(&IOmap);
ec_configdc();
while (1) {
ec_send_processdata();
ec_receive_processdata(EC_TIMEOUTRET);
int torque = ec_slave[1].inputs[0];
printf("Torque: %dn", torque);
usleep(500000);
}
ec_close();
return 0;
}
@Middleware & OS
CONTRIBUTE TO THIS THREAD