필터 지우기
필터 지우기

Real - time parameter tuning using xPC Target and C - MEX S - Function.

조회 수: 2 (최근 30일)
Agamemnon Krasoulis
Agamemnon Krasoulis 2012년 3월 21일
Hi everyone,
I have built a C - MEX S-Function which uses 5 parameters and I am using the generated block in a model running on an xPC Target - Machine.
I would like to know if there is any chance to be able to tune the parameters in real-time, without inlining the S - Function, as I have no previous experience in using the TLC. Also, I have read on the TLC User's Guide that I should avoid inlining S-Functions whose mdlOutputs() function include a large - sized code, which happens to be the case.
Any help would be greatly appreciated.
Cheers, Agamemnon
  댓글 수: 2
TAB
TAB 2012년 3월 21일
How the parameters are defined for S-function ?
Are U passing you from the s-function dialog block ?
Agamemnon Krasoulis
Agamemnon Krasoulis 2012년 3월 26일
Yes, exactly. I pass them as dialog box parameters.

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

답변 (2개)

Rajiv Ghosh-Roy
Rajiv Ghosh-Roy 2012년 3월 21일
They should automatically be tunable. The only thing is that the parameter names will show up as "P1", "P2", etc.
  댓글 수: 1
Agamemnon Krasoulis
Agamemnon Krasoulis 2012년 3월 26일
Apparently, they are not. I think they should be registered as run - time parameters in order to be tunable in real-time.

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


TAB
TAB 2012년 3월 27일
To make parameters as tunable, you can pass the parameter values from base workspace.
To change the values at run time -
1. Change the parameter value at base workspase
2. Give a update command to the model.To give update command, simply select the running model and press Ctrl+D.
  댓글 수: 2
Agamemnon Krasoulis
Agamemnon Krasoulis 2012년 3월 27일
Thank you for the answer, but I am afraid this doesn't help. I repeat that Simulink is running on external mode (I run the model on a xPC Target Machine).
TAB
TAB 2012년 3월 27일
It will work in external mode also. Set "Batch Download" option to ON in "External Mode Control Panel" to make it work.
For more info refer thread http://www.mathworks.in/matlabcentral/answers/30729-real-time-workshop-embedded-coder-command-line-functions-to-download-tunable-parameters

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by