필터 지우기
필터 지우기

How to create dll in Matlab to be used in Labview

조회 수: 10 (최근 30일)
Jong-Hwan Kim
Jong-Hwan Kim 2012년 11월 12일
답변: Ricardo Gutierrez 2021년 8월 4일
Hi all,
I have problem with converting m-file in Matlab to dll file to be used in Labview. I used MCC to create dll from which Labview cannot find inputs and outputs. And is there any way to convert m-file to be used in Labview except using Matlab node due to its slow calculation speed? Thank you in advance.

채택된 답변

Kaustubha Govind
Kaustubha Govind 2012년 11월 12일
편집: Kaustubha Govind 2012년 11월 12일
I'm not sure exactly what kind of interface LabVIEW requires, but this is how you need to interface with a DLL generated using MATLAB Compiler. Note that you will also need to install the MATLAB Compiler Runtime (MCR) on the machine that the DLL is being deployed upon.
I wonder of what you actually need is a standalone DLL (independent of the MCR) - in that case using MATLAB Coder might be the better option.
  댓글 수: 4
Jong-Hwan Kim
Jong-Hwan Kim 2012년 11월 13일
Thank you for your answer. I used MCR and MCC to create dll, finally DLL was successfully created, but Labview still cannot find inputs and outputs. :(
Kaustubha Govind
Kaustubha Govind 2012년 11월 15일
Jong: How does LabVIEW "search" for interface exactly? Does it use the DLL header? Perhaps you might be able to ask NI's Technical Support team?

댓글을 달려면 로그인하십시오.

추가 답변 (4개)

David Roohy
David Roohy 2019년 1월 16일

Michael Kaiser
Michael Kaiser 2012년 11월 16일
I'm up against the same issue. I've created both C shared libraries and C++ shared libraries, but cannot use in LabVIEW. How is the MATLAB runtime invoked, initialized?

shubham kumar gupta
shubham kumar gupta 2021년 2월 4일
편집: shubham kumar gupta 2021년 2월 4일
GET A DLL FROM MATLAB:
mcc -v -B csharedlib:sumarray sumarray.m
create a scriptWrapper.c,scriptWrapper.h,scriptWrapper.def file[attached]
Now run below
mbuild -v sumarrayWrapper.c sumarray.lib LINKFLAGS="$LINKFLAGS /DLL /DEF:sumarrayWrapper.def" LDEXT=".dll" CMDLINE250="mt -outputresource:$EXE';'2 -manifest $MANIFEST"
now load this new scriptwrapper.dll in labview via import option, and add your old script.dll to this lvlib in labview
Always run loadFunction.vi before using your mainfunction.vi

Ricardo Gutierrez
Ricardo Gutierrez 2021년 8월 4일
Dear Shubham Kumar Gupta:
I tested the code for preparing matlab DLL for labview, I have some questions, maybe you can help me. How can I create the Wrapper.c file when you have multiple inputs and multiple outputs?

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by