12-09-2011 03:43 PM
I have successfully created a script that creates a number of interop VIs to C# Classes and their methods (with a lot of help from tst & DFGray... Sev had a little in there too).
Now I need to create a script that will create the Polymorphic VI that will wrap all of those.
After I get the new polymorphic created, I want to turn on the "Show Selecttor by default", populate the menu name and selector name, but I can't seem to find the "Target Class" of "PolymorphicVI" to go from the Generic VI Reference to get to the more specific class and thus reveal the properties that I should then have available.
Any hints as to what the "path" is?
Thanks,
Dan
12-09-2011 03:44 PM
Sorry.... forgot Darin... some help there too.
12-09-2011 04:02 PM
The easiest way to get one is to drop a method or property, select VI»PolyVI as the class, then create a constant from the property or method input. You should be good to go at that point.
The PolyVI reference is a subclass of VI reference, which is a parallel class to generic. This is why you do not see it on the standard class constants, which starts with generic.
12-09-2011 04:14 PM
That was it... another head slapping moment. AND I was even doing that (dropping a method and then selecting the class BEFORE wiring) when I was working with the .NET classes that I have been dealing with. For some reason I had it in my head that in scripting you don't (couldn't) do that.
Thanks!!
Exactly what I needed.
12-09-2011 04:17 PM
woops... too excited. I dropped the property node, selected the PolymorphicVI class, saw that I now had access to the SelectorVisible, but as soon as I hooked the ref in to the VI ref, it changed back to the VI class.... What did I do wrong?
12-09-2011 04:22 PM
Yup... so excited, I didn't read all of your post carefully enough.
I missed the part about creating the constant ref from the input of the property node...
By doing that and THEN downselecting to a more specific class, whaddya know, it works.
12-12-2011 09:05 AM
I can now show the selector!!! All is good.
And I also see where I have access to the Menu Name and Selector Name, so believe it or not, I actually do NOT have a question (at this time 😉 ).
I do want to thank everyone who helped with all of my questions last week.
THANK YOU!!!
Dan
12-12-2011 01:04 PM
Is there a way to get a list of the classes and/or methods available in a dll by pointing to either the dll or the directory that the dll resides in?
I feel like I'm putting myself into a catch 22. I want to be able to get a list of all of the classes so that I can create a directory structure for my VIs that I can now create programmatically, but I don't see how I can get that list without having a "seed" vi that already contains a method from the class. The goal is to be able to point to a folder that has one of more dlls in it and get a listing of the class(es) and the method(s) available.
Thanks,
Dan
12-12-2011 02:21 PM
I think you might have two problems here -
Potential solutions:
12-13-2011 07:08 AM
LabVIEW ships with some of this functionality. If you look under Tools»Import»Shared Library (.dll)..., you will find a wizard. Most of the VIs are in <labview>\resource\importtools\sharedlib. There may be some code there you can reuse. I have not done this, so cannot help you if you try.