12-28-2012 12:59 PM
Is it possible to develop a VI that has behavior similar to the .NET class system? I'd like to have a VI that changes the number of inputs and outputs based on the connection to the reference and the selected member function. I am wrapping a C++ library so I will need to access those functions based on what the VI settings are.
12-28-2012 01:40 PM
I'm not sure I completely understand you but. VIs have exactly 1 connector pane that must be defined during development and cannot change at runtime with the exception of dynamic dispatch vis which must all have the same connector pane pattern.
That said there is the possibility to create a polymorfic vi that you can use to select one of several related but different instance vis. These instance vis CAN have different connector panes. Again, the instance vi must be known during development but, this might be what you want.
12-28-2012 03:12 PM
Is it possible to generate a VI using a Python script or something similar? As there some sort of XML format that can be modified?
12-28-2012 04:08 PM
@john83793 wrote:
Is it possible to generate a VI using a Python script or something similar? As there some sort of XML format that can be modified?
No.
The standard way to wrap a DLL is to create one VI for each function in the DLL that you want to call. LabVIEW has an "import shared library" feature that can sometimes create these VIs for you. If you want a single VI to access all the functions, build the separate VIs first, then combine them all as instances of a polymorphic VI. Note that LabVIEW can only handle standard C datatypes, and structures built from them. If functions in the DLL use C++ specific datatypes (classes) then you cannot call those functions directly from LabVIEW.
12-28-2012 04:29 PM
@john83793 wrote:
Is it possible to generate a VI using a Python script or something similar? As there some sort of XML format that can be modified?
It is possible to script vis into existance. You can use the VI Scripting VIs and functions to create, edit, and run VIs
programmatically. It requrires that LabVIEW development system on the machine with scripting enabled (A non-default enviornment variable). I do not see the benefit of attempting to go all the way into the darkest guts of LabVIEW and duplicate the lowest level if the IDE from some outside enviornment If that is even possible. I would suspect that would work poorly at best and, you need the IDE anyway so using LabVIEW to write G code sounds like a better approach. On disc VIs are saved in a binary format (Compiled) so its even theoretically possible to generate Binary.vi and let the RTE attempt to run it but I wouldn't want to go there....and there would be some attourneys knocking on your door if you did.
On the other hand. LabVIEW projects can be built as .NET assemblies to be called from Python scripts Is that more like what you want to do?
12-28-2012 04:56 PM
For some insight please see http://robotraconteur.net . It uses a dynamic proxy generation system for different connection types.
12-28-2012 04:58 PM
Please check your link; that site appears to be a generic domain-registration page serving advertising.
12-28-2012 04:59 PM
Huh, must be out temporarily. Here is a direct link: http://robotraconteur.sf.net
12-28-2012 05:16 PM
Sorry, it might be that I'm unwilling to take the time to look through all the documentation on that site, but I don't fully understand what they're doing and I do not see how this relates to your question. The summary contains inaccurate comments such as the implication that LabVIEW is not compiled (it is compiled) and the suggestion that ActiveX is a language (it is not, and in fact as far as I can tell it was designed to solve exactly the same problem that RobotRaconteur is trying to solve - a language-agnostic interface to a given software component).
12-28-2012 05:39 PM
LabView can be compiled, I am not aware that it is compiled if you run it on windows. Robot Raconteur is somewhat like ActiveX but far more powerful. I am looking to develop something similar to the class interface that LabView provides for C#.