04-07-2020 03:34 AM
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
04-07-2020 05:32 AM - edited 04-07-2020 05:32 AM
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…)
02-21-2021 04:37 AM - edited 02-21-2021 04:38 AM
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?