objdictgen/config/objdict.xsl
changeset 395 1dad6ea260f2
parent 394 b8755668c9e2
child 396 a43910975547
equal deleted inserted replaced
394:b8755668c9e2 395:1dad6ea260f2
     1 <?xml version="1.0" encoding='ISO-8859-1' ?>
       
     2 <!--
       
     3 This file is part of CanFestival, a library implementing CanOpen Stack. 
       
     4 
       
     5 Copyright (C): Francis DUPIN
       
     6 
       
     7 See COPYING file for copyrights details.
       
     8 
       
     9 This library is free software; you can redistribute it and/or
       
    10 modify it under the terms of the GNU Lesser General Public
       
    11 License as published by the Free Software Foundation; either
       
    12 version 2.1 of the License, or (at your option) any later version.
       
    13 
       
    14 This library is distributed in the hope that it will be useful,
       
    15 but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
       
    17 Lesser General Public License for more details.
       
    18 
       
    19 You should have received a copy of the GNU Lesser General Public
       
    20 License along with this library; if not, write to the Free Software
       
    21 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
       
    22 -->
       
    23 
       
    24 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
       
    25   <xsl:output method="html" indent="yes"
       
    26               doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"/>
       
    27 
       
    28   <xsl:template match="node">
       
    29     <html>
       
    30       <head><title>CANOpen object dictionary Configuration</title>
       
    31       <style type="text/css">
       
    32          table {
       
    33 	  border: 1px solid #200088;
       
    34           
       
    35         }
       
    36 	  td {
       
    37 	  border: 1px solid #200088;
       
    38         }
       
    39 	
       
    40          h1 {
       
    41 	   background: #FFDD66;
       
    42 	   border: 3px solid #AA0000;
       
    43            margin: 2em;
       
    44            padding: 1em;
       
    45 	 }
       
    46 
       
    47          h2, h2.dico, h2.pdo {
       
    48 	   background: #5577FF;
       
    49 	   border: 1px solid #AA0000;
       
    50            margin: 1em;
       
    51 	 }
       
    52 
       
    53 	  .entree {
       
    54 	  color: #AA0000;
       
    55 	  }
       
    56          
       
    57 	  .title {
       
    58 	  text-decoration: underline;
       
    59 	  background: #BBCCEE;
       
    60           }
       
    61 
       
    62 	  .default {
       
    63 	  font-size: smaller;
       
    64 	  }
       
    65 
       
    66 	</style>
       
    67 
       
    68       </head>
       
    69       <body  bgcolor="#ffffff" text="#000000">
       
    70 	
       
    71 	<h1>Object dictionary for <em class="entree"><xsl:apply-templates select="@type_node"/></em> Node : <em class="entree"> <xsl:apply-templates select="@name" /> </em> </h1>
       
    72 	<h2>Node identity </h2>
       
    73 	<ul>
       
    74 	  <li>Device type (index 0x1000) :
       
    75 	    <xsl:choose>
       
    76 	      <xsl:when test="@device_type_1000"> 
       
    77 		<em class="entree">  <xsl:apply-templates select="@device_type_1000"/> </em>
       
    78 	      </xsl:when>
       
    79 	      <xsl:otherwise>
       
    80 		<em class="default">Undefined</em>
       
    81 	      </xsl:otherwise>
       
    82 	    </xsl:choose>
       
    83 	  </li>
       
    84 	  <li>Manufacturer device name (index 0x1008) :
       
    85 	    <xsl:choose>
       
    86 	      <xsl:when test="@manufacturer_device_name_1008"> 
       
    87 		<em class="entree">  <xsl:apply-templates select="@manufacturer_device_name_1008"/> </em>
       
    88 	      </xsl:when>
       
    89 	      <xsl:otherwise>
       
    90 		<em class="default">Undefined</em>
       
    91 	      </xsl:otherwise>
       
    92 	    </xsl:choose>
       
    93 	  </li>
       
    94 	  <li>Manufacturer hardware version (index 0x1009) :
       
    95 	    <xsl:choose>
       
    96 	      <xsl:when test="@manufacturer_hardware_version_1009"> 
       
    97 		<em class="entree">  <xsl:apply-templates select="@manufacturer_hardware_version_1009"/> </em>
       
    98 	      </xsl:when>
       
    99 	      <xsl:otherwise>
       
   100 		<em class="default">Undefined. Default is the compilation date of objdict.c</em>
       
   101 	      </xsl:otherwise>
       
   102 	    </xsl:choose>
       
   103 	  </li>
       
   104 	  <li> Manufacturer software version (index 0x100A) :
       
   105 	    <xsl:choose>
       
   106 	      <xsl:when test="@manufacturer_software_version_100A"> 
       
   107 		<em class="entree">  <xsl:apply-templates select="@manufacturer_software_version_100A"/> </em>
       
   108 	      </xsl:when>
       
   109 	      <xsl:otherwise>
       
   110 		<em class="default">Undefined. Default is the compilation time of objdict.c</em>
       
   111 	      </xsl:otherwise>
       
   112 	    </xsl:choose>
       
   113 	  </li>
       
   114 	  <li>Vendor id (index 0x1018, subindex 1) :
       
   115 	    <xsl:choose>
       
   116 	      <xsl:when test="@vendor_id_1018"> 
       
   117 		<em class="entree">  <xsl:apply-templates select="@vendor_id_1018"/> </em>
       
   118 	      </xsl:when>
       
   119 	      <xsl:otherwise>
       
   120 		<em class="default">Undefined</em>
       
   121 	      </xsl:otherwise>
       
   122 	    </xsl:choose>
       
   123 	  </li>
       
   124 	  <li>Product code (index 0x1018, subindex 2) :
       
   125 	    <xsl:choose>
       
   126 	      <xsl:when test="@product_code_1018"> 
       
   127 		<em class="entree">  <xsl:apply-templates select="@product_code_1018"/> </em>
       
   128 	      </xsl:when>
       
   129 	      <xsl:otherwise>
       
   130 		<em class="default">Undefined</em>
       
   131 	      </xsl:otherwise>
       
   132 	    </xsl:choose>
       
   133 	  </li>
       
   134 	  <li>Revision number (index 0x1018, subindex 3) :
       
   135 	    <xsl:choose>
       
   136 	      <xsl:when test="@revision_number_1018"> 
       
   137 		<em class="entree">  <xsl:apply-templates select="@revision_number_1018"/> </em>
       
   138 	      </xsl:when>
       
   139 	      <xsl:otherwise>
       
   140 		<em class="default">Undefined</em>
       
   141 	      </xsl:otherwise>
       
   142 	    </xsl:choose>
       
   143 	  </li>
       
   144 	  <li>Serial number (index 0x1018, subindex 4) :
       
   145 	    <xsl:choose>
       
   146 	      <xsl:when test="@serial_number_1018"> 
       
   147 		<em class="entree">  <xsl:apply-templates select="@serial_number_1018"/> </em>
       
   148 	      </xsl:when>
       
   149 	      <xsl:otherwise>
       
   150 		<em class="default">Undefined</em>
       
   151 	      </xsl:otherwise>
       
   152 	    </xsl:choose>
       
   153 	  </li>	  	  
       
   154 	</ul>
       
   155 	<xsl:apply-templates select="heartbeat_consumers"/>
       
   156 	<xsl:apply-templates select="sdo_clients"/>
       
   157 	<xsl:apply-templates select="pdo"/>
       
   158 	<h2>Mapped variables and tables</h2>	
       
   159 	<p>
       
   160 	  The access of the variable is by default "rw". A read-only variable cannot be mapped in a PDO receive.
       
   161 	</p>
       
   162 	<p>Here are some others rules for the mapping : </p>
       
   163 	<ul>
       
   164 	  <li>At an Index, you can map a variable at subindex 0x0 or 0x1, as you like.</li>
       
   165 	  <li>To map several variables at the same Index, you must start at subindex 0x1,
       
   166 	  because in this case, the subindex 0x0 contains the number of subindex.</li>
       
   167 	  <li>You cannot map variables and tables at the same index.</li>
       
   168 	  <li>The mapping of a table is always starting at subindex 0x1.</li>
       
   169 	</ul>
       
   170         <table class="mapping">
       
   171           <tr class="title">
       
   172              <td>Var Name</td><td>Bits</td><td>Index</td><td>Sub-index</td><td>access</td><td>Type (UNS/REAL)</td><td>Min value</td><td>Max value</td>
       
   173           </tr>
       
   174 	<xsl:apply-templates select="mapped_variable"/>
       
   175 	<tr class="title">
       
   176 	  <td>Table Name</td><td>Bits</td><td>Index</td><td>Sub-index</td><td>access</td><td>Type (UNS/REAL)</td><td>Min value</td><td>Max value</td>
       
   177 	</tr>
       
   178 	<xsl:apply-templates select="mapped_table"/>
       
   179 	<tr class="title">
       
   180 	  <td>String Name</td><td>Bytes</td><td>Index</td><td>Sub-index</td><td>access</td>
       
   181 	</tr>
       
   182 	<xsl:apply-templates select="mapped_string_variable"/>
       
   183 	</table>
       
   184       </body>
       
   185     </html>
       
   186   </xsl:template>
       
   187 
       
   188 
       
   189   <xsl:template match="heartbeat_consumers">
       
   190     <h2>Number of heartbeat consumers : 
       
   191     <em class="entree"><xsl:apply-templates select="@nombre" /></em>
       
   192     </h2>
       
   193     <p>This means that the node can expect heartbeats sent by <xsl:apply-templates select="@nombre" /> nodes. Canfestival limitation : You must at least have one.</p>
       
   194   </xsl:template>
       
   195 
       
   196   <xsl:template match="sdo_clients">
       
   197     <h2>Number of SDO clients : 
       
   198     <em class="entree"><xsl:apply-templates select="@nombre" /></em>
       
   199     </h2>
       
   200     <p>Usualy, a slave node does not have the use of SDO clients, but
       
   201     today - it is a Canfestival limitation -  you must define at least one. 
       
   202     </p>
       
   203     <p>
       
   204       The Master, which can
       
   205     send SDO to "n" slaves nodes, must define here "n" SDO
       
   206     clients. Remember that in most cases, the SDO protocol is used by
       
   207     the master to configure a slave dictionary or read a value. In
       
   208     this use, the master is the client, and the slave is the server.</p>
       
   209     <h2>Number of SDO servers : 
       
   210     <em class="default">1 (cannot be changed)</em>
       
   211     </h2>
       
   212     <p>A Canfestival node must have exactly one SDO server, defined at index 0x1200. The user cannot change this.</p> 
       
   213   </xsl:template>
       
   214 
       
   215 
       
   216   <xsl:template match="pdo">
       
   217     <h2>PDO 
       
   218     <xsl:choose>
       
   219       <xsl:when test="@type_rx_tx='rx'"> 
       
   220 	<em class="entree"> receive. </em>
       
   221       </xsl:when>
       
   222      <xsl:when test="@type_rx_tx='tx'"> 
       
   223 	<em class="entree">  transmit. </em>
       
   224       </xsl:when>
       
   225       <xsl:otherwise>
       
   226 	<em class="default">Undefined. Not normal !!!!</em>
       
   227       </xsl:otherwise>
       
   228     </xsl:choose>
       
   229 	CobId : 
       
   230 	<xsl:choose>
       
   231 	  <xsl:when test="@cob_id"> 
       
   232 	    <em class="entree">  <xsl:apply-templates select="@cob_id"/> </em>
       
   233 	  </xsl:when>
       
   234 	  <xsl:otherwise>
       
   235 	    <em class="default">Undefined (Using default).</em>
       
   236 	  </xsl:otherwise>
       
   237 	</xsl:choose>
       
   238 	Index communication parameter : 
       
   239 	<xsl:choose>
       
   240 	  <xsl:when test="@index_communication_parameter"> 
       
   241 	    <em class="entree">  <xsl:apply-templates select="@index_communication_parameter"/> </em>
       
   242 	  </xsl:when>
       
   243 	  <xsl:otherwise>
       
   244 	    <em class="default">Undefined (Using default).</em>
       
   245 	  </xsl:otherwise>
       
   246 	</xsl:choose>
       
   247     </h2>
       
   248     <ul>
       
   249       <li>
       
   250 	Maximum of objects (ie variables) that can be embeded : 
       
   251 	<xsl:choose>
       
   252 	  <xsl:when test="@max_objects_in_pdo"> 
       
   253 	    <em class="entree">  <xsl:apply-templates select="@max_objects_in_pdo"/> </em>
       
   254 	  </xsl:when>
       
   255 	  <xsl:otherwise>
       
   256 	    <em class="default">Undefined (Using default : 8).</em>
       
   257 	  </xsl:otherwise>
       
   258 	</xsl:choose>
       
   259       </li>
       
   260       <li>
       
   261 	Transmission type :
       
   262 	<xsl:choose>
       
   263 	  <xsl:when test="@transmission_type"> 
       
   264 	    <em class="entree">  <xsl:apply-templates select="@transmission_type"/> </em>
       
   265 	  </xsl:when>
       
   266 	  <xsl:otherwise>
       
   267 	    <em class="default">Undefined (Using default : 253).</em>
       
   268 	  </xsl:otherwise>
       
   269 	</xsl:choose>
       
   270       </li>
       
   271     </ul>
       
   272     <h3>Default mapped objects :</h3>
       
   273     <table class="mapping">
       
   274       <tr class="title">
       
   275 	<td>Var Name</td><td>Bits</td><td>Index</td><td>Sub-index</td>
       
   276       </tr>
       
   277       <xsl:apply-templates select="mapped_object"/>
       
   278     </table>
       
   279 
       
   280 
       
   281     <p>About the cobId : The 4th first PDO receive defined at index 0x1400 to 0x1403, or transmit (0x1800 to 0x1803) are changed at runtime according to the DS 301, whatever the value you put here.</p>
       
   282     <p>If the Index communication parameter is not defined, have a look at objdict.c to know what index have beed created.</p>
       
   283     <p>It is not required to map some objects in a PDO. It can also be done by the node itself at runtime, or by an other node whith the SDO functionalitie.</p>
       
   284   </xsl:template>
       
   285   
       
   286 
       
   287 
       
   288 
       
   289   <xsl:template match="mapped_object">
       
   290     <tr>
       
   291       <xsl:choose>
       
   292 	<xsl:when test="@name"> 
       
   293 	  <td><em class="entree">  <xsl:apply-templates select="@name"/> </em></td>
       
   294 	</xsl:when>
       
   295 	<xsl:otherwise>
       
   296 	  <td><em class="default">Undefined</em></td>
       
   297 	</xsl:otherwise>
       
   298       </xsl:choose>
       
   299       <td><em class="entree"><xsl:apply-templates select="@size_in_bits" /></em></td>
       
   300       <td><em class="entree"><xsl:apply-templates select="@index" /></em></td>
       
   301       <td><em class="entree"><xsl:apply-templates select="@sub_index" /></em></td>     
       
   302     </tr>
       
   303   </xsl:template>
       
   304 
       
   305   <xsl:template match="mapped_variable">
       
   306     <tr>
       
   307       <td><em><xsl:apply-templates select="@name" /></em></td>
       
   308       <td><em class="entree"><xsl:apply-templates select="@size_in_bits" /></em></td>
       
   309       <td><em class="entree"><xsl:apply-templates select="@index" /></em></td>
       
   310       <td><em class="entree"><xsl:apply-templates select="@sub_index" /></em></td>     
       
   311       <xsl:choose>
       
   312 	<xsl:when test="@access"> 
       
   313 	  <td><em class="entree">  <xsl:apply-templates select="@access"/> </em></td>
       
   314 	</xsl:when>
       
   315 	<xsl:otherwise>
       
   316 	  <td><em class="default">Undefined. Default is RW</em></td>
       
   317 	</xsl:otherwise>
       
   318       </xsl:choose>
       
   319       <xsl:choose>
       
   320 	<xsl:when test="@type"> 
       
   321 	  <td><em class="entree">  <xsl:apply-templates select="@type"/> </em></td>
       
   322 	</xsl:when>
       
   323 	<xsl:otherwise>
       
   324 	  <td><em class="default">Undefined. Default is UNS</em></td>
       
   325 	</xsl:otherwise>
       
   326       </xsl:choose>
       
   327       <xsl:choose>
       
   328 	<xsl:when test="@min_value"> 
       
   329 	  <td><em class="entree">  <xsl:apply-templates select="@min_value"/> </em></td>
       
   330 	</xsl:when>
       
   331 	<xsl:otherwise>
       
   332 	  <td><em class="default">Undefined</em></td>
       
   333 	</xsl:otherwise>
       
   334       </xsl:choose>
       
   335       <xsl:choose>
       
   336 	<xsl:when test="@max_value"> 
       
   337 	  <td><em class="entree">  <xsl:apply-templates select="@max_value"/> </em></td>
       
   338 	</xsl:when>
       
   339 	<xsl:otherwise>
       
   340 	  <td><em class="default">Undefined</em></td>
       
   341 	</xsl:otherwise>
       
   342       </xsl:choose>
       
   343     </tr>
       
   344   </xsl:template>
       
   345 
       
   346   <xsl:template match="mapped_table">
       
   347     <tr>
       
   348       <td><em><xsl:apply-templates select="@name" /></em>[<em class="entree"><xsl:apply-templates select="@number_elements" /></em>]</td>
       
   349       <td><em class="entree"><xsl:apply-templates select="@size_in_bits" /></em></td>
       
   350       <td><em class="entree"><xsl:apply-templates select="@index" /></em></td>
       
   351       <td>1 to <em class="entree"><xsl:apply-templates select="@number_elements" /></em></td>    
       
   352       <xsl:choose>
       
   353 	<xsl:when test="@access"> 
       
   354 	  <td><em class="entree">  <xsl:apply-templates select="@access"/> </em></td>
       
   355 	</xsl:when>
       
   356 	<xsl:otherwise>
       
   357 	  <td><em class="default">Undefined. Default is RW</em></td>
       
   358 	</xsl:otherwise>
       
   359       </xsl:choose>
       
   360       <xsl:choose>
       
   361 	<xsl:when test="@type"> 
       
   362 	  <td><em class="entree">  <xsl:apply-templates select="@type"/> </em></td>
       
   363 	</xsl:when>
       
   364 	<xsl:otherwise>
       
   365 	  <td><em class="default">Undefined. Default is UNS</em></td>
       
   366 	</xsl:otherwise>
       
   367       </xsl:choose>
       
   368       <xsl:choose>
       
   369 	<xsl:when test="@min_value"> 
       
   370 	  <td><em class="entree">  <xsl:apply-templates select="@min_value"/> </em></td>
       
   371 	</xsl:when>
       
   372 	<xsl:otherwise>
       
   373 	  <td><em class="default">Undefined</em></td>
       
   374 	</xsl:otherwise>
       
   375       </xsl:choose>
       
   376       <xsl:choose>
       
   377 	<xsl:when test="@max_value"> 
       
   378 	  <td><em class="entree">  <xsl:apply-templates select="@max_value"/> </em></td>
       
   379 	</xsl:when>
       
   380 	<xsl:otherwise>
       
   381 	  <td><em class="default">Undefined</em></td>
       
   382 	</xsl:otherwise>
       
   383       </xsl:choose>
       
   384     </tr>
       
   385   </xsl:template>
       
   386 
       
   387   <xsl:template match="mapped_string_variable">
       
   388     <tr>
       
   389       <td><em><xsl:apply-templates select="@name" /></em></td>
       
   390       <td><em class="entree"><xsl:apply-templates select="@size_in_byte" /></em></td>
       
   391       <td><em class="entree"><xsl:apply-templates select="@index" /></em></td>
       
   392       <td><em class="entree"><xsl:apply-templates select="@sub_index" /></em></td>     
       
   393       <xsl:choose>
       
   394 	<xsl:when test="@access"> 
       
   395 	  <td><em class="entree">  <xsl:apply-templates select="@access"/> </em></td>
       
   396 	</xsl:when>
       
   397 	<xsl:otherwise>
       
   398 	  <td><em class="default">Undefined. Default is RW</em></td>
       
   399 	</xsl:otherwise>
       
   400       </xsl:choose>
       
   401     </tr>
       
   402   </xsl:template>
       
   403 
       
   404 </xsl:stylesheet>