03-31-2022 10:05 AM
Not what he is suggesting.
There are VI Methods to get set control value by index. Available by invoke node not property node
03-31-2022 10:18 AM
Here are the help topics for the Get Control Value by Index and Set Control Value by Index functions:
Get Control Values by Index Function - LabVIEW 2018 Help - National Instruments (ni.com)
Set Control Values by Index Function - LabVIEW 2018 Help - National Instruments (ni.com)
03-31-2022 10:21 AM
@JÞB wrote:
Not what he is suggesting.
There are VI Methods to get set control value by index. Available by invoke node not property node
Actually, there is a Set Control Values By Index and a Get Control Values By Index function in the Application Control palette. These are supposed to be very highly efficient. You get the index for the individual controls via the Control Index property using a Property Node.
03-31-2022 11:18 AM
Ahhh I see
Both method seem interesting, but I'm not sure yet that the performance gain will be useful for my application (3 graphs and and about 15 numerics getting a new value about every half a second but about 1 to 5 ms between two different numerics updates)
Would it make sense then to store all indexes in a cluster naming everyone of them so that it makes it easier to access?
03-31-2022 11:27 AM
If you're in LabVIEW 2019 or later I'd recommend a map for making the name -> index pairings.
But based on your performance requirements, I doubt you'd need Set/Get Control Value by Index... normal VI Server stuff should be fine for what you need.
03-31-2022 12:57 PM
It is not really the subject of this thread, but I was curious, and this method could actually help me solve some issues I have accessing different data accross my application.... so:
@crossrulz wrote:
These are supposed to be very highly efficient. You get the index for the individual controls via the Control Index property using a Property Node.
I've ran some very quick tests, trying to access 3 values (2 controls one indicator) located in another VI, the results are quite interesting:
04-01-2022 04:51 AM
Valid for your test, but as the VI Server methods require the UI thread, as the traffic in this thread increases within an actual application (as opposed to a benchmark VI), the methods requiring VI Server will fall much further behind and there will be jitter as many different portions of code have to share the access to the UI thread.
04-01-2022 08:39 AM - edited 04-01-2022 08:40 AM
Note that Set/Get Control Value by Index only work when the VI isn't idle (or broken of course).
So, Open VI Reference, Set Control Value by Index, Run VI, Get Control Value by Index won't work.
"Set/Get Control Value by Index" is very specifically mend for very specific optimizations. Don't optimize until you have to.