[etherlab-users] Can I skip ecrt_master_receive() and ecrt_domain_process()?

Johnathan Van Why jrvanwhy at gmail.com
Thu Aug 2 00:02:48 CEST 2012


For our code, we are sending out two EtherCAT frames per cycle. The
first one is to collect data; I clearly need to run
ecrt_master_receive() and ecrt_domain_process() some time after
sending the frame here. However, once the controllers have run, we
then send out a second frame with our updated torques. We will not
read any of the data that our slaves send back.

In other words, our main loop looks something like this:

while (!done) {
	// Receive new sensor data from our slaves
	ecrt_domain_queue(domain);
	ecrt_master_send(master);
	usleep(20);
	ecrt_master_receive(master);
	
	runControllers();
	
	// Send the updated torque values to our slaves
	ecrt_domain_queue(domain);
	ecrt_master_send(master);
	// Are the following 3 lines needed?
	usleep(20);
	ecrt_master_receive(master);
	ecrt_domain_process(domain);
	
	wait_for_next_cycle();
}

Do we need to call ecrt_master_receive() and/or ecrt_domain_process()
here, or can we just call it when we actually need to process received
values?

Thank you,
Johnathan Van Why
Dynamic Robotics Laboratory
Oregon State University



More information about the Etherlab-users mailing list