LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What's the best way to package a DLL for integration with LabView?

My company markets DLLs which export a C API. We would like to provide a way for customers who want to call our API from LabView with a way to import the entire API into LabView (with close to zero effort), instead of having each customer manually import the API one function at a time. We have done this for a number of other languages, such as Delphi, by providing a "native language module" which does what's required (for instance, declare the proper function prototypes for the language). The developer simply includes the module in their project and then calls the API in their code.

My question is, what's the best approach for providing such a "native language module" for LabView? As a LabView dev
eloper, what would you like to see a DLL interface package contain?

Dave
0 Kudos
Message 1 of 4
(2,777 Views)
What I like to see is a .llb (LabVIEW library) with VIs for all of the functions in the DLL. I have made a few of these for our own DLLs and it makes it easier for all the LabVIEW programmers (yes, we have people trying LabVIEW for the first time in our shop) since they do not have to know the prototype for the function.

Rob
0 Kudos
Message 2 of 4
(2,777 Views)
> My company markets DLLs which export a C API. We would like to
> provide a way for customers who want to call our API from LabView with
> a way to import the entire API into LabView (with close to zero
> effort), instead of having each customer manually import the API one
> function at a time. We have done this for a number of other
> languages, such as Delphi, by providing a "native language module"
> which does what's required (for instance, declare the proper function
> prototypes for the language). The developer simply includes the
> module in their project and then calls the API in their code.
>
> My question is, what's the best approach for providing such a "native
> language module" for LabView? As a LabView developer, what would you
> like to see a DLL interface package contain?
>


It is great that you are looking to do this. Many providers assume
that there is nothing easier than calling a DLL, so why do anything
else.

The simplest thing to do is to take each entrypoint that you need to
export and build a wrapper VI. A VI is the code module/function
equivalent within LabVIEW. A VI has a diagram where you will drop
a Call Library Function node, fill out the parameter and other
calling convention info using a dialog. Then you build a panel for
the VI. A panel is an interactive dialog with numerics, text, buttons,
or whatever so that the user can interact with the VI or watch calls
more easily. It is also nice to add a description for the inputs
and outputs so they are online. Then build a simple icon for the
function and connect the inputs and outputs to the icon.

The function wrappers can be saved in either a folder or in a llb,
a LabVIEW Library. You can build a custom menu to arrange the
functions other than graphical if you like.

The easiest way to get started on this would be to contact any
customers that may have already started the job. There are quite
a few examples of other libraries integrated into LabVIEW, plus it
is the same way that most I/O from NI is hooked in. One place to
look might be the DDE VIs in LabVIEW.

Depending on the function entries in the DLL, sometimes it is easier
to combine some of them using additional parameters. Each parameter
in a VI can be required, recommended, or optional. Each parameter
always has a default value, so it is very common to have fewer
functions with a few extra optional parameters.

Greg McKaskle
0 Kudos
Message 3 of 4
(2,777 Views)
Hi
I currently became a fan of COM. It may be a little more effort on your C-side, but MS and BL have builders for it. And in LV it is simply great. Your customers see all functions and paramters to select from.
And once you have done it for one language interface, you've done it for all.
Gabi
7.1 -- 2013
CLA
0 Kudos
Message 4 of 4
(2,777 Views)