LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use matlab codes in a stand alone application without matlab license?

Hi,
 
I am not an expert in programming and i don't know about C++, i have a program using matlab codes and now i want to transfer it to a computer without matlab license. I've read something about using DLL, but i think i have to know C++ programming  to wrtie "WRAPPER" and add some lines to the program, now transformed in C++.
 
I just would llike to know that really isn't any other way to integrate matlab for a stand-alone application? i read somethings in Matlab help about using COM (Common Object Model ) but i am not sure that labview works with it, and also about runtime engine and "mglinstaller.exe".
 
 
my labview version is 8, matlab is 2006, and the real problem is using matlab codes in another computer without matlab license.
 
Thanks
Amir
0 Kudos
Message 1 of 8
(5,546 Views)
Hello Amir,

There is a MatLab script node in the LabVIEW function palette (see screenshot of the help topic) but as you can see this structure is not in the "Base LabVIEW", you might need to purchase the FDS (Full Developpment System) or the PDS (Professionnal Developpment System) of LabVIEW...
Do you know which one you have ?



Hope this helps 😉

Message Edité par TiTou le 11-24-2006 06:38 PM


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 2 of 8
(5,542 Views)

Hi, agian

so thanks, but i read somewhere in forum that mathscript is not working in run-time application, then i think  i have to use really matlab and not machscript.

0 Kudos
Message 3 of 8
(5,537 Views)
Actually, the version 8.20 of LabVIEW allow you to AppBuilder to create an EXE that has Mathscript. The only caviat is that anything that pops up would not work on the EXE. If you just have plain calculations and the functions are supported by mathscript, that should work...
Barp - Control, Simulation, RTT and HIL - National Instruments
0 Kudos
Message 4 of 8
(5,511 Views)

Thank you Barp

today, i got V8.2, but now the problem is that i can't call my mathscript external functions (which i built by myself and saved them as *.m) because the runtime engine can not recognize the command "addpath", then does it mean that i have to forget the external functions?

 

thanks again

Amir

0 Kudos
Message 5 of 8
(5,478 Views)
Hey Amir,
    I found some information that may help this issue.  See if the following info resolves your situation:
"The problem is that although you can save your function or script anywhere on your computer, the software by default only looks in the following folder:

C:\Documents and Settings\....\My Documents\LabVIEW Data

You should go in and physically specify the MathScript software to look into the directory where you saved your .m function or script. This can be done by selecting the MathScript Preferences from the File Menu in MathScript. The "path" section in the middle of the window specifies all of the directories where the MathScript software queries for functions and .m files. You can also change the default working directory in the section at the bottom of the window.

There is also a function, addpath, that can be used to add the path of a .m file. The syntax is as following:

addpath('path to file')
For more information on the addpath function, type "help addpath" into the command window of MathScript."


Brian B
Account Manager
National Instruments
Message 6 of 8
(5,458 Views)
Hi, Brian,
 
my problem is exactly the function addpath, in attachment you can find the vi, and its standalone application. if you run just vi, then you will find that it works, but if you compile it  then i can not recognized the function 'addpath'.
 
i will be happy if you can discribe what is the problem (i hope that my  *.rar works)
 
thanks
Amir
 
attention: change the ext. from .zip to .rar and open it (i can't add with .rar ext.)
0 Kudos
Message 7 of 8
(5,449 Views)
Hi Amir,

User-defined functions ARE supported in the run-time engine.  But as you discovered, the addpath function is not supported.  For a list of all such functions, see the LabVIEW help topic "MathScript Functions Not Supported in the LabVIEW Run-Time Engine."  However, it is not necessary to use the addpath function in order to call your user-defined function from a built executable.  When building an executable that uses additional .m files you have written, simply add them to your project.  When configuring the build specification, make sure to select "Enable MathScript support" in the Advanced settings.  Remove any unsupported commands from the MathScript node (e.g. addpath) and build the executable.  It should work correctly.  By adding the .m files to the project, the application builder knows to include the appropriate compiled code with the application and to properly configure MathScript to find the compiled code in the executable.

For more information about MathScript, visit the MathScript forum.

Grant M.
Staff Software Engineer | LabVIEW Math & Signal Processing | National Instruments
0 Kudos
Message 8 of 8
(5,421 Views)