]> 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 f5f98b1f9ec9b31cf5ba1f205983bc5dc9a63fed..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
@@ -200,9 +203,11 @@ Simplified directory structure.
 ./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)
@@ -229,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}
@@ -242,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.\\
 
 
 
@@ -358,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.
 
@@ -377,21 +376,15 @@ 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.
 
@@ -400,34 +393,42 @@ 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 or Rtai.
+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.
@@ -451,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}
@@ -1001,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}