LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Selecting one of many VIs

I have a couple of VIs which are both packed with typedefs controls having about 20 items in them. As is I can easily switch between the 2 using the model dash number fed through a selector. Now there are many models and thus many VIs to choose from based on the model dash number.

 

How would you veteran wire coders handle that?

 

 

thanks,

 

jh 

0 Kudos
Message 1 of 7
(2,664 Views)

Just thought of an answer right after posting. I can filter the dash number and feed it to a case statement. 

 

jh

0 Kudos
Message 2 of 7
(2,662 Views)

jvh75021 wrote:

I have a couple of VIs which are both packed with typedefs controls having about 20 items in them. As is I can easily switch between the 2 using the model dash number fed through a selector. Now there are many models and thus many VIs to choose from based on the model dash number.


 

 Sorry, I am not familiar with your terms. What is "packed"? What is the meaning of "easily switch" in this context? What is "model dash number"?
 
Could you post an simplified example for clarification? 
 
If you want to run different VIs based on some selector, you could call by reference node and select from an array of VI references. 
 
0 Kudos
Message 3 of 7
(2,646 Views)

altenbach wrote:

jvh75021 wrote:

I have a couple of VIs which are both packed with typedefs controls having about 20 items in them. As is I can easily switch between the 2 using the model dash number fed through a selector. Now there are many models and thus many VIs to choose from based on the model dash number.


 

 Sorry, I am not familiar with your terms. What is "packed"? What is the meaning of "easily switch" in this context? What is "model dash number"?
Could you post an simplified example for clarification? 
If you want to run different VIs based on some selector, you could call by reference node and select from an array of VI references. 

Or just write it using LVOOP at let Dynamic Dispatching* do all of that for you. Smiley Wink

 

Ben

 

*"Look Ma, no case structures, or modifying of old code for new models!"

Message Edited by Ben on 06-17-2010 12:11 PM
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 7
(2,629 Views)

altenbach wrote:

jvh75021 wrote:

I have a couple of VIs which are both packed with typedefs controls having about 20 items in them. As is I can easily switch between the 2 using the model dash number fed through a selector. Now there are many models and thus many VIs to choose from based on the model dash number.


 

 Sorry, I am not familiar with your terms. What is "packed"? What is the meaning of "easily switch" in this context? What is "model dash number"?
 
Could you post an simplified example for clarification? 
 
If you want to run different VIs based on some selector, you could call by reference node and select from an array of VI references. 
 

packed with: contains many
easily switch: Using the selector function is an easy way to choose when there are only 2 choices.
model dash number: Variations of a part number after the hyphen, for example: jvh1234-01, jvh1234-02, jvh1234-14, etc. Dash is another word for hyphen. I think it is a common idiom in the United States to call the the part of a model number after the hyphen the dash number. The ones I have above we would call "dash Oh(or zero) 1", "dash Oh 2", "dash 14" when the basic model number is understood.
 
Sorry, I am not allowed to post the VIs. 
 
How would you select from an array of references, would it be 2 dimentional? 

 

0 Kudos
Message 5 of 7
(2,621 Views)
Pardon my ignorance but what is LVOOP?
0 Kudos
Message 6 of 7
(2,619 Views)

LVOOP = LabVIEW Object Oriented Programming

 

See here.

 

Somewhere in that list is a link that will show how Dynamic Dispatching can be used to handle multiple models of a widgets and how Dynamic Dispatching can be used to to automatical call the version of code that is appropriate for the widget being tested. 

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 7 of 7
(2,615 Views)