10-15-2013 05:20 PM
I currently have Labview Mathscript RT Module that allows me to insert my matlab script into my labview program, but the problem I’m having now is the mathscript module isn’t able to run the Simulink file I have. Currently my matlab script runs and saves some variables, then calls the Simulink module inside of it and returns to the matlab script to continue to run, then it gives my labview program the final outputs from the matlab script.
So my question is how should I go about editing the matlab script? Or is there a module I could download that would allow me to just call it directly from my mathscript RT module.
10-15-2013 06:50 PM
You need Simulation Interface Toolkit, http://sine.ni.com/nips/cds/view/p/lang/en/nid/209048.
10-16-2013 12:30 PM - edited 10-16-2013 12:31 PM
In order to work with Simulink® models in LabVIEW, KateB is correct that you will need Simulation Interface Toolkit. I just wanted to give you a bit more information. You can find an example of how this toolkit works in this document, http://www.ni.com/white-paper/3057/en/ . Also, in LabVIEW 2013 and later the Simulation Interface Toolkit has been replaced by the Model Interface Toolkit.
I hope this helps!
Simulink® is a registered trademarks of The MathWorks, Inc.
10-21-2013 03:04 PM
The problem with importing my simulink module to labview is that the matlab script calls the simulink module inside a for loop. and keeps doing this continuous exchange and updating of variables inside the workspace, so I want to keep it as is. So I wanted to know if the mathscript RT module understands that when I call the simulink it should run a simulink module I made, or do I have to direct it to where that module is?
Also the simulation interface toolkit has been replaced with the LabVIEW Model Interface Toolkit. Is there anything really different with how they work?
I also tried converting my simulink module to labview using another module I downloaded but it makes around 10 subVIs, yet it doesn't wire them together. Basically I have 10 subVIs that aren't talking with each other, or I don't know if labview knows that after I do this one subVI I jump to this next one, etc.
10-22-2013 02:17 PM
The Mathscript RT node does not actually run code in MATLAB®, but simply runs m script code. If you look in the help for the Mathscript RT Module there is no function call listed to open and run Simulink®. You may be able to accomplish this task using the MATLAB® Script Node which uses ActiveX to call MATLAB® software. If you'd like to try this you can find this node under, Functions >> Mathematics >> Scripts & Formulas >>Script Nodes.
You can find some more information about the Model Interface Toolkit and it's new features here, https://decibel.ni.com/content/groups/product-pulse/blog/2013/10/07/adieu-labview-simulation-interfa... or on it's product page.
MATLAB®, and Simulink® are the registered trademarks of The MathWorks, Inc.