PDO-Mapping-Dialog for display terminals with CANopen

(only for terminals with CANopen DS301 V4, like UPT128, UPT320, UPT800;  but not for UPT515)

Screenshot PDO Mapping Dialog

Sorry, we have not translated this document completely into English yet. Please try the german version, or ask the manufacturer for an update.

See also:


Change the PDO-mapping via Script (during runtime, inside the terminal)

Devices which (besides CANopen) also support the optional script language can also modify their own PDO mapping 'on the fly' at runtime.
Unfortunately this is not as easy as one may expect (as so often with CANopen, which is slightly over-engineered). To understand the following description, the reader should be familiar with the basics of CANopen, and with the script commands to interact with the CANopen stack / CANopen-OD (because "without the object dictionary, there's not much you can do with CANopen").

Just a reminder:
Subindex 1 in the so-called 'PDO Communication Parameter' (eg object 0x1800 = first Transmit-PDO) contains what CANopen calls 'COB-ID used by TPDO' (in fact a "CAN-Identifier" used to identify this process data frame).
The upper bits in the 'COP-ID' have a special meaning, which CiA DS301 V4.2.0 specifies in table 70 on page 138 as follows:
Bit(s) Value Description
valid (bit 31) 0
1
PDO exists / is valid
PDO does not exist / is not valid
RTR (bit 30) 0
1
RTR allowed on this PDO
no RTR allowed on this PDO
frame (bit 29) 0
1
11-bit CAN-ID valid (CAN base frame)
29-bit CAN-ID valid (CAN extended frame)
.. ..
...
The 'valid' bit (bit 31) in the PDO Communication Parameter is also important when modifying the PDO mapping, because (quoted from CANopen CiA DS301 V4.2.0, pages 142 to 143):

The following procedure shall be used for re-mapping, which may take place during the NMT state Pre-operational and during the NMT state Operational, if supported:
  1. Destroy TPDO by setting bit valid to 1b of sub-index 01h of the according TPDO communication parameter.
  2. Disable mapping by setting sub-index 00h to 00h.
  3. Modify mapping by changing the values of the corresponding sub-indices.
  4. Enable mapping by setting sub-index 00h to the number mapped objects.
  5. Create TPDO by setting bit valid to 0b of sub-index 01h of the according TPDO communication parameter.
In the script language, the terminal could reprogram the mapping of its own 'first transmit PDO' as follows:
  // dwCommParValue : declared somewhere as 32-bit unsigned integer variable, aka dword
  dwCommParValue := cop.obd(0x1800,0x00); // save original value of PDO communication parameter     
  cop.obd(0x1800,0x00) := dwCommParValue | 0x80000000;  // make 1st transmit PDO invalid (CiA: "Destroy TPDO"); set bit 31
  cop.obd(0x1A00,0x00) := 0x00;        // clear TPDO1 mapping table (CiA: "Disable mapping"..)
  cop.obd(0x1A00,0x01) := 0x40050108;  // 1st mapping entry: map object 0x4005, subindex 1, 8 bits
  cop.obd(0x1A00,0x00) := 0x01;        // enable mapping by setting the number of mapped objects
  cop.obd(0x1800,0x00) := dwCommParValue & 0x7FFFFFFF; // make 1st transmit PDO valid (CiA: "Create TPDO"); clear bit 31
  

The Script Language manual contains an example to modify the PDO-mapping via script (at runtime), which is contained in the application CANopen1.upt .


File: ..?..\uptwin1\help\pdomapdlg_01.htm
Author: W.Büscher, MKT Systemtechnik
Last modified: 2013-08-22 (ISO8601, YYYY-MM-DD)

zurück zur Übersicht