LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
Mr._Jim

Set Control Values by Index - Multiple Indexes, One Value

Status: New

Hello again,

 

Using control indexes makes for very powerful UI management.  I am a huge fan.

 

 

I frequently want to update several controls with the same value, but the "Set Control Values by Index" has two polymorphic cases (that I know of):

  1. One index, one value
  2. Multiple indexes, multiple respective values

 

How about a third case?:

3.  Multiple indexes, one value

 

What I do now:

now.png

 

My proposed polymorphic case:

proposed.png

 

It's a tiny little change, but it's a case I'd use all the time.

 

Thanks as always,

 

Mr. Jim

4 Comments
richjoh
Active Participant
Same problem with Get Control Value by Index only accepts an array for the Index Array although the Help says it should morph to single or multiple (array) input. Connect a single index number and the broken wire appears "connected a 1D array(U32) to a (1 value) U32 value. This action forces me to create a new array for the input although I'm only reading 1 value.This is Labview 2015. Is this the expected implementation for "Get Control by Index"? Rich J
AristosQueue (NI)
NI Employee (retired)

richjoh: I see nothing in the help that says this should polymorph to a single value input. Can you tell me where you are seeing that help? I checked both the Context Help for the node and the detailed help. Neither one mention any polymorphic behaviors.

 

The text for that specific terminal says: "control indexes specifies an array of indices of front panel controls for which you want to get values. Use the Control Index property in the Control class to retrieve control indexes."

The array implementation is the intended behavior of Get Control Values by Index. I highlighted the "s" to emphasize the plurality. Whether it is the "expected" behavior is something you have to be the judge of. 🙂

richjoh
Active Participant

First sentence out of the Set or Get Control by Index context Help quote - "Set Values to one or more controls for the VI you reference".

 

A polymorphic case should handle the single case but does not, result broken compile.

 

Rich J

 


 

AristosQueue (NI)
NI Employee (retired)

Ah. I see the conflict. Yes, it says one or more, and that's accurate because the array can contain a single item. You see that as implying that it takes a singular value. I wasn't reading that as having that implication, but I can see why that makes sense.

 

I'll file the CAR to change the Context Help to "Set Values for the controls in the VI you reference". We can at least get that cleaned up easily. I don't know about the polymorphism... not my area of knowledge.