LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Change values of an Array of Cluster

Hello
I've got a question about changing a value of an cluster. I have created a cluster, where the user can do some input. This input I store in an array of clusters. But how can I manage it, that the user can change a value of a certain row for example I will change the 5th input-cluster in the 1D Array and write the changes back to the array.
Can anybody give me some tipps? Thanks a lot 😉
0 Kudos
Message 1 of 5
(3,136 Views)
The user selects from a list an object associated with an element in the array (e.g. a pull-down menu of names). You read changes in the selection and when they happen you read that index of the array using array subset and fill a cluster on the control panel or unbundle and fill separate controls...

Now - If the user is doing the editing on a separate set of controls then continously (or when he hits a save button, moves to the next object or similar) bundle them back into a cluster of the correct type and replace the given array index using the replace array subset function.

If the user is operating on a cluster of the same type as in the array just do the replace array subset.
0 Kudos
Message 2 of 5
(3,136 Views)
Thank you for your answer. But I don't understand how it will work with the object associated to my element in the array. Can you please give me an example? Thanks a lot!
0 Kudos
Message 3 of 5
(3,136 Views)
OK, I through some code together that will illustrate how it can be done...see attached code - run the example.vi in the llb. In the example I use spearate controls, you could simplify it by using a cluster instead.

I would improve the example quite a bit if it were something to be used and add the possibility to add and delete elements, make a VI that reads and writes the cluster from a configuration file if it's a setup that needs to be saved etc etc...But you get the idea.

Mads
0 Kudos
Message 4 of 5
(3,136 Views)
Thank you Mads

An example says more than 1000 words 😉
0 Kudos
Message 5 of 5
(3,136 Views)