필터 지우기
필터 지우기

Question about Relative Path Variable definitions

조회 수: 9 (최근 30일)
Kevin Allen
Kevin Allen 2024년 3월 8일
댓글: Kevin Allen 2024년 3월 22일
Hi,
Where do I find path variable definitions? Such as TARGET_ROOT shown below:
I want to use a different relative path for a different .ccxml config file.
Best,
Kevin

답변 (1개)

Saurabh
Saurabh 2024년 3월 22일
Hi Kevin,
I can figure out that you need to set a relative path to the project root for a hardware configuration file.
To address this issue, setting the model's InitFcn callback to execute a configuration script is recommended. Below is an initial version of the code to consider. Modifications may be necessary to ensure it aligns with the project's specific requirements.
cs = getActiveConfigSet(gcs);
% retrieves the active configuration set of the current Simulink model.
ctd = get_param(cs, 'CoderTargetData');
% This line extracts the CoderTargetData property from the active configuration set.
ctd.Runtime.LoadCommandArg = [pwd, '\my_file.ccxml'];
% The .Runtime.LoadCommandArg property of ctd (CoderTargetData) is then set to this full path.
set_param(cs, 'CoderTargetData', ctd);
% Finally, the modified CoderTargetData object (ctd), now containing the updated path to the configuration file, is written back to the active configuration set of the model.
For more information about the functions used you can refer to the following links:
I hope that was helpful.
  댓글 수: 1
Kevin Allen
Kevin Allen 2024년 3월 22일
Hi Saurabh,
Thanks for your reply. Yes, you understand what I am wanting to do using a .ccxml config file located in the project root instead.
I'll give your suggestions a try and report back.
Best,
Kevin

댓글을 달려면 로그인하십시오.

카테고리

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

태그

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by