03-23-2020 11:51 AM
I would like to be able know which cluster was changed in the array of clusters. The user can change any cluster now, but I would like to limit it to one cluster and pass that cluster back as an output. Is there a way to know which array element is selected? If so, I could create a sub-VI that would show and allow the user to change that cluster. It would be best if I could get the array index when displaying an indicator array instead of a control array.
Solved! Go to Solution.
03-23-2020 12:01 PM
Just compare the previous array value to the current using a Equals set to Compare Elements (right-click option). Then use Search 1D Array to find the first FALSE value. You now have the index of the changed cluster.
03-23-2020 12:17 PM
I would like to be able to change one cluster at a time.
I am actually displaying an array of indicators. Now, I can use a Mouse Down event to select the entire array, but I cannot figure out how to know which cluster was clicked on. The code snippit that I attached was the sub-VI called by the event handler.
03-23-2020 12:34 PM
Hi Steven,
@StevenHunter wrote:
I would like to be able to change one cluster at a time.
I am actually displaying an array of indicators. Now, I can use a Mouse Down event to select the entire array, but I cannot figure out how to know which cluster was clicked on. The code snippit that I attached was the sub-VI called by the event handler.
Present this array of clusters as a (multicolumn) listbox to the user.
When the user selects an item in the listbox you get the value of the listbox to index your cluster from the array for further manipulation…
03-23-2020 05:04 PM - edited 03-23-2020 05:05 PM
First you said you wanted to know which culster (i.e. array element) was changed, later you said you wanted to know which element was "moused".
For a value change, here's what I typically use with arrays of mixed clusters:
03-23-2020 07:19 PM
The reason that I suggested a mouse-down to select a cluster to edit with another VI is that some of the cluster elements are strings. They give an event for every keystroke if you use Value Change events.
The suggestion to use a Multicolumn Listbox is interesting also. There is a Focus Row property that can be used to index the correct cluster, if I can just figure out how to use a Multicolumn Listbox. I had not heard of them before today.
03-23-2020 08:12 PM
@StevenHunter wrote:
... some of the cluster elements are strings. They give an event for every keystroke if you use Value Change events.
Only if they are configured to "update while typing", though.