LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI behavior similar to .NET class

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.

0 Kudos
Message 1 of 18
(2,781 Views)

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.


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 18
(2,776 Views)

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?

0 Kudos
Message 3 of 18
(2,759 Views)

@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.

0 Kudos
Message 4 of 18
(2,753 Views)

@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?


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 18
(2,748 Views)

For some insight please see http://robotraconteur.net .  It uses a dynamic proxy generation system for different connection types.

0 Kudos
Message 6 of 18
(2,745 Views)

Please check your link; that site appears to be a generic domain-registration page serving advertising.

0 Kudos
Message 7 of 18
(2,743 Views)

Huh, must be out temporarily.  Here is a direct link:  http://robotraconteur.sf.net

0 Kudos
Message 8 of 18
(2,737 Views)

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).

0 Kudos
Message 9 of 18
(2,731 Views)

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#.

0 Kudos
Message 10 of 18
(2,727 Views)