How to pass mask parameters to the an underlying S-Function in Simulink?
조회 수: 21 (최근 30일)
이전 댓글 표시
I'm trying to create an animation based on the built-in 'saeroanim' 6DoF Animation block in Simulink for R2020a. I'm using a mask to pass defined parameters to the modified S-Function block (I'm implementing a moving target), but I get this error message:
For S-function 'saeroanim_movingtarget', the number of defined parameters, 0, does not match the number of parameters on the dialog of 'Config_3_Missile/6DoF Animation Moving Target/Animation S-Function', 1. These two values must be identical.
In the initialization tab, I have this:
s_funcConfig.axes = axes;
s_funcConfig.update = update;
s_funcConfig.missile = missile;
s_funcConfig.target = target;
s_funcConfig.camera_pos = camera_pos;
s_funcConfig.view = view;
s_funcConfig.Animenable = animenable;
s_funcConfig.Model = bdroot(gcb);
"s_funcConfig" is the struct that I want to define for the S-Function inside the mask. Why is the mask not defining s_funcConfig as a "defined parameter" and then passing it to the dialog of the internal S-Function?
Some pictures:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1092575/image.png)
Mask Edit Window
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1092580/image.png)
Internal portion of the mask
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1092585/image.png)
Underlying S-Function parameters dialog box
댓글 수: 0
답변 (1개)
Aiswarya
2023년 10월 18일
Hi,
The error you are getting indicates that the number of parameters in the compiled S-function is different than the number of parameters in the block dialog box. This means you have not defined any parameters in the S-function code but the dialog has a parameter s_funcConfig . The mask is not responsible to define a parameter for the S-function. You may need to check the S-function code and make sure you have defined that parameter. Refer to this link on more information on setting parameters for S-function:
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Block and Blockset Authoring에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!