Control Signal Editor with Simulink Real Time

4 ビュー (過去 30 日間)
Nicolas
Nicolas 2024 年 8 月 20 日
回答済み: Kothuri 2024 年 9 月 19 日
Hello MathWorks community,
I'm currently working on my Speedgoat RealTime target, and I would like to perform Data Replay, using the block Signal Editor.
My scenario is well configured, and the simulation works pretty well, but currently the data are generated by the Signal Editor as soon the simulation Start. However I need before to wake-up the DUT and let him correctly initialize ...
I tried to use Enabled Subsystem with my Signal Editor inside, but it still starts at time = 0. Enabled Subsystem simply enables output, but doesn't start Signal Editor at the time of Enable signal.
We can imagine to use a Switch bloc with 2 differents bus with the data comming from the Signal Editor, and from the plant model to allow the DUT to correctly init. Unfortunalty, because the Signal Editor is already sending the data, I cannot perform the replay testing as expected.
Is there an option for controlling the Signal Editor (such as start/stop/loop) with Simulink RealTime during the Simulation ?
Thank you for your advice !
Regards

回答 (1 件)

Kothuri
Kothuri 2024 年 9 月 19 日
Hi Nicolas,
I understand that you are trying to perform Data Replay using the “Signal Editor" block to wake-up DUT to initialize it correctly.
The "Signal Editor" block is designed to start generating signals from time zero, and there isn't a built-in option to pause or delay its start directly.
You can refer the below link for more info on "Signal Editor" block
You can try the below strategies to achieve the desired behaviour:
  • You can use a Switch block to control which signal source is fed to the DUT. By feeding the DUT with default or initialization signals from a constant or a different source in the Initial Phase. And using a logical condition or a timer to control the switch from the initialization signals to the Signal Editor output after the DUT is initialized.
  • Instead of an Enabled Subsystem, you can use a Triggered Subsystem. This can help you control when the Signal Editor starts sending data based on a specific trigger event.
  • You can zero out the initial outputs of the Signal Editor block by multiplying its output with a control signal that is zero during the initialization phase and switches to one when you want the Signal Editor data to start affecting the simulation.
  • You can use MATLAB code to control the start and stop of the Signal Editor block. This can be done by setting up a script that runs before the simulation starts and controls the timing of the Signal Editor.
% Before starting the simulation
set_param('your_model/Signal Editor', 'StartTime', 'your_start_time');
set_param('your_model/Signal Editor', 'StopTime', 'your_stop_time');
% Start the simulation
sim('your_model');
  • Running your model in External Mode allows you to interact with the simulation in real-time. You can start and stop the Signal Editor block manually during the simulation.
You can refer the below link for more info on External Mode

カテゴリ

Help Center および File ExchangeTarget Computer Setup についてさらに検索

製品


リリース

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by