[etherlab-users] Accessing the EtherCAT master from 2 tasks
Richard Hacker
ha at igh.de
Fri Nov 15 11:09:52 CET 2013
Each board, and I presume each one is a master, can be accessed by a
separate process. They are identified by ecrt_request_master(0) and
ecrt_request_master(1). The masters run autonomously so you will not
have adverse effects using 2 masters in 2 processes, you don't even need
locking.
Using domains having different sample times from the same master is
another case. Then you will need to do threading as well as locking when
accessing the domain queue, i.e. when using ecrt_domain_process() and
ecrt_domain_queue().
Am 11/14/2013 02:36 PM, schrieb Jürgen Kunz:
> Hello Aiser,
>
> you can do this in one process with different threads. One of your
> thread, maybe your main thread, calls ecrt_request_master(). You
> register each EtherCAT board in a separate domain. Then you are able to
> access the different boards individually through the different domains.
> The only thing you have to consider is that every time you call the
> master with one thread, you need to lock it with a global mutex, so that
> it cannot be accessed the same time by different threads.
>
> Best regards,
> Jürgen
>
> Am 14.11.2013 13:37, schrieb Asier Tamayo:
>>
>> Hello all,
>>
>> I’m a new user to the EtherCAT Master, so I beg your pardon if this
>> question has already been answered or it is a RT*M type question. I’m
>> using the master with Xenomai.
>>
>> I want to access EtherCAT from two different tasks, each one accessing
>> to different EtherCAT boards. Is there any way I can do it? The
>> ecrt_request_master() function reserves the EtherCAT master for
>> exclusive use, and therefore I can’t call it again from the second
>> task. Do I have to create a Xenomai RTDM driver that would reserve the
>> master for itself and then let the tasks execute ioctl’s to that
>> driver? Is it possible?
>>
>> Best regards,
>>
>> Asier
>>
>>
>>
>> _______________________________________________
>> etherlab-users mailing list
>> etherlab-users at etherlab.org
>> http://lists.etherlab.org/mailman/listinfo/etherlab-users
>
> --
> Dipl.-Inform. Jürgen Kunz
>
> Technische Universität Darmstadt <http://www.tu-darmstadt.de>
> FG Simulation, Systemoptimierung und Robotik
> <http://www.sim.tu-darmstadt.de>
> Hochschulstr. 10
> 64289 Darmstadt
>
> Tel.: ++49 (0) 6151-16-70383
> Fax: ++49 (0) 6151-16-6648
> E-Mail: kunz(at)sim.tu-darmstadt.de
> Homepage: http://www.sim.tu-darmstadt.de
>
>
> _______________________________________________
> 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