03-17-2017 08:39 AM
Is there a "best practices" guide for converting Simulink to LabVIEW?
I inherited a Simulink code, but not all the extra (expensive) toolkits, and I am not going to be funded for all the other toolkits. My directive is to convert to LabVIEW, and use that.
Is there a document that translates between the two, so I can know that some object in simulink translates to a vi with those inputs?
03-17-2017 09:02 AM
Hi EngrStudent,
I recommed this paper that shows how to build a LabVIEW user interface for a simulink Model. http://www.ni.com/white-paper/3057/en/. But it actually use an additional toolkit for LabVIEW, it is the NI LabVIEW Simulation Interface Toolkit. If you don´t wanna use this toolkit, you might traslate manually the Simulink model to a block diagram representation in LabVIEW.
Regard!!!
03-17-2017 01:01 PM
Although LabVIEW and Simulink look somewhat alike (there was a years-long lawsuit over this), functionally they're very different so the conversion is not as straightforward as you might expect. A Simulink model can be converted into a series of equations which are solved through Matlab; LabVIEW, on the other hand, generates code. For anything other than the simplest models, you can't take Simulink diagram and map it directly to LabVIEW. Instead you'll need to work out the logic and re-implement it in LabVIEW, possibly in a way that doesn't look anything like the Simulink original.
03-17-2017 01:04 PM
@nathand - so there is no "simulink --> matlab --> MathScript" route?
03-17-2017 01:19 PM
@EngrStudent wrote:
@nathand - so there is no "simulink --> matlab --> MathScript" route?
Nope. You can possibly compile your Simulink model into a DLL and then call that from LabVIEW, if you have the right Matlab toolkit to compile it, but then you'll have to use Simulink to edit and recompile the model when it changes.
03-17-2017 01:26 PM
@nathand - I have a decent computer and the Simulink compiler only uses one core. That is a stunning waste of CPU power.
Part of the vicissitudes of the compiler include its (archaic) hardware utilization.