Explanation of SetInputPortSamplingMode Level 2 S-function callback.
이전 댓글 표시
Hello,
I'm writing a Level 2 Matlab S-function. I am trying to have 3 inputs and 2 outputs. It works fine with 1 output, but when I add the second output, I get the following error in Simulink:
Level-2 MATLAB S-function 'scene2latlongalt' in 'WorldSim/Level-2 MATLAB S-Function' does not have a 'SetInputPortSamplingMode' method. When a Level-2 MATLAB S-function with multiple output ports has dynamic sampling mode setting for any of its ports, it is necessary to register a 'SetInputPortSamplingMode' method
I've looked online for guidance here, and found the following links:
The msfuntmpl.m sample script has an example of the SetInputPortSamplingMode callback usage, and I just modeled mine off that. However, I can't find any documentation of what the SetInputPortSamplingMode callback is actually doing. I got the code to work, but I don't really know why it works. I was hoping someone could help explain what is going on here.
I also attached the s-function .m file. It is a little bit messy, but the important parts are that I have 3 input ports, 2 output ports, and the callback function SetInputSampMode(block, idx, fd)
Thanks,
-Ryley
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Simulink에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!