03-14-2014 01:16 PM
Hi everyone,
I need to build application for a VI with some matlab scripts included in the block diagrams using the Matlab scripts node. I've been searching for related topics and I'm hoping someone can help me understanding the big picture here.
Background info: I'm using LV2012, Matlab 2013. I DON'T USE MathScript RT Module.
Question:
1. To build a stand-alone application for the use on a PC with Matlab software but no LabVIEW, do I just simply build the application in LabVIEW project?
2. To build a stand-alone application for the use on a PC wthout Matlab and LabVIEW, do I need to create a DLL from Matlab and modify my VI to use "Call library function node" and then build the application in LabVIEW project?
Thanks for answering my questions!
03-14-2014 01:31 PM - edited 03-14-2014 01:33 PM
Question:
1. To build a stand-alone application for the use on a PC with Matlab software but no LabVIEW, do I just simply build the application in LabVIEW project?
Yes, Assuming it is a windows machine and the Licensed version of Matlab is version 6.5 or later the LabVIEW Run-Time engine knows how to call the Matlab script server through Active X.
2. To build a stand-alone application for the use on a PC wthout Matlab and LabVIEW, do I need to create a DLL from Matlab and modify my VI to use "Call library function node" and then build the application in LabVIEW project?
You cannot use a Matlab math script node without a licensed version of Matlab 6.5 or later resident on the target and the target must support Active X so, Windows only.
03-14-2014 01:42 PM
2. To build a stand-alone application for the use on a PC wthout Matlab and LabVIEW, do I need to create a DLL from Matlab and modify my VI to use "Call library function node" and then build the application in LabVIEW project?
You cannot use a Matlab math script node without a licensed version of Matlab 6.5 or later resident on the target and the target must support Active X so, Windows only.
So in this case, I need to compile my .m file in Matlab into DLL and use the DLL in my VIs, right? Any details on how to implement this are appreciated!
03-17-2014 06:22 PM
Hello,
After you create your DLL from the MATLAB® environment, you can then use a Call Library Function Node to call that DLL from your LabVIEW VI. When you create a DLL from the LabVIEW VI, the MATLAB® DLL won't be automatically included inside the LabVIEW DLL. You need to make sure that they accompany each other and that all paths to external code are referenced correctly. If you don't use correct file path references, you will run into "File no found" errors.
Creating a DLL from LabVIEW code
https://decibel.ni.com/content/docs/DOC-15556
MATLAB® is a registered trademark of The MathWorks, Inc.
Hope this helps!
03-18-2014 08:49 AM
Aldo,
I'm not trying to build a DLL fro LabVIEW. I'm trying to build an EXE from LabVIEW. In my case, will it be just a straight forward application builder procedure? Thanks.
03-19-2014 03:27 PM
Hi Z.Wei,
Yes; I recommend that you study this KB before you build your exe with the DLL.
Why Can't My Stand-Alone Executable Find My DLL, Even Though I Have Specified the Path for the DLL?
http://digital.ni.com/public.nsf/allkb/862567530005F09C862565C50068363D
It will prevent a lot of headaches in the future 🙂