LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a DLL using LabView for use in a C++ application that contains Imaq Vision VIs

Can I create a DLL using LabView for use in a C++ application that contains Imaq Vision VIs.
 
I have a image processing algorithm that uses vision vis.  When I build into a DLL, the C++ app gets nothing.  No errors.  Nothing.  It simply does not work.  The target machine has a valid runtime vision license.
 
 
0 Kudos
Message 1 of 4
(3,006 Views)
Hi Tinman,

You should be able to create such a DLL.  I'm not sure exactly why you are seeing the behavior that you are seeing.  One thing to note is that you can program directly in C++ using IMAQ and Vision.  You can find the function reference help by going to Start»Programs»National Instruments»Vision»Documentation»NI-IMAQ»NIIMAQFunctionReference.chm
Also, I am curious to know if you are able to get any DLLs built in LabVIEW to execute in C++.  Have you had similar issues with simpler programs?  If there is a deeper underlying cause, simplifying the program would help point out the cause of problems.  Try making something very simple, like a control and an indicator, and see if you are able to call this.
Wes Pierce
Principal Engineer
Pierce Controls
0 Kudos
Message 2 of 4
(2,963 Views)

Hello

 

Yes I have made simple DLLS in LabView that can be called by C++.  I can pass in arrays, modify them etc..  All is well.

If I use any IMAQ Vision VIs the DLL builds fine but it does not work.  No errors.  No blow ups just nothing. 

I have written several test DLLs. The latest one is simply a wrapper for Get Centroid VI.  I take an array of unsigned bytes, and the rows and columns.  I change the array into a 2d array using the row and column ifo.  I create an Image in the DLL Vi, then I convert the 2d array to an image.  I then pass that to Get Centroid.

This is just a simple VI to prove to management that LabView can do this.  The vision VI we will wrap is much more complex.  Rewriting this in C++ using Vision functions would take some time.

 

0 Kudos
Message 3 of 4
(2,952 Views)
Hi Tinman,

One thing that you need to be sure of is that you have the correct versions of the LabVIEW and the Vision Run-Time engines installed.  It sounds like you have the correct version of the LabVIEW Run-Time engine installed, since you were able to run a DLL that you created without Vision.  I would make sure that you have the version of the Vision Run-Time engine installed that matches the version of NI-Vision that you used to develop the DLL.  You can go to Drivers and Updates on the NI website to search for the Vision Run-Time engine.
Wes Pierce
Principal Engineer
Pierce Controls
0 Kudos
Message 4 of 4
(2,935 Views)