LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI behavior similar to .NET class


@john83793 wrote:

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


It is being recompiled every time you change something in the VI that is other than cosmetic.  That's why you get the broken arrow right away, instead of having to click the "compile" button to see if everything is okay in other languages.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 11 of 18
(1,341 Views)

@john83793 wrote:

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


As previously mentioned, LabVIEW is always compiled.

 

I'm not usually a Microsoft fan, but it is unlikely that an incomplete product from a small research team is "far more powerful" than a mature technology developed and supported by Microsoft for years.  It might be accurate to say they have different strengths.

 

Are you asking if there's a way to provide access to a DLL through an interface that resembles the one used for ActiveX, .NET, and VI server?  There is no way to do this.  The only way to call functions in a DLL is through Call Library Function Node.

0 Kudos
Message 12 of 18
(1,330 Views)
Actually, ActiveX was a stop-gap bandaid that Microsoft will soon drop. .NET and the CLR were technologically years behind but the eventual holy grail of inter process exchange.

I wonder what lifespan it will have. G of course will still be around with still more expanded features.

"Should be" isn't "Is" -Jay
0 Kudos
Message 13 of 18
(1,326 Views)

ActiveX is quite clumsy and limited in its capalibities.  Writing an ActiveX server is very complicated and not portable to different operating systems and devices.  Robot Raconteur is targeted specifically for automation systems and can run a server on very limited embedded devices that do not run an OS or on a full computer.  My question on this forum is specifically about using LabView.  It has been fairly easy to integrate with MATLAB and I'd like to do something similar with LabView.

0 Kudos
Message 14 of 18
(1,321 Views)

I'm still a bit confused as to what you're trying to do.  When you write, "It has been fairly easy to integrate with MATLAB" - what is "it"?  Are you trying to integrate RobotRaconteur with LabVIEW?  The website makes it appear that LabVIEW is already supported, through .NET.  Or, are you citing RobotRaconteur as being similar to your library?

 

Can you share any actual code, perhaps in MATLAB if not in LabVIEW, or a diagram of what you're hoping to have appear in LabVIEW?

 

It sounds like what you want to do is write a .NET class instead of a C++ library, so that you can access it in LabVIEW through the .NET interface.

 

The only way in LabVIEW to have a VI adapt to its inputs is to use a polymorphic VI, and even then the ability is limited to the specific instances of the VI that have been defined.  An example is the config file VIs - the Config File Read will adapt to the datatype that is wired to it, so long as its one of the supported datatypes.

0 Kudos
Message 15 of 18
(1,314 Views)

When you write a Simulink S-function, you define a function mdlInitializeSizes in C that allows you to arbitrarily change the number and types of input and output ports using C.  In the rest of the functions you get raw pointers to the input and output data.  This allows the blocks to be customized at runtime based on the parameters and connections of the blocks.  I'd like to do something similar with LabView however I am not sure how this can be done.  There is the raw DLL interface and CIN, but I don't know if they can provide the same capability.  The VI scripting would be useful but I don't expect most users to have that available because it is part of the very expensive package.

 

0 Kudos
Message 16 of 18
(1,310 Views)

I need a much more specific description of what you're trying to do in order to provide any more help.  That means function prototypes for the DLL functions you're trying to call, an example series of calls to those functions, code from another language in which it's already working.

 

Your first post started by asking about a way to change the number of inputs and outputs at edit-time, similar to the .NET interface.  Your last post mentions changing the number of inputs and outputs at runtime.  Which is it?

 

Any function in a DLL that you can call from MATLAB, you can probably also call from LabVIEW, so long as that function does not in turn call functions that are specific to the MATLAB environment.

 

You can work with raw pointers in LabVIEW.  You would probably not want to expose them to your users, but you might work with them within the VIs that you supply.  If you have not already seen it, you may want to start with Calling C/C++ DLLs from LabVIEW.

0 Kudos
Message 17 of 18
(1,296 Views)

Perhaps describing why you want this will make it clearer. 

 

There are two elements to the .net jnterface.

 

Property Nodes: These are expandable nodes to set different properties, you can make your own if you package your code into a LV Class. 

 

Invke Nodes where you select a function to run and see the inputs and outputs. It depends what you want from this, in terms of selecting methods polymorphic VIs kind of do this, but it is more normal in LabVIEW just to have the functions on the palette. If it is the terminal names you can right click on a subVI and press view as icon. This gives a view similar to express VIs but this means it takes a lot of space. 

James Mc
========
Ask me about Rust & NI Hardware
My writings are at https://www.wiresmithtech.com/devs/
0 Kudos
Message 18 of 18
(1,279 Views)