03.03.2013 Views

CANopen Programmer's Manual - Maccon.de

CANopen Programmer's Manual - Maccon.de

CANopen Programmer's Manual - Maccon.de

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>CANopen</strong> Programmer’s <strong>Manual</strong> 1: Introduction<br />

Example: Mapping a Receive PDO<br />

This example illustrates the general procedure for mapping a receive PDO. In the example, the<br />

second receive PDO is mapped to the <strong>de</strong>vice’s Control Word object (in<strong>de</strong>x 0x6040, p. 58) to<br />

receive <strong>de</strong>vice state change commands and to the Mo<strong>de</strong> Of Operation object (in<strong>de</strong>x 0x6060, p.<br />

64) to receive mo<strong>de</strong> change commands.<br />

Stage Step Sub-steps/Comments<br />

1 Disable the PDO. In the PDO’s mapping object (Receive PDO Mapping Parameters, in<strong>de</strong>x<br />

0x1601), set the sub-in<strong>de</strong>x 0 (NUMBER OF MAPPED OBJECTS) to zero.<br />

This disables the PDO.<br />

2 Set the communication<br />

parameters.<br />

In this case, it is not necessary to set the CAN message ID of the PDO,<br />

because the <strong>de</strong>fault value is acceptable.<br />

In the PDO TYPE object (sub-in<strong>de</strong>x 2 of RECEIVE PDO Communication<br />

Parameters, in<strong>de</strong>x 0x1401) choose a value in the range [254-255] so that<br />

the PDO transmits immediately upon request (without waiting for a<br />

synchronization message).<br />

3 Map the data. In the <strong>de</strong>vice’s Receive PDO Mapping Parameters object (in<strong>de</strong>x 0x1601):<br />

4. Set the number of mapped<br />

objects and enable the PDO.<br />

1: To map the Control Word to the PDO, set object 1601, sub-in<strong>de</strong>x 1 to:<br />

Bits 16-31<br />

contain the<br />

in<strong>de</strong>x of the<br />

object to be<br />

mapped<br />

0x 6040 00 10<br />

Bits 8-15<br />

clear; the<br />

mapped<br />

object has no<br />

subin<strong>de</strong>x<br />

Bits 0-7 show<br />

the size of the<br />

Control Word<br />

(16 bits) in hex<br />

2: To map the Mo<strong>de</strong> Of Operation object to the PDO, set sub-in<strong>de</strong>x 2 to:<br />

Bits 16-31<br />

contain the<br />

in<strong>de</strong>x of the<br />

object to be<br />

mapped<br />

0x 6060 00 08<br />

Bits 8-15<br />

clear; the<br />

mapped<br />

object has no<br />

subin<strong>de</strong>x<br />

Bits 0-7 show<br />

the size of the<br />

Change of<br />

Mo<strong>de</strong> object<br />

(16 bits) in hex<br />

In the PDO’s Receive PDO Mapping Parameters object (in<strong>de</strong>x 0x1601),<br />

set sub-in<strong>de</strong>x 0 (NUMBER OF MAPPED OBJECTS) to 2, the actual<br />

number of objects mapped. This properly configures the PDO. Also, the<br />

presence of a non-zero value in the NUMBER OF MAPPED OBJECTS<br />

object enables the PDO.<br />

Copley Controls 29

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!