Unable to tune parameters during simulation with Arduino Due

22 ビュー (過去 30 日間)
Elias Jonsson
Elias Jonsson 2024 年 11 月 7 日
コメント済み: Elias Jonsson 2024 年 11 月 7 日
When running a Simulink simulation in External mode to an Arduino Due board I am unable to change parameter values (for example the value of a constant block) without stopping the simulation. When opening the block parameters window the value fields are greyed out and uneditable.
Been searching for a solution and came upon "Tuneable parameters" which led me to the "Code Generation" configuration parameters which are not visible for me.
Have tried installing several packages, including "Matlab coder", "Simulink Coder" as well as "Embedded Coder", all of which should be included in my license.
Still, I get no configuration options for "Code Generation" and still unable to tune parameters while the simulation is running.
Upon simulation i get the following warnings:
Warning: No signals uploaded from the target application. Enable signal logging for model 'modelname. For more information, see Configure Signal Monitoring and Parameter Tuning for XCP External Mode.
Warning:Saving external mode simulation output as a single object is not supported because the workspace variable 'out' is not created during model code execution. To suppress the warning, set 'ReturnWorkspaceOutputs' to 'off'.
Don't think they are relevant since they also show up on another computer where parameters are tuneable just fine. Been trying to find what is different on that computer but no luck (other than that one running version 2022a and has access to "Code Generation")
Any help or suggestions would be much appreciated.

回答 (1 件)

sidik
sidik 2024 年 11 月 7 日
do you verify these step ?
Step 1: Ensure Required Toolboxes Are Installed and Configured Correctly
From your add-on manager, it appears you have the necessary toolboxes (MATLAB Coder, Simulink Coder, and Embedded Coder) installed, which should allow you to access code generation settings. However, if "Code Generation" options are missing, it may indicate a configuration issue.
  1. Verify License: Ensure your MATLAB license includes support for Embedded Coder. Sometimes specific toolboxes need separate licenses for full functionality.
  2. Reinstall Toolboxes: Occasionally, reinstalling the relevant toolboxes (MATLAB Coder, Simulink Coder, and Embedded Coder) can resolve configuration issues.
Step 2: Access Code Generation Settings
  1. Go to Model Settings by clicking on the gear icon in Simulink.
  2. In the Configuration Parameters dialog, expand Code Generation settings if available.
  3. Set the System Target File to ert.tlc (if available). This should enable code generation for embedded targets like Arduino.
  4. Ensure External Mode is enabled:
  • Under Hardware Implementation, select your target hardware (Arduino Due).
  • Enable External Mode in the settings for real-time parameter tuning.
Step 3: Enable Signal Logging and Configure Output
  1. In Simulink, go to Simulation > Model Configuration Parameters > Data Import/Export.
  2. Enable Signal logging and ensure signals you want to monitor are set to log.
  3. Set ReturnWorkspaceOutputs to off in the Command Window using
set_param(gcs, 'ReturnWorkspaceOutputs', 'off');
Best regards,
sidik
  1 件のコメント
Elias Jonsson
Elias Jonsson 2024 年 11 月 7 日
Thank you for the response. From what I can tell, the three "Coder" toolboxes should all be included in my license. I have uninstalled and reinstalled each of them with no success, "Code generation" still does not appear. Have checked with others who are able to tune parameters at runtime who apparently also don't see "Code generation" so if that is not the issue I'm not sure what the problem could be.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSimulink Coder についてさらに検索

製品


リリース

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by