LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Initialize array control values (Load from file, save to file)

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

Download All
0 Kudos
Message 1 of 2
(3,142 Views)

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.

0 Kudos
Message 2 of 2
(3,126 Views)