LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

connecting matlab & cvi

From our company VTL,CVI 8.0 has been bought.Now I want to connect matlab command prompt with cvi.From the examples I have run matlabdemo.cws .As it did not run properly,I followed the following steps searching from NI discussion forum. 
 
 
1) So I would suggest, if you haven't already, upgrading your runtime engine to CVI 7.1.1. The CVI runtime engine is backwards compatible so you will still be able to build you applications in CVI 7.0.
2) Once you do this, recreate the Matlab instrument. Remove the current Matlab instrument and recreate the Matlab Automation Server Type Library by going to Tools >> Create ActiveX controller. The name of the Matlab instrument will be Matlab Application Type Library. Save the newly created ActiveX controller with the same name as the previous one (as in, just replace the one that is already in the shipping example directory with the newly created one).
3) Change the matlabdemo.c launch callback to read
stat = MLApp_NewDIMLApp (NULL, 1, LOCALE_NEUTRAL, 0, &hMatlab);
instead of
stat = MLApp_NewDIMLApp (NULL, &hMatlab);
4) Open the source code for the Matlab instrument and search and replace ALL instances of &MLApp_IID_DIMLApp with &IID_IDispatch.
                                                                           After following all the above said steps, the command prompt is being opened.But the problem is no command can be sent to matlab command prompt and if I press "SEND STRING" button the popped up  message is "Error in sending string to matlab".Matlab version installed in my machine is 7.0.0
0 Kudos
Message 1 of 4
(3,733 Views)
Hi Tupai,
 
This was reported to R&D (43E9FUBU) for further investigation.  A possible workaround is to downgrade to Matlab version 6.5 or earlier.  Thanks for the feedback!
Cheers,

David Goldberg
National Instruments
Software R&D
0 Kudos
Message 2 of 4
(3,703 Views)
Hello tupai,

In looking at this issue, it seems that Matlab now requires valid imaginary data to be passed to the matrix functions. The example that you're using passes NULL for the imaginary array. You should be able to fix this by modifying the example to pass in an array with all 0's as the imaginary data.

Luis
0 Kudos
Message 3 of 4
(3,554 Views)
Hi,
 
Im not going to be popular in the CVI community ...Smiley Happy
But working with matlab by using LabView is much easier and have a numerus advantages.
 
Trz
0 Kudos
Message 4 of 4
(3,526 Views)