LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Numeric ctrl class: Which ctrl type to choose?

Not what he is suggesting.

 

There are VI Methods to get set control value by index. Available by invoke node not property node


"Should be" isn't "Is" -Jay
Message 11 of 18
(911 Views)
Message 12 of 18
(906 Views)

@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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 13 of 18
(905 Views)

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?

0 Kudos
Message 14 of 18
(898 Views)

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.

Message 15 of 18
(895 Views)

 

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:

  • Using "Get control Values by index", I have an average of 1.3µs (over 1M tests)
    VinnyLaTaupe_0-1648749102383.png

     

  • Using the invoke node "Get all Values, I have an average of 3µs
    VinnyLaTaupe_1-1648749198666.png

     

  • And finally, using the "Value" property node, I have an average of .... ~90µs.
    VinnyLaTaupe_2-1648749380841.png

     

0 Kudos
Message 16 of 18
(879 Views)

 

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.

0 Kudos
Message 17 of 18
(863 Views)

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.

0 Kudos
Message 18 of 18
(856 Views)