필터 지우기
필터 지우기

Some tunable variables are missing in generated S-function mask

조회 수: 2 (최근 30일)
Benjamin CHANEL
Benjamin CHANEL 2015년 6월 15일
댓글: Titus Edelhofer 2015년 6월 17일
Hello,
in Matlab Simulink 2013a 64bit, I generate an S-function with compilator Microsoft SDK 7.1 from a function block through Right Click > C/C++ Code > Generate S-function.
I select the parameter I want to be tunables (all of the 12) and build the S-function. But the generated S-function allows me to set only 6 of the 12 variables. On another block, all 3 variables remain tunables, and on a third block, 1 of 3 variables wished as tunable is missing in S-function mask.
All variables (present or missing) are constant values for a given simulation (like friction coefficient, gear reduction ratio, motor constant [N.m/A], detent torque, ...).
All variables have been parametrized in the mask before compilation (name instead of the value) and have an assigned value in the workspace. Missing variable names are already missing in files blockname_sf_private.h, blockname_sf.h, and blockname_sf_data.c .
Any tip or idea ? Thank you.

답변 (1개)

Titus Edelhofer
Titus Edelhofer 2015년 6월 15일
Hi Benjamin,
note, that there are blocks in Simulink that don't allow the value to be tunable (all sample time related parameters for example). Which block parameters are you missing in the generated S-Function (which parameter from which block type)?
Titus
  댓글 수: 2
Benjamin CHANEL
Benjamin CHANEL 2015년 6월 16일
편집: Benjamin CHANEL 2015년 6월 16일
Hi Titus, thank you for your answer. My parameters are constant values during the simulation. Within the subsystem block I am compiling, they are used in subsystems and functions like
param_1*sin(param_2*u[1])
which is summed with other functions/subsystems. Neither param_1 nor param_2 are present in S-function's mask. Constant values, even in more complex subsystem blocks (derivation, integration, closed control loops, ...) do not seem to be time related. May they be ?
And of course, I do not get any warning/error message in Matlab Command window. I had a look into the multiple generated files, but I couldn't find any logs that would help me.
Titus Edelhofer
Titus Edelhofer 2015년 6월 17일
Hi Benjamin,
for the line above, do you use the MATLAB function block? This will not work, although the "Generate S-function" asks you to decide if the parameters are tunable or not. You will need to use blocks (a gain block with param_2, feed into Trigonometric function block etc). Then it should work ...
Titus

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

카테고리

Help CenterFile Exchange에서 Classical Control Design에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by