05-06-2026 03:34 AM
Hi,
i created a SubVI to store data in a CSV file. In order to use the SubVI in different contexts and with changing cluster entries, I did not wire the cluster, but a reference of the cluster to the SubVI. The SubVI than reads the values and labels of the cluster. Everything worked like a charm. As soon as I try to change the structure of the passed cluster or use the SubVI in a different context, a class conflict between the cluster reference and the input terminal of the SubVI occurs. I attached the working SubVi. Here is a screenshot of the working MainVI:
As soon as I add another Variable to the cluster the error "You have connected a refnum of one type to a refnum of another type and both types are members of some class hierarchy, but there is neither a simple up cast nor type cast between the two classes." occurs.
I already read that typdefs may be the correct approach, but I can not make it work.
Thank you all for your help!
Jorge
Solved! Go to Solution.
05-06-2026 04:21 AM
Hi Jorge,
Right-click the cluster reference input of your subVI > Select Ctrl Type > Cluster.
It will turn it into a weakly-typed cluster reference instead of a strictly-typed cluster reference.
Regards,
Raphaël.
05-06-2026 04:58 AM - edited 05-06-2026 04:59 AM
Hi Jorge,
@jorgeBS wrote:
In order to use the SubVI in different contexts and with changing cluster entries, I did not wire the cluster, but a reference of the cluster to the SubVI.
The SubVI than reads the values and labels of the cluster. Everything worked like a charm.
LabVIEW uses strictly-typed datatypes, and each (different) cluster defines its own datatype. The reference to a cluster keeps the datatype information - as long as you don't switch off that behaviour explicitely as suggested by Raphaël…
How do you analyze the cluster in your subVI? It seems you want to handle different clusters (different datatypes), all of them unknown to your subVI!?
@jorgeBS wrote:
I already read that typdefs may be the correct approach, but I can not make it work.
Using typedefs will not help you in this case as your subVI still needs to handle a broad variety of datatypes…
05-06-2026 05:28 AM
Alternative approach: replace the refnum control with a cluster and use a vim:
cluster of double to csv
05-06-2026 06:38 AM
Hi,
thank you all for you quick responding. I will go with Raphaël's suggested solution which worked for me.
cordms solution seems to work also, but - I my limited understanding - makes it harder to change the entries and their titles in the main VI.
@GerdW: at the moment I don't analyze the data and just assume they are all numeric values. The flexibility I need regards only the number of entries and their titles, not the data types.
All the best
Jorge
05-06-2026 07:44 AM
Hi Jorge,
@jorgeBS wrote:
@GerdW: at the moment I don't analyze the data and just assume they are all numeric values. The flexibility I need regards only the number of entries and their titles, not the data types.
Then why do you use (multiple different) clusters?
05-06-2026 08:18 AM
Hello Gerd,
your suggestions sound all pretty useful, I will have a look into it. The "why not" can in all cases be answered with the lack of my experience. Thank you for your input!
Best regards,
Jorge