LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need help - compiling a dll

Hi,

I'm using MatLab 6.5 and Labview 6.1. Basically I have a simply MatLab code I want to run in Labview. Unfortunately I can't use the MatLab script function since the computer running the Labview program won't have MatLab installed. So I'm limited to running the code via dll/library.

I've try reading through the different posts on here but am still having trouble. I found a documentation somewhere else but it only works with MatLab 5.3 and is rather complicated.

I tried following the steps here:
http://forums.ni.com/attachments/ni/170/29800/1/dllmatlablabview.pdf

But again this is for MatLab 5.3. Everything worked fine (well not the .exports part cuz there's no such file) until I typed in:

mbuild -link shared poly_wrapper.cpp poly.cpp mfunclib.cpp
In MatLab command window and I got the following error

poly_wrapper.cpp
poly_wrapper.cpp(16) : error C2065: 'foolibInitialize' : undeclared identifier
poly_wrapper.cpp(18) : error C2065: 'mlfFoo' : undeclared identifier
poly_wrapper.cpp(18) : error C2440: '=' : cannot convert from 'int' to 'struct mxArray_tag *'
        Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
poly_wrapper.cpp(20) : error C2065: 'foolibTerminate' : undeclared identifier

MBUILD.BAT: Error: Compile of 'poly_wrapper.cpp' failed.

Please help. Smiley Sad


0 Kudos
Message 1 of 3
(2,325 Views)
bump.
0 Kudos
Message 2 of 3
(2,311 Views)

Hello Honeywell,

It seems that the real issue here is about how to compile Matlab code into a DLL which LabVIEW can call with a Call Library Node.  Unfortunately I am unable to help you with building this DLL, but I would recommend checking out the mathworks website to see if they are able to help out.  Perhaps there are users out there that have done the same thing you are trying to do and can provide you with some additional tips.

Please let us know if you have any additional questions on this.

Regards,

Travis M
Applications Engineer
National Instruments

Travis M
LabVIEW R&D
National Instruments
0 Kudos
Message 3 of 3
(2,301 Views)