LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Actively changing number of elements in an array

Solved!
Go to solution

How do you use a control in the front panel to actively change the number of rows in an array which full of numeric controls?

Is it possible to have this happen without the program to be running? Thanks for any help.

0 Kudos
Message 1 of 6
(3,339 Views)
Solution
Accepted by topic author Chris B.

I suspect this is a GUI issue, and you're not actually talking about adding / subtracting array elements . (??)

 

To change the number of visible elements on an array control: Create > Property Node > Number of Rows. Write a number to that node.

If it's arranged horizontal, use Number of Columns.

 

Richard






0 Kudos
Message 2 of 6
(3,331 Views)

Chris B. wrote:

Is it possible to have this happen without the program to be running? Thanks for any help.


So you want this to work at edit time? Are you talking about the number of visible elements or are you talking about the actual size of the array (these numbers are unrelated!).

 

In order for something to happen, "something" needs to be running. You could run another VI and use scripting to make changes to the array structure.

 

You could also make an Xcontrol containing an array and a numeric. Xcontrols are fully operational even if the VI itself is in edit mode.

 

If this is a program to run standalone, simply make sure the program is always running, but is in an idle state if nothing needs to be done at the moment. Now you can handle resize events if needed.

0 Kudos
Message 3 of 6
(3,322 Views)

I would like the user to first type in the number of coordinates they want to input. Then the array where the user types in the coordinates is resized and only shows the number of rows they specified.

0 Kudos
Message 4 of 6
(3,307 Views)

@Chris B. wrote:

I would like the user to first type in the number of coordinates they want to input. Then the array where the user types in the coordinates is resized and only shows the number of rows they specified.


As mentioned, this is most easily done when the program is running.

Why do you have a requirements that this needs to work in edit mode? That simply makes no sense.

 

Assuming it is sufficient if it works when the VI is running, you already have the answer with the property nodes. Have you tried? Where did you get stuck?

 

(Of course you also need some input checking in order not to accidentally show a million rows. ;))

0 Kudos
Message 5 of 6
(3,295 Views)

Ahh, thanks a lot for your help. I didn't know there was a "change to write" option.

0 Kudos
Message 6 of 6
(3,291 Views)