LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I call .m files from a LabVIEW executable without the full development version of matlab installed?

I have an executable that I am trying to build (and distribute).  Right now, it has Matlab script nodes that call some matlab .m scripts that someone else wrote.  The target PC will not have the full development version of Matlab installed.  Would that work?  I have tried to compile the .m scripts into a DLL, but I can't import that to LabVIEW because of the special Matlab types (*mxArrays).  I have also tried to write a wrapper around that DLL, but with no success.  So now I'm wondering if I can either call the Matlab .m scripts directly from a Matlab Script node OR if I can call my Matlab DLL from within a script node.  OR any other idea someone might have...

 

Thanks a lot!

-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




0 Kudos
Message 1 of 8
(3,936 Views)

I think that you only need Matlab Runtime. it will use matlab server.

0 Kudos
Message 2 of 8
(3,932 Views)

That is not correct. If you use the Matlab Script Node you need the full version of Matlab installed on the computer because the script node communicates with Matlab via ActiveX. If you cannot directly call the Matlab DLL because of complex data types then you should consider writing a wrapper DLL in C that will handle the data type manipulation so that LabVIEW only needs to deal with simple data types.

0 Kudos
Message 3 of 8
(3,928 Views)

Matt,

 

Are you aware of MathScript ?

 

You may be able to run your .m code natively in your LabVIEW exe and not rely on other software being installed or carrying around a DLL (which will also need a runtime).

 

~Simon

0 Kudos
Message 4 of 8
(3,919 Views)

smercurio_fc,

 

Is that because of the Matlab script node or the .m file? 

 

I've been trying to write a DLL wrapper but have not been able to get it to work.  The example DLL on the mathworks web site does not work with Visual Studio 2008 -- I can get a DLL and link to it, but when I run the wrapper I get an access code violation.

-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




0 Kudos
Message 5 of 8
(3,916 Views)

Simon,

 

I looked at MathScript and am considering using it, but one thing that is not clear to me is if I will be able to use my .m files like I can with Matlab.  I call the same Matlab script repeatedly and it keeps track of some information in global variables (for example, the number of consecutive detections).  Can I do that entirely within mathscript or would I have to reload all of the info each time -- if I had to do that, it would mean substantial changes to the .m files ... and that's not an option.

 

-Matt

-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




0 Kudos
Message 6 of 8
(3,914 Views)

 


@MattBradley wrote:

smercurio_fc,

 

Is that because of the Matlab script node or the .m file? 


It's the Matlab script node. A compiled Matlab DLL would be called using Call Library Function Node, and would simply require the Matlab RunTime Engine.

 

0 Kudos
Message 7 of 8
(3,912 Views)

That's what I thought -- now if I could just get the DLL to work.  I am considering changing the functions so they read and write files for I/O rather than trying to use the wrapper DLL.

-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




0 Kudos
Message 8 of 8
(3,909 Views)