2105 |
2105 |
2106 \lstinputlisting[basicstyle=\ttfamily\footnotesize]{external/ethercat_domains} |
2106 \lstinputlisting[basicstyle=\ttfamily\footnotesize]{external/ethercat_domains} |
2107 |
2107 |
2108 %------------------------------------------------------------------------------ |
2108 %------------------------------------------------------------------------------ |
2109 |
2109 |
|
2110 \subsection{SDO Access} |
|
2111 |
|
2112 \lstinputlisting[basicstyle=\ttfamily\footnotesize]{external/ethercat_download} |
|
2113 |
|
2114 \lstinputlisting[basicstyle=\ttfamily\footnotesize]{external/ethercat_upload} |
|
2115 |
|
2116 %------------------------------------------------------------------------------ |
|
2117 |
|
2118 \subsection{File-Access over EtherCAT} |
|
2119 |
|
2120 \lstinputlisting[basicstyle=\ttfamily\footnotesize]{external/ethercat_foe_read} |
|
2121 |
|
2122 \lstinputlisting[basicstyle=\ttfamily\footnotesize]{external/ethercat_foe_write} |
|
2123 |
|
2124 %------------------------------------------------------------------------------ |
|
2125 |
|
2126 \subsection{Creating Topology Graphs} |
|
2127 |
|
2128 \lstinputlisting[basicstyle=\ttfamily\footnotesize]{external/ethercat_graph} |
|
2129 |
|
2130 %------------------------------------------------------------------------------ |
|
2131 |
2110 \subsection{Master and Ethernet Devices} |
2132 \subsection{Master and Ethernet Devices} |
2111 |
2133 |
2112 \lstinputlisting[basicstyle=\ttfamily\footnotesize]{external/ethercat_master} |
2134 \lstinputlisting[basicstyle=\ttfamily\footnotesize]{external/ethercat_master} |
2113 |
2135 |
2114 %------------------------------------------------------------------------------ |
2136 %------------------------------------------------------------------------------ |
2117 |
2139 |
2118 \lstinputlisting[basicstyle=\ttfamily\footnotesize]{external/ethercat_pdos} |
2140 \lstinputlisting[basicstyle=\ttfamily\footnotesize]{external/ethercat_pdos} |
2119 |
2141 |
2120 %------------------------------------------------------------------------------ |
2142 %------------------------------------------------------------------------------ |
2121 |
2143 |
|
2144 \subsection{Register Access} |
|
2145 |
|
2146 \lstinputlisting[basicstyle=\ttfamily\footnotesize]{external/ethercat_reg_read} |
|
2147 |
|
2148 \lstinputlisting[basicstyle=\ttfamily\footnotesize]{external/ethercat_reg_write} |
|
2149 |
|
2150 %------------------------------------------------------------------------------ |
|
2151 |
2122 \subsection{SDO Dictionary} |
2152 \subsection{SDO Dictionary} |
2123 |
2153 |
2124 \lstinputlisting[basicstyle=\ttfamily\footnotesize]{external/ethercat_sdos} |
2154 \lstinputlisting[basicstyle=\ttfamily\footnotesize]{external/ethercat_sdos} |
2125 |
2155 |
2126 %------------------------------------------------------------------------------ |
2156 %------------------------------------------------------------------------------ |
2127 |
2157 |
2128 \subsection{SDO Access} |
2158 \subsection{SII Access} |
2129 |
2159 \label{sec:siiaccess} |
2130 \lstinputlisting[basicstyle=\ttfamily\footnotesize]{external/ethercat_download} |
2160 \index{SII!Access} |
2131 |
2161 |
2132 \lstinputlisting[basicstyle=\ttfamily\footnotesize]{external/ethercat_upload} |
2162 It is possible to directly read or write the complete SII contents of the |
|
2163 slaves. This was introduced for the reasons below: |
|
2164 |
|
2165 \begin{itemize} |
|
2166 |
|
2167 \item The format of the SII data is still in development and categories can be |
|
2168 added in the future. With read and write access, the complete memory contents |
|
2169 can be easily backed up and restored. |
|
2170 |
|
2171 \item Some SII data fields have to be altered (like the alias address). A quick |
|
2172 writing must be possible for that. |
|
2173 |
|
2174 \item Through reading access, analyzing category data is possible from |
|
2175 userspace. |
|
2176 |
|
2177 \end{itemize} |
|
2178 |
|
2179 \lstinputlisting[basicstyle=\ttfamily\footnotesize]{external/ethercat_sii_read} |
|
2180 |
|
2181 Reading out SII data is as easy as other commands. Though the data are in |
|
2182 binary format, analysis is easier with a tool like \textit{hexdump}: |
|
2183 |
|
2184 \begin{lstlisting} |
|
2185 $ `\textbf{ethercat sii\_read --position 3 | hexdump}` |
|
2186 0000000 0103 0000 0000 0000 0000 0000 0000 008c |
|
2187 0000010 0002 0000 3052 07f0 0000 0000 0000 0000 |
|
2188 0000020 0000 0000 0000 0000 0000 0000 0000 0000 |
|
2189 ... |
|
2190 \end{lstlisting} |
|
2191 |
|
2192 Backing up SII contents can easily done with a redirection: |
|
2193 |
|
2194 \begin{lstlisting} |
|
2195 $ `\textbf{ethercat sii\_read --position 3 > sii-of-slave3.bin}` |
|
2196 \end{lstlisting} |
|
2197 |
|
2198 To download SII contents to a slave, writing access to the master's character |
|
2199 device is necessary (see sec.~\ref{sec:cdev}). |
|
2200 |
|
2201 \lstinputlisting[basicstyle=\ttfamily\footnotesize]{external/ethercat_sii_write} |
|
2202 |
|
2203 \begin{lstlisting} |
|
2204 # `\textbf{ethercat sii\_write --position 3 sii-of-slave3.bin}` |
|
2205 \end{lstlisting} |
|
2206 |
|
2207 The SII contents will be checked for validity and then sent to the slave. The |
|
2208 write operation may take a few seconds. |
2133 |
2209 |
2134 %------------------------------------------------------------------------------ |
2210 %------------------------------------------------------------------------------ |
2135 |
2211 |
2136 \subsection{Slaves on the Bus} |
2212 \subsection{Slaves on the Bus} |
2137 |
2213 |
2149 3 5555:2 PREOP + EL2004 4K. Dig. Ausgang 24V, 0,5A |
2225 3 5555:2 PREOP + EL2004 4K. Dig. Ausgang 24V, 0,5A |
2150 \end{lstlisting} |
2226 \end{lstlisting} |
2151 |
2227 |
2152 %------------------------------------------------------------------------------ |
2228 %------------------------------------------------------------------------------ |
2153 |
2229 |
2154 \subsection{SII Access} |
|
2155 \label{sec:siiaccess} |
|
2156 \index{SII!Access} |
|
2157 |
|
2158 It is possible to directly read or write the complete SII contents of the |
|
2159 slaves. This was introduced for the reasons below: |
|
2160 |
|
2161 \begin{itemize} |
|
2162 |
|
2163 \item The format of the SII data is still in development and categories can be |
|
2164 added in the future. With read and write access, the complete memory contents |
|
2165 can be easily backed up and restored. |
|
2166 |
|
2167 \item Some SII data fields have to be altered (like the alias address). A quick |
|
2168 writing must be possible for that. |
|
2169 |
|
2170 \item Through reading access, analyzing category data is possible from |
|
2171 userspace. |
|
2172 |
|
2173 \end{itemize} |
|
2174 |
|
2175 \lstinputlisting[basicstyle=\ttfamily\footnotesize]{external/ethercat_sii_read} |
|
2176 |
|
2177 Reading out SII data is as easy as other commands. Though the data are in |
|
2178 binary format, analysis is easier with a tool like \textit{hexdump}: |
|
2179 |
|
2180 \begin{lstlisting} |
|
2181 $ `\textbf{ethercat sii\_read --position 3 | hexdump}` |
|
2182 0000000 0103 0000 0000 0000 0000 0000 0000 008c |
|
2183 0000010 0002 0000 3052 07f0 0000 0000 0000 0000 |
|
2184 0000020 0000 0000 0000 0000 0000 0000 0000 0000 |
|
2185 ... |
|
2186 \end{lstlisting} |
|
2187 |
|
2188 Backing up SII contents can easily done with a redirection: |
|
2189 |
|
2190 \begin{lstlisting} |
|
2191 $ `\textbf{ethercat sii\_read --position 3 > sii-of-slave3.bin}` |
|
2192 \end{lstlisting} |
|
2193 |
|
2194 To download SII contents to a slave, writing access to the master's character |
|
2195 device is necessary (see sec.~\ref{sec:cdev}). |
|
2196 |
|
2197 \lstinputlisting[basicstyle=\ttfamily\footnotesize]{external/ethercat_sii_write} |
|
2198 |
|
2199 \begin{lstlisting} |
|
2200 # `\textbf{ethercat sii\_write --position 3 sii-of-slave3.bin}` |
|
2201 \end{lstlisting} |
|
2202 |
|
2203 The SII contents will be checked for validity and then sent to the slave. The |
|
2204 write operation may take a few seconds. |
|
2205 |
|
2206 %------------------------------------------------------------------------------ |
|
2207 |
|
2208 \subsection{Requesting Application-Layer States} |
2230 \subsection{Requesting Application-Layer States} |
2209 |
2231 |
2210 \lstinputlisting[basicstyle=\ttfamily\footnotesize]{external/ethercat_states} |
2232 \lstinputlisting[basicstyle=\ttfamily\footnotesize]{external/ethercat_states} |
|
2233 |
|
2234 %------------------------------------------------------------------------------ |
|
2235 |
|
2236 \subsection{Displaying the Master Version} |
|
2237 |
|
2238 \lstinputlisting[basicstyle=\ttfamily\footnotesize]{external/ethercat_version} |
2211 |
2239 |
2212 %------------------------------------------------------------------------------ |
2240 %------------------------------------------------------------------------------ |
2213 |
2241 |
2214 \subsection{Generating Slave Description XML} |
2242 \subsection{Generating Slave Description XML} |
2215 |
2243 |