01-30-2025 11:16 PM
Hi people,
I recently started using NI IndCom for CANopen and have a basic query. According to the protocol, RPDO Communication Parameters include COB-ID and Transmission Type, while RPDO Mapping Parameters define the linked objects.
When using the LabVIEW API, we create PDO objects with inputs as PDO1/PDO2/PDO3/PDO4, optionally specifying the COB-ID, and then write data using the RPDO Write function. My question is: while creating RPDO and writing data, how do we specify which object within PDO1/PDO2/PDO3/PDO4 we are referring to? Since multiple objects are linked to a single PDO, but we provide only one data input while writing, I am facing difficulties in PDO communication.
Your guidance on this would be highly valuable.
Thanks in advance for your help!
Solved! Go to Solution.
01-31-2025 12:49 AM
Hi SD,
SD@01 wrote:
My question is: while creating RPDO and writing data, how do we specify which object within PDO1/PDO2/PDO3/PDO4 we are referring to? Since multiple objects are linked to a single PDO, but we provide only one data input while writing, I am facing difficulties in PDO communication
The content of the PDO objects is defined by settings in your device.
You can change those settings (typically) using SDOs.
Read the manual of your device to learn about the default content of all PDOs and how to configure them…
01-31-2025 02:49 AM
Hii GerdW
Thanks for your response!!
To just give you the context, I am using EPOS4 Compact CAN Digital positioning controller as CANopen node in my CAN network. I am controlling this device using NI 9881 CANopen interface module installed in cRIO-9049 chassis. Also I am using NI Industrial Communications for CANopen driver for programming my application in LabVIEW.
We can map objects to RPDO as defined in Firmware specifications of EPOS4 device (Please find attached Image 1 for the reference).
In LabVIEW, I am using Batch SDO service provided by NI Industrial Communications for CANopen driver to write multiple SDO's at a time and I am defining my mapping here (Please find attached Image 2 for the reference).
Now when I program my application, I need to first create PDO and then use its reference to write data to that PDO. I have attached a simple example of RPDO Write (Please find attached Image 3 for the reference) where we use RPDO Create VI and provide a channel name at its input. The channel name is an enum having 4 items namely PDO1,PDO2,PDO3 and PDO4 (corresponding to 4 possible process data objects).
After this, we start PDO and use CANopen RPDO Write VI to write data to the PDO.
In this particular scenario, when I create PDO1 and write data to the PDO1, which object from this PDO1 (as defined in PDO mapping) am I referring to while writing the data as multiple objects are mapped to the PDO1 itself ?
Your inputs will be highly appreciated.
Thank you in advance!!
Image 1
Image 2
Image 3
01-31-2025 03:10 AM
Hi SD,
SD@01 wrote:
In this particular scenario, when I create PDO1 and write data to the PDO1, which object from this PDO1 (as defined in PDO mapping) am I referring to while writing the data as multiple objects are mapped to the PDO1 itself ?
The PDO can contain several values and you write an array of values. Each array element corresponds to an element/value in the PDO.
I guess XNET maps the array elements to the PDO entries in corresponding order, but I never worked with XNET…
02-12-2025 11:17 AM
Hey GerdW,
Thank you for your timely help—you were spot on!
When using the NI Industrial Communications for CANopen driver in LabVIEW, writing data to an RPDO and reading from a TPDO involves mapping each array element to a corresponding PDO object. To illustrate this, consider the following example:
PDO1 consists of three mapped objects:
When writing data using the RPDO Write VI, the input is an array of U8 elements. Each element in the array corresponds to a mapped object in the same sequence as the PDO mapping. Since the array uses U8 data types, multiple U8 elements combine to represent values for objects with U16 and U32 data types.
Following the PDO mapping above, the array elements correspond to object values as follows:
By writing data in this sequence, values are assigned to all mapped objects within the PDO. Similarly, when reading data from a TPDO, the same mapping structure applies.
I’ve done my best to explain this concept with a practical example, and I hope this helps the community.
Thanks again for your support!