etisserant@0: etisserant@0: etisserant@0:
etisserant@0: etisserant@0:
etisserant@0: How to make the object dictionary of the node ?
etisserant@0: First, use Jaxe (command run_objdict) to edit an xml description file
etisserant@0: of the dictionary : objdict.xml.
etisserant@0: Then, run the php program : makeobjetdict.php. You can launch php through a web browser
etisserant@0: if you have installed a server, or, on Linux, you can launch php in command line :
etisserant@0: php-cgi makeobjetdict.php. It compute the file objdict.c. Link it to
etisserant@0: your project.
etisserant@0:
Note : To define the node id, use in your code the function setNodeId(UNS8 nodeId)
etisserant@0:
etisserant@0: Then the node can be connected to the network. The master must configure it etisserant@0: by sending SDO. It will write values in its index, subindex. What to configure ? etisserant@0:
This means that the node can expect heartbeats sent by 1 nodes.
etisserant@0:Usualy, a slave node does not have the use of SDO clients, but etisserant@0: today, for the library, you must define one. The Master, which can etisserant@0: send SDO to "n" slaves nodes, must define here "n" SDO etisserant@0: clients. Remember that in most cases, the SDO protocol is used by etisserant@0: the master to configure a slave dictionary or read a value. In etisserant@0: this use, the master is the client, and the slave is the server.
etisserant@0:This is defining how many variables can be transmited in a etisserant@0: PDO. (maximum is 8).
etisserant@0:For each variable, a table is created, so if you have less room etisserant@0: in memory, put a value under 8.
etisserant@0:The node can receive 3 PDO.
etisserant@0:The communication parameters are defined at index 0x1400 to 0x1400 + 2
etisserant@0:The mapping parameters are defined at index 0x1600 to 0x1600 + 2
etisserant@0:The node can transmit 3 PDO.
etisserant@0:The communication parameters are defined at index 0x1800 to 0x1800 + 2
etisserant@0:The mapping parameters are defined at index 0x1A00 to 0x1A00 + 2
etisserant@0:3 tables are defined for the mapping, starting at index 0x2000, 0x6000 and 0x6200. etisserant@0: You must start the mapping at the beginning of one of a table, without holes in index etisserant@0: 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. etisserant@0:
etisserant@0:etisserant@0: 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. etisserant@0:
etisserant@0:Here are some others rules for the mapping :
etisserant@0:Var Name | Bits | Index | Sub-index | access | etisserant@0:
seconds | 8 | 0x2000 | 0x1 | rw | etisserant@0:
minutes | 8 | 0x2000 | 0x02 | rw | etisserant@0:
hours | 8 | 0x2000 | 0x3 | rw | etisserant@0:
day | 8 | 0x2000 | 0x4 | rw | etisserant@0:
canopenErrNB | 32 | 0x6000 | 0x0 | rw | etisserant@0:
canopenErrVAL | 32 | 0x6001 | 0x0 | rw | etisserant@0:Table Name | Bits | Index | Sub-index | access | etisserant@0: