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

Richard Hacker ha at igh-essen.com
Thu Aug 2 16:33:16 CEST 2012


On Thursday 02 August 2012 00:02:48 Johnathan Van Why wrote:
> 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);
A ecrt_domain_process(domain) is missing here!

> 
> 	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);
No, these last two lines are not really necessary. The domain processing is 
delayed till the next cycle in the calls before runControllers().

To put it shortly, ecrt_master_receive() and ecrt_domain_process() will handle 
all available frames, in the order they were sent (and received).

> 
> 	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
> _______________________________________________
> etherlab-users mailing list
> etherlab-users at etherlab.org
> http://lists.etherlab.org/mailman/listinfo/etherlab-users
> 

Mit freundlichem Gruß

Richard Hacker

-- 
------------------------------------------------------------------------

Richard Hacker M.Sc. 
richard.hacker at igh-essen.com
Tel.: +49 201 / 36014-16

Ingenieurgemeinschaft IgH
Gesellschaft für Ingenieurleistungen mbH
Heinz-Bäcker-Str. 34
D-45356 Essen

Amtsgericht Essen HRB 11500
USt-Id.-Nr.: DE 174 626 722
Geschäftsführung: 
- Dr.-Ing. T. Finke, 
- Dr.-Ing. W. Hagemeister
Tel.: +49 201 / 360-14-0
http://www.igh-essen.com

------------------------------------------------------------------------



More information about the Etherlab-users mailing list