06-14-2011 10:56 AM
I've got a VI with a 2D array of numeric controls in it. I'd like the user to be able to adjust these controls during runtime. Then, once they shut down the .vi have it save the current values of the array, then on calling, reload the saved values into the controls. I've been able to have it set defaults, but for PID controls it's a pain having to reset the changes you made from the last runtime.
I read another post that had a few suggestions, using .xml's and the like, but I can't figure out how to take the values from the .xml and get them into a control. I can use them to update an indicator, so I guess I'm missing something here.
I've attached the .vi, ignore the main loop, it's the second while loop down. I've attached a picture of the array I'm trying to initialize.
Thanks for any help,
-Ian
06-14-2011 03:22 PM
You need to tell the Unflatten from XML that you want a 2D array of doubles and feed that into a local variable of your array. I would verify that the unflatten succeeded before writing to the local variable and then wire a dependency to the while loop where you use the array to make sure the local variable was written before the while loop starts.