LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Control for strictly typed VI reference from calling VI - conversion

Hi team , 

 

My requirement was need to call one by one (10 to 15 ) different  testcases  dynamically from main VI program during each state execution from main vi . i used call by reference because i can control/ Change parameters . so only i choose call by reference method 

 

i have attached a image . Please see for reference

 

In that image ,

Method 1 : I used a static reference for getting a VI path and VI server class i browsed and choose a particular VI and its connector pane was turned out as a strict reference type . I got the output successful in this method . But for 10 to 15 test cases i am planning for method 2 

 

Method 2 :.  Here i like to put reference only.  10 to 15 test cases  are .there . so i cant create  vi for every test case as like method 1 .  Because i will plan to  call particular vi from main vi . there are so many states in main vi . During their each state execution , i just need to call particular VI ( sub VI ) server class type reference from main VI .

 

It was accepting only the strict type reference only in call by reference . How to convert . ?

 

i used type cast and  tried .  i like to Progress in method 2 only . Please see image for better understanding 

 

please give suggestions for this 

 

Thanks in advance 

0 Kudos
Message 1 of 3
(1,279 Views)

For Method 2, use a strict VI reference constant, just like you did in Method 1.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 2 of 3
(1,254 Views)

Seems like this would be easier to use Object Oriented with Dynamic Dispatch.  Then you can just use a simple Factory Pattern using Get LV Class Default Value.vi to load up the tests you need.  You could then possibly just use a FOR loop to iterate over the tests you created.


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
0 Kudos
Message 3 of 3
(1,243 Views)