LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Missing functions when importing DLL

Solved!
Go to solution

Hi all,

 

I created a DLL using Matlab.  When I try to import it to LabVIEW (ver 8.6 or 2009), most of the functions do not show up.  Any ideas?  This was done with Matlab R2010a.  I looked through other posts on the subject of Matlab DLL's but they were all concerned with getting anything to work at all.  In my case, some of the functions come through but not all of them.  I tried to attach the files but it wouldn't let me...

 

Thanks and I hope this is something really simple I am overlooking.

 

-Matt

 

 

-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




0 Kudos
Message 1 of 6
(2,967 Views)
Solution
Accepted by topic author MattBradley

OK, I figured it out... It's an annoying Matlab problem (I think). 

 

The issue is that after you import the DLL (and I'm not sure exactly when) -- you can't add more functions to the DLL.  So the first time I tried doing this, I only had one function.  Later, I added more -- but they were just ignored.  I rebuilt it (in Matlab) as a new project, imported the new DLL, and the problem went away.

 

It's also possible that it could be a LabVIEW problem with the lvlib(?) file not updating properly, but I don't really care -- I know how to make it work now.

 

-Matt

-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




0 Kudos
Message 2 of 6
(2,944 Views)

Dear Matt,

 

could you please provide some info on the procedure to succeed in creating the DLL files from the matlab code and use them in Labview?

 

I've been struggling with this for llong but until now, I've had no success...

 

Thank you very much in advance.

0 Kudos
Message 3 of 6
(2,872 Views)

Well ... the bad news is that I was wrong when I thought I had it working.  I did, however, find a way to make it work, but it's kind of a hack.

 

You may have seen that the way to do this is to write a wrapper DLL to call the Matlab DLL.  I worked on that for a long time with zero success. 

 

What I finally did was made all of my Matlab DLL calls have no arguments.  I use files for both the input and output values.  Not very efficient, but it does the job I needed.  No wrapper DLL needed that way. 

 

I use the comma delimited Matlab functions for file IO... I forget the actual names, but if you really need them I can dig them up.

 

BTW, I blame Matlab for making up their own typedefs, not NI.

-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




0 Kudos
Message 4 of 6
(2,867 Views)

Dear Matt,

 

your solution seemed reasonable to me and therefore I tried a very simple matlab code without any input or output arguments and created DLL from it using matlab's deploytool.

 

The thing is that when I call the function mlfTest in Labview after loading the generated DLL I'm getting the error shown on the attached picture.

 

This Matlab-Labview relationship is really troublesome 😞

 

any help?

 

thank you very much in advance.

0 Kudos
Message 5 of 6
(2,864 Views)

Now that I have not seen....

 

Did you call the Matlab Initialize function first?  It's automatically created...

 

Any chance you can post your code, too?

-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




0 Kudos
Message 6 of 6
(2,861 Views)