simevents Matlab Discrete-Event System set path based on input?

2 ビュー (過去 30 日間)
Ho Jung Kim
Ho Jung Kim 2022 年 7 月 11 日
回答済み: Githin George 2023 年 11 月 3 日
Is there a way to decide entity output based on input parameters in Matlab Discrete-Event System? For example, I want to send entity to output 1 if input 2 is 1 and 2 if input 2 is 1. This is the code that I wrote, but I am getting this error:
Invalid entity storage 2 assigned by method 'getEntityStorageImpl' of the discrete-event system 'sendBasedOnOperator' for 'QNMHP3_0_2/MATLAB Discrete-Event System2' to input port 2 in input connection.
Is there a way to do this with Discrete-Event System or any simevents block?

回答 (1 件)

Githin George
Githin George 2023 年 11 月 3 日
Hello,
My understanding of your question is that you would like to Select an entity output port for departure for an incoming entity based on some criteria.
For this purpose, you could use the ‘Entity Output Switch block from SimEvents Library, with the block parameter ‘Switching criterion’ set to ‘From control port’.
You can use a ‘Simulink Function’ block to model the behaviour you require such that the Entity is directed to the correct output.
I’m also attaching a link to an Example provided in SimEvents Documentation that, shows the setup for the model.
I hope this helps.

カテゴリ

Help Center および File ExchangeDiscrete-Event Simulation についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by