4298 |
4298 |
4299 \section{Compiling and Installing} |
4299 \section{Compiling and Installing} |
4300 \label{sec:make} |
4300 \label{sec:make} |
4301 \index{Master!Compilation} |
4301 \index{Master!Compilation} |
4302 |
4302 |
4303 The current EtherCAT master code is available at~\cite{etherlab}. |
4303 The current EtherCAT master code is available at~\cite{etherlab} or |
4304 After downloading the \textit{tar.bz2} file, it has to be unpacked |
4304 can be obtained from the EtherLab\textsuperscript{\textregistered} CD. |
4305 with the command below (or similar): |
4305 The \textit{tar.bz2} file has to be unpacked with the command below |
|
4306 (or similar): |
4306 |
4307 |
4307 \begin{lstlisting} |
4308 \begin{lstlisting} |
4308 host> `\textbf{tar xjf ethercat-1.1-rXXX.tar.bz2}` |
4309 host> `\textbf{tar xjf ethercat-1.1-rXXX.tar.bz2}` |
4309 host> `\textbf{cd ethercat-1.1-rXXX/}` |
4310 host> `\textbf{cd ethercat-1.1-rXXX/}` |
4310 \end{lstlisting} |
4311 \end{lstlisting} |
4338 |
4339 |
4339 \begin{lstlisting} |
4340 \begin{lstlisting} |
4340 host# `\textbf{make install}` |
4341 host# `\textbf{make install}` |
4341 \end{lstlisting} |
4342 \end{lstlisting} |
4342 |
4343 |
4343 If the EtherCAT master shall be run as a service (recommended), the |
4344 If the EtherCAT master shall be run as a service |
4344 init script and the sysconfig file have to be copied to the |
4345 (recommended\footnote{Even if the EtherCAT master shall not be loaded |
4345 appropriate locations. The below example is suitable for SUSE Linux. |
4346 on system startup, the use of the init script is recommended for |
4346 It may vary for other distributions. |
4347 manual (un-)loading.}), the init script and the sysconfig file have |
|
4348 to be copied to the appropriate locations. The below example is |
|
4349 suitable for SUSE Linux. It may vary for other distributions. |
4347 |
4350 |
4348 \begin{lstlisting} |
4351 \begin{lstlisting} |
4349 host# `\textbf{cd /opt/etherlab}` |
4352 host# `\textbf{cd /opt/etherlab}` |
4350 host# `\textbf{cp etc/sysconfig/ethercat /etc/sysconfig/}` |
4353 host# `\textbf{cp etc/sysconfig/ethercat /etc/sysconfig/}` |
4351 host# `\textbf{cp etc/init.d/ethercat /etc/init.d/}` |
4354 host# `\textbf{cp etc/init.d/ethercat /etc/init.d/}` |
4352 host# `\textbf{insserv ethercat}` |
4355 host# `\textbf{insserv ethercat}` |
4353 \end{lstlisting} |
4356 \end{lstlisting} |
4354 |
4357 |
4355 Now the sysconfig file has to be customized. For the contents of the |
4358 Now the sysconfig file \texttt{/etc/sysconfig/ethercat} (see |
4356 file, see section~\ref{sec:sysconfig}. To give a short summary: The |
4359 section~\ref{sec:sysconfig}) has to be customized: This is mainly done |
4357 most important thing is to adjust the \textit{DEVICE\_INDEX} variable. |
4360 by uncommenting and adjusting the \textit{DEVICE\_INDEX} variable. It |
4358 It has to be set to the index of the compatible network device to use |
4361 has to be set to the index of the compatible network device to use |
4359 with EtherCAT, where the order of devices is dependent on their |
4362 with EtherCAT, where the order of devices is dependent on their |
4360 position in the PCI bus. If this is not known, the index can be |
4363 position in the PCI bus: |
4361 determinded with trial and error, but it has to be considered that a |
4364 |
4362 wrong value can cause a loss of network connection. |
4365 \begin{lstlisting}[numbers=left,basicstyle=\ttfamily\scriptsize] |
|
4366 host# `\textbf{lspci}` |
|
4367 00:00.0 Host bridge: VIA Technologies, Inc. VT8363/8365 [KT133/KM133] (rev 03) |
|
4368 00:01.0 PCI bridge: VIA Technologies, Inc. VT8363/8365 [KT133/KM133 AGP] |
|
4369 00:04.0 ISA bridge: VIA Technologies, Inc. VT82C686 [Apollo Super South] (rev 40) |
|
4370 00:04.1 IDE interface: VIA Technologies, Inc. VT82C586A/B/VT82C686/A/B/VT823x/A/C... |
|
4371 00:04.2 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller... |
|
4372 00:04.3 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller... |
|
4373 00:04.4 Bridge: VIA Technologies, Inc. VT82C686 [Apollo Super ACPI] (rev 40) |
|
4374 00:09.0 Ethernet controller: D-Link System Inc RTL8139 Ethernet (rev 10) |
|
4375 00:0a.0 Ethernet controller: Intel Corporation 82557/8/9 [Ethernet Pro 100] (rev 08) |
|
4376 00:0b.0 Ethernet controller: D-Link System Inc RTL8139 Ethernet (rev 10) |
|
4377 00:0c.0 VGA compatible controller: ATI Technologies Inc Rage XL (rev 27) |
|
4378 00:11.0 Unknown mass storage controller: Promise Technology, Inc. PDC20265... |
|
4379 \end{lstlisting} |
|
4380 |
|
4381 In the above output of the \textit{lspci} command, two compatible |
|
4382 network devices can be found in lines~\textcircled{\tiny 9} and |
|
4383 \textcircled{\tiny 11}. The \textit{DEVICE\_INDEX} variable should be |
|
4384 set to $0$ or $1$, respectively. |
4363 |
4385 |
4364 After the basic configuration is done, the master can be started with |
4386 After the basic configuration is done, the master can be started with |
4365 the below command: |
4387 the below command: |
4366 |
4388 |
4367 \begin{lstlisting} |
4389 \begin{lstlisting} |