(only for terminals with CANopen DS301 V4, like UPT128, UPT320, UPT800; but not for UPT515)
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:
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").
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) |
.. | .. | ... |
// 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)