]> rtime.felk.cvut.cz Git - CanFestival-3.git/blobdiff - doc/manual/en/manual.tex
FastScan review
[CanFestival-3.git] / doc / manual / en / manual.tex
index 5bd7434a47b591f432009e20e62140e27f1c1dfe..f35822eebca1c11564e5c2adf680a2ff27b3fc55 100644 (file)
@@ -122,6 +122,10 @@ Supported features should conform to DS301. V.4.02 13 february 2002.
 
 Only concise DFC is supported.
 
+\subsubsection{DS-305}
+
+LSS services are fully supported although they have to be enabled at compile time. Additionally, FastScan LSS service is also optionally enabled. 
+
 \section{How to start}
 
 \subsection{Host requirements}
@@ -153,9 +157,10 @@ context sensitive help.
 \subsubsection{Windows (for native win32 target)}
 
 \begin{enumerate}
-\item Visual Studio Express 2005 or worst. 
-\item Microsoft platform SDK (requires Genuine Advantage) 
-\item Cygwin (for configuration only) 
+\item Visual Studio Express 2005 or worst.
+\item Microsoft platform SDK (requires Genuine Advantage)
+\item Cygwin (for configuration only)
+\item MinGW/MSYS
 \end{enumerate}
 
 \subsection{How to get CanFestival}
@@ -181,9 +186,7 @@ Then, enter :
 \section{Understanding Canfestival}
 
 \subsection{CanFestival Project tree layout}
-
 Simplified directory structure.
-
 \begin{verbatim}
 ./src ANSI-C source of \canopen stack
 ./include Exportables Header files
@@ -191,16 +194,20 @@ Simplified directory structure.
 ./drivers/unix Linux and Cygwin OS interface
 ./drivers/win32 Native Win32 OS interface
 ./drivers/timers_xeno Xenomai timers/threads (Linux only)
+./drivers/timers_rtai Rtai timers/threads (Linux only)
 ./drivers/timers_kernel Linux kernel timer/threads
 ./drivers/timers_unix Posix timers/threads (Linux, Cygwin)
 ./drivers/can_virtual_kernel Fake CAN network (kernel space)
+./drivers/can_serial Serial point to point and PTY hub (*nix only)
 ./drivers/can_peak_linux PeakSystem CAN library interface
 ./drivers/can_peak_win32 PeakSystem PCAN-Light interface
 ./drivers/can_uvccm_win32 Acacetus's RS232 CAN-uVCCM interface
 ./drivers/can_virtual Fake CAN network (Linux, Cygwin)
+./drivers/can_vcom VScom VSCAN interface
 ./drivers/hcs12 HCS12 full target interface
 ./examples Examples
 ./examples/TestMasterSlave 2 nodes, NMT SYNC SDO PDO, win32+unix
+./examples/TestMasterSlaveLSS 3 nodes, NMT SYNC SDO PDO LSS, win32+unix
 ./examples/TestMasterMicroMod 1 node, control Peak I/O Module, unix
 ./examples/gene_SYNC_HCS12 Just send periodic SYNC on HCS12
 ./examples/win32test Ask some DS301 infos to a node (win32)
@@ -227,7 +234,7 @@ Simplified directory structure.
 Because most CAN controllers and drivers implement FIFOs, CanFestival
 consider sending message as a non blocking operation.
 
-In order to prevent reentrent calls to the stack, messages reception
+In order to prevent reentrant calls to the stack, messages reception
 is implemented differently on {\textmu}C and OS.:
 
 \begin{enumerate}
@@ -240,7 +247,7 @@ is implemented differently on {\textmu}C and OS.:
 \par\end{center}
 
 \item OS must provide a receive thread, a timer thread and a mutex. CAN
-reception should be a bloking operation.\\
+reception should be a blocking operation.\\
 
 
 
@@ -327,17 +334,19 @@ installed.
 
 \subsubsection{Real -Time Linux node}
 
-
+With Xenomai :
 \begin{verbatim}
        ./configure --timers=xeno
 \end{verbatim}
-
-
+With Rtai :
+\begin{verbatim}
+       ./configure --timers=rtai
+\end{verbatim}
 
 To do a \canopen node running on PC -Linux, you need :
 
 \begin{enumerate}
-\item A working Linux distribution patched with XENOMAI 2.1 or greater
+\item A working Linux distribution patched with XENOMAI (2.1 or greater) or RTAI (3.6)
 \item One or more Peak system PC CAN interface and the last Peak Real Time
 Linux driver installed. 
 \end{enumerate}
@@ -354,18 +363,12 @@ To do a CANopen node running on PC-Linux in kernel space, you need:
 
 
 \subsubsection{CAN devices}
-
 Currently supported CAN devices and corresponding configure switch:
 
-
 \paragraph{Peak systems}
-
-
 \begin{verbatim}
        ./configure --can=peak_linux
 \end{verbatim}
-
-
 PeakSystems CAN interface is automatically chosen as default CAN interface
 if libpcan is present in the system.
 
@@ -373,42 +376,59 @@ Please download driver at \href{http://www.peak-system.com/linux}{http://www.pea
 -system.com/linux} and follow instructions in order to install driver
 on your system.
 
-
-\paragraph{Socket -Can (http://socketcan.berlios.de)}
-
-
+\paragraph{Socket-Can (http://socketcan.berlios.de)}
 \begin{verbatim}
        ./configure --can=socket
 \end{verbatim}
 
+\paragraph{Serial}
+\begin{verbatim}
+       ./configure --can=serial
+\end{verbatim}
+The CAN serial driver implements a 1:1 serial connection between 2 CAN devices.
+For example, you can connect 2 CANFestival applications via a NULL modem cable.
 
-\paragraph{LinCan}
-
+Also with this driver comes a software hub, for up to 16 CANFestival apps to 
+be connected on a single PC, with an optional connection to another CAN driver.
+Note that only the serial driver is supported at this time.  The hub uses ptys 
+(pseudo ttys) available on a *nix like system.
 
+\paragraph{LinCan}
 \begin{verbatim}
        ./configure --can=lincan
 \end{verbatim}
 
-
 \paragraph{Virtual CAN interfaces (for test/debug)}
-
-
 \begin{verbatim}
        ./configure --can=virtual
                or, for kernel space:
        ./configure --can=kernel_virtual
 \end{verbatim}
-
-
 Virtual CAN interface use Unix pipes to emulate a virtual CAN network.
 Each message issued from a node is repeat to all other nodes. Currently
 only works with nodes running in the same process, and does not support
-work with Xenomai.
+work with Xenomai or RTAI.
+
+\paragraph{VScom}
+\begin{verbatim}
+       ./configure --can=vscom
+\end{verbatim}
+The VSCAN API archive will be automatically downloaded and decompressed (unzip required). See \href{http://www.vscom.de/1_1_05.htm}{www.vscom.de} for available adapters.
+
+\subsubsection{LSS services}
+Canfestival optionally supports LSS services but they must be enabled.
+\begin{verbatim}
+       ./configure --enable-lss
+\end{verbatim}
 
+Additionally, the FastScan LSS service can also be enabled.
+\begin{verbatim}
+       ./configure --enable-lss --enable-lss-fs
+\end{verbatim}
 
 \subsection{Testing your CanFestival installation}
 
-\subsection{User space}
+\subsubsection{User space}
 
 Sample provided in /example/TestMasterSlave is installed into your
 system during installation.
@@ -432,8 +452,9 @@ CAN ports. Another example using Peak{\textquotesingle}s dual PCMCIA
        TestMasterSlave -l libcanfestival_can_peak.so -s 40 -m 41
 \end{verbatim}
 
+If the LSS services are enabled the sample provided in /example/TestMasterSlaveLSS will be also installed. It behaves the same as TestMasterSlave except that there are 2 slave nodes without a valid nodeID so the the initializations is done via  the LSS services. If FastScan optional service is enabled the example will use it. 
 
-\subsection{Kernel space}
+\subsubsection{Kernel space}
 
 
 \begin{verbatim}
@@ -982,6 +1003,63 @@ console it'll remove modules from kernel.
   **************************************************************
 \end{verbatim}
 
+\subsection{TestMasterSlaveLSS}
+
+
+\begin{verbatim}
+**************************************************************
+*  TestMasterSlaveLSS                                        *
+*                                                            *
+*  A LSS example for PC. It does implement 3 CanOpen         *
+*  nodes in the same process. A master and 2 slaves. All     *
+*  communicate together, exchanging periodically NMT, SYNC,  *
+*  SDO and PDO. Master configure heartbeat producer time     *
+*  at 1000 ms for the slaves by concise DCF.                 *
+*                                                            *
+*   Usage:                                                   *
+*   ./TestMasterSlaveLSS  [OPTIONS]                          *
+*                                                            *
+*   OPTIONS:                                                 *
+*     -l : Can library ["libcanfestival_can_virtual.so"]     *
+*                                                            *
+*    SlaveA:                                                 *
+*     -a : bus name ["0"]                                    *
+*     -A : 1M,500K,250K,125K,100K,50K,20K,10K,none(disable)  *
+*                                                            *
+*    SlaveB:                                                 *
+*     -b : bus name ["1"]                                    *
+*     -B : 1M,500K,250K,125K,100K,50K,20K,10K,none(disable)  *
+*                                                            *
+*    Master:                                                 *
+*     -m : bus name ["2"]                                    *
+*     -M : 1M,500K,250K,125K,100K,50K,20K,10K,none(disable)  *
+*                                                            *
+**************************************************************
+\end{verbatim}
+
+The function used to request LSS services is \textit{configNetworkNode}. It works similar to \textit{writeNetworkDict} and its model is the following:
+\begin{verbatim}
+UNS8 configNetworkNode (CO_Data* d, UNS8 command, void *dat1, void* dat2, 
+LSSCallback_t Callback)
+\end{verbatim}
+
+\subsection{FastScan}
+FastScan is a special LSS service that allow the dynamically identification of the slave nodes even if they do not have a valid nodeID. This identification is based on the LSS address, composed by vendor ID, product code, revision number and serial number (refer to the DS305 for more information). The LSS address can be partially known or fully unknown. To represent this fact in Canfestival, we use the structure \textit{lss\_fs\_transfer\_t}. The parameter \textit{FS\_LSS\_ID} is an array of four elements which represents the four elements of the LSS address. The other parameter, \textit{FS\_BitChecked}, is also an array and it represents how many bits of each LSS address element are UNKNOWN. The next example is taken from \textit{TestMasterSlaveLSS}, where only the last two digits (8 bits) of vendor ID and product code are unknown and revision number and serial number are totally unknown. 
+
+\begin{verbatim}
+lss_fs_transfer_t lss_fs;
+/* The VendorID and ProductCode are partialy known, */
+/* except the last two digits (8 bits). */
+lss_fs.FS_LSS_ID[0]=Vendor_ID;
+lss_fs.FS_BitChecked[0]=8;
+lss_fs.FS_LSS_ID[1]=Product_Code;
+lss_fs.FS_BitChecked[1]=8;
+/* serialNumber and RevisionNumber are unknown, */
+/* i.e. the 8 digits (32bits) are unknown. */
+lss_fs.FS_BitChecked[2]=32;
+lss_fs.FS_BitChecked[3]=32;
+res=configNetworkNode(&d,LSS_IDENT_FASTSCAN,&lss_fs,0,CheckLSSAndContinue);
+\end{verbatim}
 
 \section{Developing a new node}
 
@@ -1084,19 +1162,19 @@ sub -indexes.
 
 \subsubsection{New node}
 
-Edit your node name, ID and type. Choose your inherited specific profile.
+Edit your node name and type. Choose your inherited specific profile.
 
 \begin{center}
-\includegraphics[width=11cm]{Pictures/10000201000001CB0000015F4FC09B68
+\includegraphics[width=11cm]{Pictures/new_node
 \par\end{center}
 
 
 \subsubsection{Node info}
 
-Edit your node name, ID and type.
+Edit your node name and type.
 
 \begin{center}
-\includegraphics[width=7cm]{Pictures/10000201000001010000011DA724D25C
+\includegraphics[width=7cm]{Pictures/node_info
 \par\end{center}
 
 
@@ -1193,7 +1271,7 @@ Because \canopen layer is coded with C, put a compilation option
 about that.
 
 
-\subsubsection{How to fit the library to an other microcontrôler ?}
+\subsubsection{How to fit the library to an other microcontrler ?}
 
 First, be sure that you have at least 40K bytes of program memory,
 and about 2k of RAM.
@@ -1492,11 +1570,11 @@ We are using the stable RPM release 2.2 :
 \includegraphics[width=10cm]{Pictures/1000020100000258000000832C6FFAB4} 
 \par\end{center}
 
-Unité mixte de recherche INRETS -LCPC
+Unit mixte de recherche INRETS -LCPC
 
-sur les Interractions Véhicule -Infrastructure -Conducteur
+sur les Interractions Vhicule -Infrastructure -Conducteur
 
-14, route de la minière
+14, route de la minire
 
 78000 Versailles
 
@@ -1542,7 +1620,7 @@ Many thanks to the other contributors for their great work:
 
 Raphael ZULLIGER
 
-David DUMINY (sté A6R)
+David DUMINY (st A6R)
 
 Zakaria BELAMRI