LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Could someone please post a simple Matlab DLL with source and a sample VI?

We're looking for a simple example of a .dll compiled in Matlab that works.
Something like 'add2numbers.dll' would be awesome.
All source files, please.
Thank you!
-abs
0 Kudos
Message 1 of 6
(7,144 Views)

When you say a DLL compiled in Matlab, you mean a Mex file or a DLL obtained by Real-Time Workshop? If it is just a Matlab question, maybe you could have better support through the MathWorks website.

If you are trying to use LabVIEW and need some functions from Matlab, you have in LabVIEW 8.2 FDS and PDS the Mathscript Node that allow you run m files in LabVIEW. Also, it has a awesome range of math functions available to do math, signal processing and control directly in LabVIEW and, most important, it is pretty easy to use a DLL in LabVIEW...Smiley Happy

Barp - Control, Simulation, RTT and HIL - National Instruments
0 Kudos
Message 2 of 6
(7,136 Views)
Basically, our signal processing team uses Matlab to develop tools for our applications written in LabView. We package the vis into executables for distribution.

The complexity of converting .m files into .vis has been increasing with the complexity of our signal processing. So far, LabView has always had the necessary components for the job, but we're losing weeks in the conversion process. And making modifications is giving me headaches.

Unfortunately, Mathscript doesn't have all the functions we need, yet.

LabView handles .dlls very well. MatLab Deployment Tools and/or MCC command can be used to create .dlls. A wrapper is required to handle type-casting... But so far, we've met with nothing but unhandled exceptions.

We've posted similar questions with MathWorks, because, yes, this problem is 90% how to build the .dll properly for LabView use.

Thanks to dsavir, who has posted a big package, which we'll be working with. But I was wondering if anyone has a simple .dll we could use as a baseline for figuring out how to make this work.

Thanks!
-abs



0 Kudos
Message 3 of 6
(7,127 Views)
Hi absize,
 
This may sound obvious, but I assume you have the MATLAB runtime engine installed on the machine you are attempting this with. Did you use mcc to compile the MATLAB DLL or something other means (Real-Time Workshop, etc)? There was a good suggestion in the post you mentioned -- that is, compiling the code as an executable first and making sure it runs from the command line. I also find a potentially useful link with a simple example:
 
 
This example calls the DLL from Visual Studio, but I suspect we can call from LabVIEW as well. Unfortunately, I do not have immediate access to MATLAB to compile and try this out (nor do I have the runtime engine installed).
 
Also, if this is just too painful is there any reason you cannot use the MATLAB script node (different from MathScript)? I hope this helps some,
Charlie S.

Visit ni.com/gettingstarted for step-by-step help in setting up your system
0 Kudos
Message 4 of 6
(7,109 Views)

Hello,

 I have a mexed DLL can i run that in Labview

0 Kudos
Message 5 of 6
(5,679 Views)

Hi coolitsmaddy@rediffmail.com,

 

Take a look at this post and see if that answers your question:

 

http://forums.ni.com/ni/board/message?board.id=170&message.id=19555&requireLogin=False 

0 Kudos
Message 6 of 6
(5,655 Views)