LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Get Set Control Values by Index

In words or code example, how are these VI's used in a project? Get Set Control Values by Index Per the Help and post I've see that using "Values by Index" are much faster (~100) than using the property node (UI thread) because they write to the BD terminal. I foresee using "Panel" property on initial running to get the "Control Index" and likely "Control Name". Then I foresee conversion from variant to data, data to variant and I noticed LV2015 has "Data Type Parsing" folder to handle Variant data. Also read some various Help & post on saying "the extra programming effort" needed to deal with using Index. Did I get this all correct here? Rich J
0 Kudos
Message 1 of 5
(4,477 Views)
OK, after toying with the Get Set Values by Index, I see no need for the "Data Type Parsing" to handle Variant data. Therefore, on initial startup get&keep the name, index number and datatype of FP controls, of interest, that is needed to Set or Get to handle Variant Data conversion. Use the Variant to Data or Data to Variant to set/get FP controls using Index value. Did I get this right in a nutshell so to speak? Rich J
0 Kudos
Message 2 of 5
(4,459 Views)

Yes, you've got the right idea. One minor tweak is that you don't need to use the To Variant function, you can wire any data type to the 'Set Control Values By Index' function, and it will be coerced.

0 Kudos
Message 3 of 5
(4,441 Views)

The real question is whether you have a need for this. I have a few specific use cases (such as code which updates many controls by label, and today does it by defer->set values->undefer, where this would be a very practical replacement), but it's probably something you would use relatively rarely.


___________________
Try to take over the world!
0 Kudos
Message 4 of 5
(4,420 Views)
Thanks for the tip, Did anyone notice the order of the Control_Index is descending example index 0=2, index 1=1, index 2=0. This doesn't match the Label.text property if you wire Label.text array. A quick fix is to reverse the Control_Index values you get from Panel[array] so they match other Panel[array] properties on initialization. Your then free to use search by label text selecting the correct index or write initialization FGV to remember index value arrays that need speeding updating. Obviously using any FP property with these (Values by Index) setting would bottleneck the speed. The complexity appears to creep up when you handle arrays inputs of the function to set many control still quite doable. My 2 cents. Rich J
0 Kudos
Message 5 of 5
(4,392 Views)