[etherlab-users] problems with data exchange to slaves

Florian Pose fp at igh-essen.com
Fri Mar 26 17:13:11 CET 2010


Hi dusty,

On Wed, Mar 17, 2010 at 04:36:13PM -0700, dclark at mmto.org wrote:
> EtherCAT DEBUG: mmap()
> EtherCAT DEBUG: Vma fault, virtual_address = b7838000, offset = 0, page =
> c18913e0   ?? Why is there a fault reported here ??

see my prior post.

>     printf("Activating master...");
>     if (ecrt_master_activate(master)) {
>       fprintf(stderr,"activation failed.\n");
>       return -1;
>     }
>     printf("ok!\n");
> 
>     if (!(domain1_pd = ecrt_domain_data(domain1))) {
>       fprintf(stderr,"Domain data initialization failed.\n");
>       return -1;
>     }
>     printf("Domain data registered ok.\n");
> 
>     sc_dig_out = ecrt_master_slave_config(
>                             master, DigOutSlavePos, Beckhoff_EL2004);
> 
>     sc_dig_in = ecrt_master_slave_config(
>                         master, DigInSlavePos, Beckhoff_EL1014);

BTW, you should not add further slave configuration after calling
ecrt_master_activate(). They will not have any chance to participate on
process data exchange. But that's not the problem here.

>     check_master_state();
>     check_domain1_state();
> 
> #if 1
>     for (j=0;j<2;j++)
>       {
>         ecrt_master_receive(master);
>         ecrt_domain_process(domain1);
>         check_slave_config_states();
>         sleep(1);

You are sending one frame per second. The master state machine needs
many cycles to configure the whole bus, you're giving it no change to
configure the slaves (only 2 cycles). Moreover most slaves have a
process data watchdog of approx. 100 ms.

-- 
Best regards,
Florian Pose

http://etherlab.org



More information about the Etherlab-users mailing list