[etherlab-users] problems with data exchange to slaves

dclark at mmto.org dclark at mmto.org
Sat Mar 27 00:25:36 CET 2010


Hello Florian,

Saw the post on vma fault...I had just mentioned it since it concerned me.
If you're not worried, nether am I... ;)

As to re-organizing the code as you suggest, it works fine now! I added
some diagnostics to count how many cycles it takes for the slaves to go to
OP, and it looks like somewhere between 25 and 100, depending on how fast
you run the transactions, which is something I can easily live with by
guarding my application from trying to do things until all slaves are
detected in OP.

I attach my test app for anyone else on the list who might find it useful.

Thanks again for your help!

Regards,

Dusty Clark
MMT Observatory
University of Arizona


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


-- 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: demo1.c
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20100326/7a9cffbd/attachment-0003.c>


More information about the Etherlab-users mailing list