From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
09-11-2012 12:00 PM
For a portion of a VI that I am building I want to have the user specify the size of a 1D array. The user will then populate the array with information from an Enum control. I want them to be able to move backward and forward in the array to edit or update information as needed, and I want the user to be able to add extra elements to the array after its been created. Anybody know how I could do this?
Thanks,
John
09-11-2012 12:10 PM
All of this can be done with elements in the Array palette. Sounds like a good place to use an Event structure also. Lots of info in this forum and the help files on them. We can answer more specific questions if you're able to post your code.
09-11-2012 12:33 PM
Taper,
This is a portion of the VI I am working on. Right now I have it set at the 10 Enum controls flowing into an array which is then used to make decisions later on. What I'd like to do is rather than having the ten set Enum controls of the front panel, I'd like to have just one Enum control that the user selects from multiple times where each selection is an new element in the array. I'm new to Labview, so any help is appreciated.
John
09-11-2012 01:04 PM
I prefer using listboxes and menu rings for this sort of thing because they're much more user-friendly and look nicer. You can populate a run control from your enum's list of values, and the listbox can be re-ordered once you enable dragging. You can then create an array of values by reading the listbox's Item Names and converting that to your enum value. See attached for an example VI that could be converted to a popup dialog where you provide an initial list, and it returns the modified list (or the original, if cancelled).
09-11-2012 01:08 PM - edited 09-11-2012 01:11 PM
use a shift register to store your data, initialize it with a precondition "off".enter the data using a case statement to an array..can be done a multiple amount of ways?
09-11-2012 01:20 PM
Here is a piece of code that does basically what you want.
09-12-2012 08:39 AM - edited 09-12-2012 08:39 AM
Hey everyone,
Thanks so much for taking the time to post these solutions I really appreciate it. There are some really nice looking codes here, unforutnatly I can't figure out how any of them work. While this is due to my own lack of knowledge/experience, and no fault of anyone else, it does mean I had to try and figure out something else on my own. I'm posting what I've been trying to do using intialize array, insert into array, and replace array subset becasue now I can't figure out why the array continues to remain the same size even after it runs thorugh the insert or replace functions. Ideas?
Thanks again,
John
09-12-2012 09:35 AM
Nevermind, I replaced insert into array with build array. Not totally sure what the difference is, but its working the way I want it to now.
09-12-2012 10:13 AM
You may want to spend a little time looking at the example I posted. It uses the event structure which is the prefered method for handling UIs. Your is a polling system and will consume CPU cycles even when idle. Th eevent structure method will only run when a change has been detected. So, when it is idle the system is idle too.