04-01-2014 07:24 PM
hello,
Is there a way to convert a c code generated from Simulink model into a DLL to be used in Labview without using the module interface tool?
thanks
04-02-2014 10:19 AM
Model Interface Toolkit (MIT) was released with LabVIEW 2013. If you're looking to work with models in LabVIEW 2012 or earlier you will need to use Simulation Interface Toolkit (SIT) instead.
If you just mean to ask if you can develop your own code to take the place of MIT the answer is yes, but it will take a lot of development on your part. We script the way the model DLL is built in order to allow us to use the same function calls of any model DLL to run it. You would need to develop your own method for hooking into a DLL/.OUT file to successfully use it in LabVIEW. I'd recommend weighing the additional development time (at your level of expertise) against the cost of Licensing for MIT.
MATLAB®, Simulink®, and Real-Time Workshop® are registered trademarks of The MathWorks, Inc. All other trademarks are the property of their respective owners.
04-02-2014 01:36 PM
Thanks. What about just deploying a c code in labview? Is that possible?
04-02-2014 02:54 PM
With the according Matlab tools that can generate a DLL you should be able to incorporate such a DLL through the Call Library Node. However without some good C knowledge this tends to be a very painful exercise.
04-12-2014 04:10 PM
Don't forget that you don't have to rely on the c-code version of the simulink model, and that you can import the .mdl file directly (with the MIT). The success of the conversion depends upon the exact nature of the original model - e.g. discrete or continuous time, graphical or s-function, and how you want to realise the final model, e.g. within LabVIEW's CD&SIM or in some more primative construct (e.g. timed loop for discrete model).
We did a model conversion where the original model was s-function based, and the easiest way was just to copy the various parts of the s-function into several appropriately connected Mathscript nodes within LabVIEW.
04-14-2014 02:58 PM
Andy, I believe you may have SIT and MIT confused. SIT (2012 and prior) did allow you to use the SIT server to run your .MDL files remotely, but that functionality has not been brought into MIT.
MIT is only able to load models that conform to NI VeriStand Model Framework header file (NIVERISTAND_API.h). Which can be completed by a variety of IDE's, LabVIEW included.
04-14-2014 03:25 PM
Zach - you are right that we have only used SIT, but I was not talking about running the mdl files remotely (i.e. requiring Matlab to be available), rather we used an import feature to convert the model in the mdl file into a native CD&SIM model. I thought that this import feature was still available using the MIT. Please correct me if I've got that wrong. Thanks,
Andy
04-14-2014 04:35 PM
Ah, you're talking about the Model coverter tool in CD&SIM. More info here: http://zone.ni.com/reference/en-XX/help/371894G-01/TOC8.htm
Yes, the Control Design and Simulation toolkit opens up a lot of other avenues. As I mentioned before, LabVIEW can be used to build Models for MIT, most simulation models in LabVIEW are made using CD&Sim. So, by extension you could pull your .mdl file into CD&Sim and then use CD&Sim to build a model to be used by MIT. By itself though, MIT is not able to use .mdl files. The functionality you've mentioned is a part of CD&Sim.
MATLAB®, Simulink®, and Real-Time Workshop® are registered trademarks of The MathWorks, Inc. All other trademarks are the property of their respective owners.