LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to include MATLAB custom program to LabVIEW

I am pretty new to LabVIEW environment. I need to take two voltage signal and manipulate that signal with MATLAB( if possible) for certain automatic calculation. I am not quite sure how I can do this.

0 Kudos
Message 1 of 11
(3,591 Views)
Hi,
 
You can do this in three different ways:
2> You can use the math script node
3> You can rewrite your MATLAB code in native LabVIEW code
 
Regards,
Kabul
Message 2 of 11
(3,573 Views)
Hi Kabul,
 
How can i write  MATLAB code in native LabVIEW code
 
Thanks,
Amara
0 Kudos
Message 3 of 11
(3,564 Views)
There is a fourth way:

4> Use a Matlab node. This allows you to call Matlab. (Mathscript is NI's version of Matlab. Essentially)
Message 4 of 11
(3,552 Views)
Hi,
 
The MathScript Node is not available in the base package. You can check if you do have it or not on functions>structures; on the block diagram window. If you do have it, the context help should provide you with information about the functionality. You simply type the MATLAB code inside the MathScript Node.
 
Regards,
Kabul

Message Edited by Kabul on 07-10-2007 03:28 AM

0 Kudos
Message 5 of 11
(3,550 Views)
Hello,
 
Also note that the MathScript Node understands the syntax of .m files, just like other software applications such as MATLAB.  Much like C code, which can be edited in a number of environments.  However, there are some functions that are written for the MATLAB environment which are not the same in the MathScript node. You will want to reference the MathScript help to see which functions are supported in MathScript.
Brian Coalson

Software Engineer
National Instruments
Message 6 of 11
(3,524 Views)

Thanks all

 

In addition how can i directly give DACmx input to mathscript for processing purposes. When mathscript input is directly connect from the DACmx out, it is not allowed saying that the data type is different. Any suggestion to over come this.

0 Kudos
Message 7 of 11
(3,517 Views)
Amaka,
 
What data type do you have wired into the input of the MathScript node?  It will not accept waveform types or dynamic data types.  It will need to be an array of doubles.  To change the output type of the DAQmx Read, click on the polymorphic selector and change the datatype to be a 1D array or 2D array.  You can also convert the dynamic data type to an array of doubles.  Then in the MathScript node you should be able to manipulate these data arrays.
Brian Coalson

Software Engineer
National Instruments
Message 8 of 11
(3,498 Views)
Hi,

A google search on "matlab data acquisition" may also provide some alternatives.

-----
Rob Purser
Manager, Test and Measurement
MathWorks
rob.purser@mathworks.com
Message 9 of 11
(3,496 Views)
Is there any way that I can change DAQ assistant output that can be connected to DAQmx read.
0 Kudos
Message 10 of 11
(3,467 Views)