LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

CANopen - TPDO/RPDO object out

Hey everyone,

I'm working for the first time with CANopen and the NI 9881 module. I need to control 12 CANopen devices. For each device I'm creating a TPDO object and a RPDO object. In order to save a lot of space i want to create a Sub VI. Is it possible to somehow bundle the TPDO/RPDO out objects so i don't have 24+ output wires for the Sub VI?

SInce i'm new on the topic any help is very welcome

 

Best regards

Marius

0 Kudos
Message 1 of 3
(2,630 Views)

Hi Marius,

 

LabVIEW basics: use a cluster to bundle related data. When the datatype of those data items is the same you can even use arrays…

 

(I would prefer a typedefined cluster with proper labels for all elements in this case. UnbundleByName is the way to go then…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 3
(2,597 Views)

The problem with these objects is that you can't make fully use of clusters. For some reason -that I do not understand- if you cluster these TPDO/RPDO objects and then try to create a cluster indicator, LabVIEW refuses to do so. That also makes it impossible to create a subvi using clusters, because you need controls and indicators to attach to the connector pane.

Moreover, you can't even create a subvi where the TPDO/RPDO objects are connected to the connector pane. Obviously there must be a way, because the CANopen Addon contains a lot of subvi's with CANopen objects as inputs and outputs.

 

For illustration purposes, I have a screendump with part of my code, where I bundle 'interface object out' and 'RPDO object out'. That is fully accepted by LabVIEW, but when I rightclick on the 'bundle by name' cluster node and select 'create indicator', LabVIEW refuses to do so.

 

This forces me to use all CANopen interface objects within one vi. I do not manage to get these objects to pass the vi 'boundary'. I suspect it is my lack of knowledge for these kind of objects. Suggestions anybody?

CANopen_Objects_and_Clusters.PNG

 

0 Kudos
Message 3 of 3
(2,179 Views)