Mex Function - specifying an input to output port dependency
조회 수: 1 (최근 30일)
이전 댓글 표시
I'd like to be able to specify an input port to output port dependency on my mex function Simulink blocks to that Simulink doesn't falsely think there are algebraic loops. Is this possible? Could it be made possible?
For example, for some of my blocks there's a simple input to output port relationship (output port N is dependent only on input port N), If any output port loops back without a delay (e.g. output port M loops back through combinational logic to input port P, ( P != M)), Simulink will think this is an algebraic loop, as it will assume all input ports to the block drive all outputs (for this example that there is a connection from P to M in the block). I want to tell Simulink there is no such connection and therefore no loop by specifying some internal connectivity relationship for my block.
댓글 수: 0
답변 (1개)
Kaustubha Govind
2012년 10월 18일
I've not tried this myself, but if the input port P is not used directly in the mdlOutputs method (can be used in mdlUpdate instead), I think you can set ssSetInputPortDirectFeedThrough to zero for that port to avoid algebraic loops.
댓글 수: 2
Kaustubha Govind
2012년 10월 22일
Mark: I'm trying to think if such an API function would make sense considering that there is only one mdlOutputs function to compute all the outputs - not sure if what you're asking for might violate some of the Simulink Engine's rules. Perhaps if it is possible, you could split your functionality into two S-function blocks and combine them into one (virtual) subsystem? So to a user, it will still be one block, but you are separating out the implementation.
Please feel free to contact MathWorks Tech Support to verify if there is a better solution, and to submit an enhancement request with your requirements.
참고 항목
카테고리
Help Center 및 File Exchange에서 Schedule Model Components에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!