"Simulating" with Hardware in the Loop

4 ビュー (過去 30 日間)
Mark Edwards
Mark Edwards 2020 年 1 月 20 日
回答済み: Mark Edwards 2020 年 7 月 7 日
Hi there,
I have a simulink model that includes STM32 hardware support package blocks to drive real hardware (https://www.mathworks.com/hardware-support/st-nucleo.html).
I want to be able to go between simulating the model without hardware (or compilation) and running the model with the hardware blocks.
Simple example below: When simulating, view step on the scope. When Hardware, output step to hardware pin.
How can I exclude the hardware blocks when in Simulation tab so I can test the rest of my model without compiling and communicating throught the hardware blocks?
HIL_Exclude.PNG
SIM_Exclude.PNG
Running the model in Simulation throws the following error due to the Hardware dependancy:
ErrorMessage.PNG
I tried putting the MBED block inside an enabled subsystem (and disabling the Enable), but that didn't work.
Ideas appreicated. Thanks!

回答 (1 件)

Mark Edwards
Mark Edwards 2020 年 7 月 7 日
Turns out there are Simulink examples that solve this problem using Variant Source, Sink and Subsystem library blocks.
Example model that helped me: matlabOpenExample('VariantSourceAndVariantSinkBlocksExample')

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by