How can I generate code with an Analog Input in my Simulink model ?

조회 수: 1 (최근 30일)
Johan Poccard
Johan Poccard 2021년 11월 23일
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개)

카테고리

Help CenterFile Exchange에서 Simulink Coder에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by