How can I generate code with an Analog Input in my Simulink model ?
1 view (last 30 days)
Show older comments
I am using a Matlab script (Sensor.m) to build and launch with a GUI a Simulink model (sensor.mdl). It all worked really well until I added an Analog Input (here called 'Pressure Sensor') to the model. Now, when I build the model with slbuild() I get the error: 'Level-2 MATLAB S-function 'saib' in 'sensor/Pressure Sensor' specifies 'SetSimViewingDevice(true)' , which prevents an output port from being created for the S-function.'
After digging a little I found that the Analog Input block wasn't compatible with a 'rapid Accelerator' simulation but after analyzing with the 'Check Model' in 'Code Generation', I got some warnings but no failure. More specifically, it said that the Analog Input block in question was not recommended but still supported for code generation.
The Analog input in my code gives pressure data from a NI USB-6008.
0 Comments
Answers (0)
See Also
Categories
Find more on Simulink Coder in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!