LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Array to Cluster as It Should Be (Xnode)

Why should I have to set the cluster size for the "Array to Cluster" function?

It should know automatically.

This XNode wraps "Array to Cluster" and automatically sets the cluster size for you.

"If you weren't supposed to push it, it wouldn't be a button."
Message 1 of 4
(1,048 Views)

Awesome, love it.  There are a couple of NI nodes that will have up stream conversion like this but they are rare.  Variant to Data is one that can work this way. 

 

I did find a bug right away but it was an accident.  I created an array of variants and wired it to the input.  Then I created a cluster constant with 2 variants in it, and wired the output to the constant.  This obviously doesn't make sense and I meant to make it an indicator first.  But if you do wire the output to the constant, and error error 1 dialog comes up.

 

Error 1 occurred at NI_Data Type.lvlib:Get Cluster Information.vi

 

Complete call chain:
NI_Data Type.lvlib:Get Cluster Information.vi
Array to Cluster.xnode:AdaptToInputs.vi:4740001
Array to Cluster.xnode:AdaptToInputs.vi.ProxyCaller

0 Kudos
Message 2 of 4
(1,035 Views)

Oops.  A remnant of debugging code got left in.

Here's the fixed version.

 

Note: While there is built-in support for XNodes to adapt to inputs, I had to go through some contortions to make it adapt to the output.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 3 of 4
(1,028 Views)

Yeah I did this for my Variant Repository read years ago (omg was that really 8 years ago...)  I don't remember the technique I used.  Still since then I've just been using the VIM implementation of this since the important part of the functionality can be done through VIMs.

0 Kudos
Message 4 of 4
(1,022 Views)