LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I Open a Vi reference to and run a Polymorphic VI?

In my case, I was trying to use a PolyVI Refnum to an instance of PID.vi. Even though I set the inputs for some of the controls, I have no output.the Invoke Method of 'Run VI' does not return an error. The Invoke Method of Ctrl Val. Get All does not return an error, but also returns an empty array on the character array.

 

The problem seems to be with how VI server handles PolyVI Refnums, the constant for Polymorphic VIs. There does not seem to be an explicit way to determine which instance of the polymorphic VI should be used.

Consequently, 'Ctrl Val.Get All' does not return any results from a 'Run VI' call. The array size is #0.

 

Any ideas on what might be going on? Is there a better way to use a PolyVI Reference with VI server calls? I can't use Call By Reference Node since I can't seem to strictly type a Polymorphic VI (I can't select that check box on the Static VI Reference).

0 Kudos
Message 1 of 2
(2,236 Views)

Polymorphic VIs are an edit-time feature. They make no sense in run-time. Since you know at edit time which VI from the polymorphic group is actully going to be used, just open a reference directly to it. The polyVI itself only keeps a list of all the VIs that belong to it.


___________________
Try to take over the world!
Message 2 of 2
(2,222 Views)