06-22-2022 07:43 AM
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.
06-22-2022 07:57 AM
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
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
06-22-2022 08:15 AM
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.
06-22-2022 08:23 AM
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.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord