320 Figure~\ref{fig:arch} gives a general overview of the master architecture. |
320 Figure~\ref{fig:arch} gives a general overview of the master architecture. |
321 |
321 |
322 \begin{figure}[htbp] |
322 \begin{figure}[htbp] |
323 \centering |
323 \centering |
324 \includegraphics[width=.9\textwidth]{images/architecture} |
324 \includegraphics[width=.9\textwidth]{images/architecture} |
325 \caption{Master architecture} |
325 \caption{Master Architecture} |
326 \label{fig:arch} |
326 \label{fig:arch} |
327 \end{figure} |
327 \end{figure} |
328 |
328 |
329 \paragraph{Master Module} |
329 The components of the master environment are described below: |
330 \index{Master module} |
330 |
331 |
331 \begin{description} |
332 Kernel module containing one or more EtherCAT master instances (see |
332 |
333 sec.~\ref{sec:mastermod}), the ``Device Interface'' (see sec.~\ref{sec:ecdev}) |
333 \item[Master Module]\index{Master Module} Kernel module containing one or more |
334 and the ``Application Interface'' (see chap.~\ref{chap:api}). |
334 EtherCAT master instances (see sec.~\ref{sec:mastermod}), the ``Device |
335 |
335 Interface'' (see sec.~\ref{sec:ecdev}) and the ``Application Interface'' (see |
336 \paragraph{Device Modules} |
336 chap.~\ref{chap:api}). |
337 \index{Device modules} |
337 |
338 |
338 \item[Device Modules]\index{Device modules} EtherCAT-capable Ethernet device |
339 EtherCAT-capable Ethernet device driver modules\index{Device modules}, that |
339 driver modules\index{Device modules}, that offer their devices to the EtherCAT |
340 offer their devices to the EtherCAT master via the device interface (see |
340 master via the device interface (see sec.~\ref{sec:ecdev}). These modified |
341 sec.~\ref{sec:ecdev}). These modified network drivers can handle network |
341 network drivers can handle network devices used for EtherCAT operation and |
342 devices used for EtherCAT operation and ``normal'' Ethernet devices in |
342 ``normal'' Ethernet devices in parallel. A master can accept a certain device |
343 parallel. A master can accept a certain device and then is able to send and |
343 and then is able to send and receive EtherCAT frames. Ethernet devices |
344 receive EtherCAT frames. Ethernet devices declined by the master module are |
344 declined by the master module are connected to the kernel's network stack as |
345 connected to the kernel's network stack as usual. |
345 usual. |
346 |
346 |
347 \paragraph{Application Modules} |
347 \item[Application Modules]\index{Application} A kernel module that uses the |
348 \index{Application module} |
348 EtherCAT master (usually for cyclic exchange of process data with EtherCAT |
349 |
349 slaves). These modules are not part of the EtherCAT master |
350 Kernel modules, that use the EtherCAT master (usually for cyclic exchange of |
350 code\footnote{Although there are some examples provided in the |
351 process data with EtherCAT slaves). These modules are not part of the EtherCAT |
|
352 master code\footnote{Although there are some examples provided in the |
|
353 \textit{examples/} directory.}, but have to be generated or written by the |
351 \textit{examples/} directory.}, but have to be generated or written by the |
354 user. An application module can ``request'' a master through the application |
352 user. An application module can ``request'' a master through the application |
355 interface (see chap.~\ref{chap:api}). If this succeeds, the module has the |
353 interface (see chap.~\ref{chap:api}). If this succeeds, it has the control |
356 control over the master: It can provide a bus configuration and exchange |
354 over the master: It can provide a bus configuration and exchange process data. |
357 process data. |
355 |
|
356 \end{description} |
358 |
357 |
359 %------------------------------------------------------------------------------ |
358 %------------------------------------------------------------------------------ |
360 |
359 |
361 \section{Phases} |
360 \section{Phases} |
362 \index{Master phases} |
361 \index{Master phases} |
582 \item[Configuration] The master is requested and the configuration is applied. |
582 \item[Configuration] The master is requested and the configuration is applied. |
583 Domains are created Slaves are configured and Pdo entries are registered (see |
583 Domains are created Slaves are configured and Pdo entries are registered (see |
584 sec.~\ref{sec:masterconfig}). |
584 sec.~\ref{sec:masterconfig}). |
585 |
585 |
586 \item[Operation] Cyclic code is run, process data is exchanged (see |
586 \item[Operation] Cyclic code is run, process data is exchanged (see |
587 sec.~\ref{sec:cyclic}). |
587 sec.~\ref{sec:cyclic}). To enter operation mode, the master has to be |
|
588 ``activated'' to calculate the process data image and apply the bus |
|
589 configuration for the first time. After activation, the application is in |
|
590 charge to send and receive frames. |
588 |
591 |
589 \end{description} |
592 \end{description} |
590 |
593 |
591 \paragraph{Example Applications} \index{Example Applications} There are a few |
594 \paragraph{Example Applications} \index{Example Applications} There are a few |
592 example applications in the \textit{examples/} subdirectory of the master |
595 example applications in the \textit{examples/} subdirectory of the master |
628 sec.~\ref{sec:eoe}). For this reason, the master is a shared resource, and |
631 sec.~\ref{sec:eoe}). For this reason, the master is a shared resource, and |
629 access to it has to be sequentialized. This is usually done by locking with |
632 access to it has to be sequentialized. This is usually done by locking with |
630 semaphores, or other methods to protect critical sections. |
633 semaphores, or other methods to protect critical sections. |
631 |
634 |
632 The master itself can not provide locking mechanisms, because it has no chance |
635 The master itself can not provide locking mechanisms, because it has no chance |
633 to know the appropriate kind of lock. For example if the application uses RTAI |
636 to know the appropriate kind of lock. For example if the application module |
634 functionality, ordinary kernel semaphores would not be sufficient. For that, an |
637 uses RTAI functionality, ordinary kernel semaphores would not be sufficient. |
635 important design decision was made: The application that reserved a master must |
638 For that, an important design decision was made: The application that reserved |
636 have the total control, therefore it has to take responsibility for providing |
639 a master must have the total control, therefore it has to take responsibility |
637 the appropriate locking mechanisms. If another instance wants to access the |
640 for providing the appropriate locking mechanisms. If another instance wants |
638 master, it has to request the master lock by callbacks, that have to be set by |
641 to access the master, it has to request the master lock by callbacks, that |
639 the application. Moreover the application can deny access to the master if it |
642 have to be set by the application. Moreover the application can deny access to |
640 considers it to be awkward at the moment. |
643 the master if it considers it to be awkward at the moment. |
641 |
644 |
642 \begin{figure}[htbp] |
645 \begin{figure}[htbp] |
643 \centering |
646 \centering |
644 \includegraphics[width=.6\textwidth]{images/master-locks} |
647 \includegraphics[width=.6\textwidth]{images/master-locks} |
645 \caption{Concurrent master access} |
648 \caption{Concurrent master access} |