2203 EtherCAT buses can always be monitored by inserting a switch between master |
2203 EtherCAT buses can always be monitored by inserting a switch between master |
2204 and slaves. This allows to connect another PC with a network monitor like |
2204 and slaves. This allows to connect another PC with a network monitor like |
2205 Wireshark~\cite{wireshark}, for example. |
2205 Wireshark~\cite{wireshark}, for example. |
2206 |
2206 |
2207 For convenience, so-called ``debug interfaces'' are supported. Debug |
2207 For convenience, so-called ``debug interfaces'' are supported. Debug |
2208 interfaces allow to monitor EtherCAT traffic with a network monitor (like |
2208 interfaces are virtual network interfaces allowing to capture EtherCAT traffic |
2209 Wireshark or tcpdump) running on the master machine without using external |
2209 with a network monitor (like Wireshark or tcpdump) running on the master |
2210 hardware. To use this functionality, the master sources have to be configured |
2210 machine without using external hardware. To use this functionality, the master |
2211 with the \lstinline+--enable-debug-if+ switch (see |
2211 sources have to be configured with the \lstinline+--enable-debug-if+ switch |
2212 sec.~\ref{sec:installation}). |
2212 (see sec.~\ref{sec:installation}). |
2213 |
2213 |
2214 Every EtherCAT master registers two read-only network interfaces. These are |
2214 Every EtherCAT master registers two read-only network interfaces, |
|
2215 corresponding to the physical Ethernet devices. These are |
2215 named \textit{ecdbgmX} (main device) and \textit{ecdbgbX} (backup device, for |
2216 named \textit{ecdbgmX} (main device) and \textit{ecdbgbX} (backup device, for |
2216 future use), where X is the master index. The below listing shows debug |
2217 future use), where X is the master index. The below listing shows debug |
2217 interface among some standard interfaces: |
2218 interfaces among some standard network interfaces: |
2218 |
2219 |
2219 \begin{lstlisting} |
2220 \begin{lstlisting} |
2220 # `\textbf{ip link}` |
2221 # `\textbf{ip link}` |
2221 1: lo: <LOOPBACK,UP> mtu 16436 qdisc noqueue |
2222 1: lo: <LOOPBACK,UP> mtu 16436 qdisc noqueue |
2222 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 |
2223 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 |
2223 4: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000 |
2224 4: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000 |
2224 link/ether 00:04:61:03:d1:01 brd ff:ff:ff:ff:ff:ff |
2225 link/ether 00:04:61:03:d1:01 brd ff:ff:ff:ff:ff:ff |
2225 8: ecdbgm0: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast |
2226 8: ecdbgm0: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast |
2226 qlen 1000 |
2227 qlen 1000 |
2227 link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff |
2228 link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff |
2228 9: ecdbgb0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000 |
2229 9: ecdbgb0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000 |
2229 link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff |
2230 link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff |
2230 \end{lstlisting} |
2231 \end{lstlisting} |
2231 |
2232 |
2232 While a debug interface is enabled, all frames sent or received to or from the |
2233 While a debug interface is enabled, all frames sent or received to or from the |
2233 physical device are additionally forwarded to the debug interface by the |
2234 physical device are additionally forwarded to the debug interface by the |
2234 corresponding master. Interfaces can be enabled with the below command: |
2235 corresponding master. Network interfaces can be enabled with the below |
|
2236 command: |
2235 |
2237 |
2236 \begin{lstlisting} |
2238 \begin{lstlisting} |
2237 # `\textbf{ip link set dev ecdbgm0 up}` |
2239 # `\textbf{ip link set dev ecdbgm0 up}` |
2238 \end{lstlisting} |
2240 \end{lstlisting} |
2239 |
2241 |
2240 Please note, that the frame rate can be very high. With an application |
2242 Please note, that the frame rate can be very high. With an application |
2241 connected, the debug interface can produce thousands of frames per second. |
2243 connected, the debug interface can produce thousands of frames per second. |
2242 |
2244 |
2243 \paragraph{Attention} The socket buffers needed for the operation of the |
2245 \paragraph{Attention} The socket buffers needed for the operation of debug |
2244 debugging interface have to be allocated dynamically. Some Linux realtime |
2246 interfaces have to be allocated dynamically. Some Linux realtime extensions do |
2245 extensions do not allow this in realtime context! |
2247 not allow this in realtime context! |
2246 |
2248 |
2247 %------------------------------------------------------------------------------ |
2249 %------------------------------------------------------------------------------ |
2248 |
2250 |
2249 \chapter{Timing Aspects} |
2251 \chapter{Timing Aspects} |
2250 \label{sec:timing} |
2252 \label{sec:timing} |