How can I generate code with an Analog Input in my Simulink model ?
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!