01-13-2025 02:21 AM
So I want to have a 1d array of clusters containing two elements: a button and a string control. These buttons should delete elements from a 1d array if they are off, and keep them if they are on. The string control should display the unique elements occuring in the 1d array. There will only be about 5-6 unique elements with duplicates occurring so it can fit on the front panel with ease. I imagine it looking something like this. Since C,D and E are the only ones that are turned on, they are the only elements that exist in the output array. How do I implement this? I am not sure how to populate the array of clusters with the unique elements programmatically.
01-13-2025 02:32 AM
If Array 3 contains all elements it's very simple, just loop through Array 3 and extract the string with a Conditional output, Done.
01-13-2025 02:47 AM
Yes if it contains the elements I can do that, but how do I populate it programmatically? It will start off as an empty unitialized 1d array of clusters.
01-13-2025 02:59 AM
Hi Asasafuchi,
@Asasafuchi wrote:
but how do I populate it programmatically? It will start off as an empty unitialized 1d array of clusters.
By writing data to this array of clusters.
Where does the data come from???
01-13-2025 03:03 AM
Hi Gerd,
The data will come from a 1d array containing all unique elements that appear in the 1d array containing all elements. The goal is first to populate the 1d array of clusters with the unique elements in the strings and set all button controls to true as default. After that I want to be able to use the buttons to delete elements from the original array and display the output array.
01-13-2025 03:18 AM
Hi Asasafuchi,
@Asasafuchi wrote:
The goal is first to populate the 1d array of clusters with the unique elements in the strings and set all button controls to true as default. After that I want to be able to use the buttons to delete elements from the original array and display the output array.
use Yamaeda's suggestion, but only in the reverse order. Use BundleByName instead of UnbundleByName in the loop!
01-13-2025 03:46 AM
Hi Gerd,
I don't really understand how this could be done in reverse since I need to first populate the array of cluster with the unique elements and set all buttons to true. so the 1d array of cluster will be changed dynamically. Could you attach a vi showing how this could be done in reverse?
01-13-2025 04:10 AM - edited 01-13-2025 04:11 AM
You probably want an Event structure and such for a better UI, but this should give some ideas.
01-13-2025 04:21 AM
Thanks! This seems to populate the array correctly but turning the buttons on/off do not change Array 2. Are your buttons working?
01-13-2025 04:21 AM