objdictgen/examples/example_objdict.html
changeset 281 685d9a26e4f9
parent 280 d9b232ec7057
child 282 6afe145df950
equal deleted inserted replaced
280:d9b232ec7057 281:685d9a26e4f9
     1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
       
     2 <html>
       
     3 <head>
       
     4 <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
       
     5 <title>CANOpen object dictionary Configuration</title>
       
     6 <style type="text/css">
       
     7          table {
       
     8 	  border: 1px solid #200088;
       
     9         }
       
    10 	  td {
       
    11 	  border: 1px solid #200088;
       
    12         }
       
    13          h1 {
       
    14 	   background: #FFDD66;
       
    15 	   border: 3px solid #AA0000;
       
    16            margin: 2em;
       
    17            padding: 1em;
       
    18 	 }
       
    19 
       
    20          h2, h2.dico, h2.pdo {
       
    21 	   background: #5577FF;
       
    22 	   border: 1px solid #AA0000;
       
    23            margin: 1em;
       
    24 	 }
       
    25 	 
       
    26 	  h1 em.node-id {
       
    27 	  color: #0728FF;
       
    28 	  padding-left: 1em;
       
    29 	  padding-right: 1em;
       
    30 	  }
       
    31 
       
    32 	  h1 em.type-node {
       
    33 	  color: #26BE08;
       
    34 	  padding-left: 1em;
       
    35 	  padding-right: 1em;
       
    36 	  }
       
    37 
       
    38 	  em.pdo-mode {
       
    39 	  color: #26BE08;
       
    40 	  }
       
    41 
       
    42 	  .entree {
       
    43 	  color: #AA0000;
       
    44 	  }
       
    45          
       
    46 	  .nom-var, .node-nom {
       
    47 	  color: #660000;
       
    48 	  }
       
    49 
       
    50 	</style>
       
    51 </head>
       
    52 <body text="#000000" bgcolor="#ffffff">
       
    53 <h1>Object dictionary for Node : </h1>
       
    54 <h1>
       
    55 <em class="node-nom">Linux_slave</em><em class="type-node">slave</em>
       
    56 </h1>
       
    57 <h2>Overview</h2>
       
    58 <p>
       
    59 	How to make the object dictionary of the node ?
       
    60 	First, use Jaxe (command run_objdict) to edit an xml description file
       
    61 of the dictionary : objdict.xml.
       
    62 Then, run the php program : makeobjetdict.php. You can launch php through a web browser
       
    63 if you have installed a server, or, on Linux, you can launch php in command line :
       
    64 php-cgi makeobjetdict.php. It compute the file objdict.c. Link it to
       
    65         your project.
       
    66 <br>Note : To define the node id, use in your code the function setNodeId(UNS8 nodeId)
       
    67 	</p>
       
    68 <p>
       
    69 	  Then the node can be connected to the network. The master must configure it
       
    70 	  by sending SDO. It will write values in its index, subindex. What to configure ? 
       
    71 	  <ul>
       
    72 <li>Receiving heartbeats from which nodes ? Waiting time ?</li>
       
    73 <li>Emitting heartbeats or not ? time btw 2 heartbeats ? </li>
       
    74 <li>Defining a cobId for each PDO receive and transmit</li>
       
    75 <li>How to transmit a PDO ? on synchro ? request ? event ?</li>
       
    76 <li>What variables to put in each PDO receive and transmit ? </li>
       
    77 <li>...</li>
       
    78 </ul>
       
    79 </p>
       
    80 	To avoid configuring the node at the connection, you can put the values directly
       
    81 in the dictionary objdict.c. But it is boring and unsafe because it is too easy to make
       
    82 a mistake !
       
    83 
       
    84       
       
    85 	<h2>Number of heartbeat consumers : 
       
    86     <em class="entree">1</em>
       
    87 </h2>
       
    88 <p>This means that the node can expect heartbeats sent by 1 nodes. </p>
       
    89 <h2>Number of SDO clients : 
       
    90     <em class="entree">1</em>
       
    91 </h2>
       
    92 <p>Usualy, a slave node does not have the use of SDO clients, but
       
    93     today, for the library, you must define one. The Master, which can
       
    94     send SDO to "n" slaves nodes, must define here "n" SDO
       
    95     clients. Remember that in most cases, the SDO protocol is used by
       
    96     the master to configure a slave dictionary or read a value. In
       
    97     this use, the master is the client, and the slave is the server.</p>
       
    98 <h2>Maximum objects in a PDO (receive or transmit) : 
       
    99     <em class="entree">8</em>
       
   100 </h2>
       
   101 <p>This is defining how many variables can be transmited in a
       
   102     PDO. (maximum is 8).</p>
       
   103 <p>For each variable, a table is created, so if you have less room
       
   104     in memory, put a value under 8.</p>
       
   105 <h2>Number of PDO receive : 
       
   106     <em class="entree">3</em>
       
   107 </h2>
       
   108 <p>The node can receive 3 PDO.</p>
       
   109 <p>The communication parameters are defined at index 0x1400 to 0x1400 + 2</p>
       
   110 <p>The mapping parameters are defined at index 0x1600 to 0x1600 + 2</p>
       
   111 <h2>Number of PDO transmit : 
       
   112     <em class="entree">3</em>
       
   113 </h2>
       
   114 <p>The node can transmit 3 PDO.</p>
       
   115 <p>The communication parameters are defined at index 0x1800 to 0x1800 + 2</p>
       
   116 <p>The mapping parameters are defined at index 0x1A00 to 0x1A00 + 2</p>
       
   117 <h2>Mapped variables and tables</h2>
       
   118 <p>3 tables are defined for the mapping, starting at index 0x2000, 0x6000 and 0x6200.
       
   119 	You must start the mapping at the beginning of one of a table, without holes in index
       
   120 or subindex. For example, variables in 0x2000 and 0x2001 is ok, but variables in 0x2000 and 0x2002 is not allowed, because you are loosing room in memory. It is the same for the subindex.
       
   121 </p>
       
   122 <p>
       
   123 	The access of the variable is by default "rw" (read-write) or "ro" (read-only). A read-only variable cannot be mapped in a PDO receive.
       
   124 </p>
       
   125 <p>Here are some others rules for the mapping : </p>
       
   126 <ul>
       
   127 <li>At an Index, you can map a variable at subindex 0x0 or 0x1, as you like.</li>
       
   128 <li>To map several variables at the same Index, you must start at subindex 0x1,
       
   129 	  because in this case, the subindex 0x0 contains the number of subindex.</li>
       
   130 <li>You cannot map variables and tables at the same index.</li>
       
   131 <li>The mapping of a table is always starting at subindex 0x1.</li>
       
   132 </ul>
       
   133 <table class="mapping">
       
   134 <tr>
       
   135 <td>Var Name</td><td>Bits</td><td>Index</td><td>Sub-index</td><td>access</td>
       
   136 </tr>
       
   137 <tr>
       
   138 <td><em>seconds</em></td><td><em class="entree">8</em></td><td><em class="entree">0x2005</em></td><td><em class="entree">0x1</em></td><td><em class="entree">rw</em></td>
       
   139 </tr>
       
   140 <tr>
       
   141 <td><em>minutes</em></td><td><em class="entree">8</em></td><td><em class="entree">0x2005</em></td><td><em class="entree">0x02</em></td><td><em class="entree">rw</em></td>
       
   142 </tr>
       
   143 <tr>
       
   144 <td><em>hours</em></td><td><em class="entree">8</em></td><td><em class="entree">0x2005</em></td><td><em class="entree">0x3</em></td><td><em class="entree">rw</em></td>
       
   145 </tr>
       
   146 <tr>
       
   147 <td><em>day</em></td><td><em class="entree">8</em></td><td><em class="entree">0x2005</em></td><td><em class="entree">0x4</em></td><td><em class="entree">rw</em></td>
       
   148 </tr>
       
   149 <tr>
       
   150 <td><em>null</em></td><td><em class="entree">8</em></td><td><em class="entree">0x2002</em></td><td><em class="entree">0x0</em></td><td><em class="entree">ro</em></td>
       
   151 </tr>
       
   152 <tr>
       
   153 <td><em>canopenErrNB</em></td><td><em class="entree">32</em></td><td><em class="entree">0x6000</em></td><td><em class="entree">0x0</em></td><td><em class="entree">rw</em></td>
       
   154 </tr>
       
   155 <tr>
       
   156 <td><em>canopenErrVAL</em></td><td><em class="entree">32</em></td><td><em class="entree">0x6001</em></td><td><em class="entree">0x0</em></td><td><em class="entree">rw</em></td>
       
   157 </tr>
       
   158 <td>Table Name</td><td>Bits</td><td>Index</td><td>Sub-index</td><td>access</td>
       
   159 <tr>
       
   160 <td><em>table_essai</em>[<em class="entree">5</em>]</td><td><em class="entree">8</em></td><td><em class="entree">0x2006</em></td><td>1 to <em class="entree">5</em></td><td><em class="entree">ro</em></td>
       
   161 </tr>
       
   162 <tr>
       
   163 <td><em>table_encore_un_essai</em>[<em class="entree">3</em>]</td><td><em class="entree">16</em></td><td><em class="entree">0x2001</em></td><td>1 to <em class="entree">3</em></td><td><em class="entree">ro</em></td>
       
   164 </tr>
       
   165 </table>
       
   166 </body>
       
   167 </html>