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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Save array control to .cfg with property nodes.

Solved!
Go to solution

Hi there!

 

I have a front panel with many (and I mean many!) boolean arrays in tabs, and I want the option to save the values selected by the user to a .cfg file, which will be used to make the same selection again without the tedium of clicking on buttons. The only controls I want to save the value of are 1D boolean arrays of length 7 or 11, and these occur only on some of the tab pages; the others have been setup so that on their iteration a false criteria is met and no code executes.

 

I have managed to get references to each control in each tab, and using a 'more specific class' function to narrow it down to Array controls only. However, when this runs, an error from 'convert variant to data' pops up, and use of a probe tells me the reference being called by my property node at the time of the error is that of an array INDICATOR, rather than a control. I thought the 'controls on page' node and subsequently the array control class specifier would mean that references for other types of array wouldn't make it into the true case where the saving to config file happens.

 

The indicator in question is an array of a cluster of two strings and a string array, if that makes any sense/has any relevancy, and the error occurs on iteration 1 of the outer loop and iteration 21 of the inner loop, corresponding to the 22nd control reference from the second tab.

 

I hope I've made the problem clear.

0 Kudos
Message 1 of 4
(2,845 Views)

Okay as soon as i posted it i realised that controls on page returns controls and indicators. Any way to seperate these so that only controls are referenced?

0 Kudos
Message 2 of 4
(2,841 Views)
Solution
Accepted by topic author smakaroony

There is a property called Is Control? (or Is Indicator?) that will help you sort them out.  I do not recall the exact name of the property but that should get you close enough to find it.

 

Lynn

Message 3 of 4
(2,815 Views)

Yep there's an 'Indicator' property, thanks very much!

0 Kudos
Message 4 of 4
(2,805 Views)