Mex Function - specifying an input to output port dependency
8 次查看(过去 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 中查找有关 Simulink Functions 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!