06-17-2010 10:11 AM
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
06-17-2010 10:16 AM
Just thought of an answer right after posting. I can filter the dash number and feed it to a case statement.
jh
06-17-2010 10:33 AM
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.
06-17-2010 12:09 PM - edited 06-17-2010 12:11 PM
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.
Ben
*"Look Ma, no case structures, or modifying of old code for new models!"
06-17-2010 12:27 PM
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?
06-17-2010 12:28 PM
06-17-2010 12:35 PM
LVOOP = LabVIEW Object Oriented Programming
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