Block Produces Zeros or Does Nothing in Simulation
If you simulate a model on your host computer without running it on your target hardware:
Input blocks produce zeros.
Output blocks do nothing.
This is the expected behavior.
For example, in a model, on the Simulation tab, if you select
Normal
in the Simulate section, and then
click Run, the following happens:
The sensor block and Digital Input block send zeros to the model.
The Digital Output block does nothing.
To see the blocks work normally, run your model on target hardware or use External mode.
To run the model on target hardware, on the Modeling tab, click Model Settings. In the Configuration Parameters dialog box, open the Hardware Implementation pane, select your hardware board from the list, and click Apply. Then, in the Simulink® Editor, on the Hardware tab, click Build, Deploy & Start.
To use External mode, on the Modeling tab, click Model
Settings. In the Configuration Parameters dialog box, open the Hardware
Implementation pane, select your hardware board from the list, and click
Apply. Then expand Target hardware resources,
and under Groups select External mode. Review
the configuration parameter settings, such as the Communication
interface. Then, in the Simulink Editor, on the Modeling tab, change the simulation mode to
External
, and click Run.