I've got a 1D array of double data that I need to dynamically put into clusters of various composition. Some of them contain a few controls, some contain many. See photo below for example.
We wrote some really nice code using property nodes to dynamically determine the composition of cluster and data types and inserted the appropriate data from the array into the cluster. It would look at the control type, and pull out the appropriate double fields from the array, do any necessary conversions, and then put them into the cluster. However, it was all for naught as we eventually found out that none of that works because you can't use property nodes to read and write values to controls on a RT system.
I tried to re-write everything using variants and all kinds of Vis in that palette, but it was too slow for our application and some of those VIs also didn't work on RT system.
The cluster is important because it defines the shape of a message that is then send out using some other VIs on the RT target, and the adherence to this structure is pretty strict (i.e. cluster must be exact, even down to array size).
The best solution we have now is to use a constant of the cluster and put data into the cluster constant using bundle by name by hand, but this is very time consuming and prone to error (we have over 100 different clusters).
We've also considered using a constant in a non-running VI and VI scripting, but not sure if that will work on RT target or not.
To break it down into pseudo code:
1. Pass in generic cluster.
2. Iterate through each element within cluster in order.
3. For each element, determine data type and/or number of values necessary.
4. Remove data from array that is needed for the element, format appropriately, and insert into cluster element.
5. Move on to next cluster element.
6. Repeat until end of cluster.
Here is a stripped down example of how were trying to this using property nodes.
![SampleArray2Cluster.PNG SampleArray2Cluster.PNG]()