Explanation of SetInputPortSamplingMode Level 2 S-function callback.
Ältere Kommentare anzeigen
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
Antworten (0)
Kategorien
Mehr zu Simulink finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!