I'm trying to write a proposal for a piece of work, during which we may be required to port a large existing piece of Simulink code onto NI PXI and/or CRIO platforms. NI claim to have 2 methods -
- "LabVIEW Simulation Interface Toolkit" whose method is unclear to me, and seems to be very convoluted involving having MATLAB running the whole time, which I don't want - the software will end up running on the platform as embedded code, not on a PC.
or
- "LabVIEW Control Design and Simulation Module" which seems to be a Simulink-to-labview auto-translator (scary!)
I'm not convinced that either of these methods produce an end result which preserves the functionality or (importantly) speed of execution of a large simulink model in real time. My simulink model includes lower-level hand-coded S functions in C with associated tlc files, and complex hierarchical subsystems with mask initialization commands within some of the subsystems. I don't think any auto-translator will be able to effectively cope with these.
What I don't understand is why you can't just build the Simulink model using real-time workshop (and embedded coder) for an x86/PowerPC/ARM processor as appropriate for the NI device, and then port this C code direct into Labview so it executes efficiently. I don't see any references to this in LABVIEW/NI documentation and I do not understand why it isn't an advertised route. Is there some reason this won't work? I don't need the FPGA functionality on PXI or CRIO, just to have the Simulink code (auto-generated into C code) run just as efficiently as it does if I embed auto-generated C code from Simulink onto other processor targets (as we do on a number of non-NI targets using x86 and other processors).
I'n not very familiar with LABVIEW, but very familiar with Simulink.
Is NI gear and the labview interface particularly unfriendly to C code which is generated from Simulink using embedded coder? Does anyone have any experience of this? I guess you need to call the Initialiase() part of the auto-generated routine at the start, and then the mdl_step() function each frame, and the terminate() function at the end (if you can be bothered). Apart from that, shouldn't it be "simple" or at least do-able with low risk?
Why don't NI advertise this? Is is just a Labview vs MATLAB stand-off? Are there any MATLAB articles describing how to do this in steps?
If anyone can point me to a useful article, I'm open to any experience anyone has on the use of NI gear with Simulink.
Andrew