- Open the Simulink file and locate the entity server block in which you want to work on.
- Double click on ther entity server block to open its block parameters.
- In the block parameters dialog, find the Service Time parameter and set it to a default value (e.g., 10).
- Right-click on the entity server block and select Create > Data > Parameter Object.
- In the Parameter Object dialog, give a name to the parameter object (e.g., "ServiceTime").
- In the Parameter Object dialog, click on the Add button and select the Service Time parameter from the entity server block.
- Click OK to create the parameter object.
- In your Simulink model, add a Simulink Function block where you want to retrieve the service time value.
- Inside the Simulink Function or MATLAB Function block, use the get_param function to retrieve the value of the Service Time parameter from the parameter object.
how to call the service time of an entity service
5 ビュー (過去 30 日間)
古いコメントを表示
I have a simulink program with different entity SERVERs where I specified the service time value (e.g. 10).
Is there a way to call that service time value without inserting a constant equal to 10?
So a way that once I call service time value of entity server 1 (through a simulink function), it shows automatically the value 10?
Thank you
0 件のコメント
回答 (1 件)
Rishav
2023 年 9 月 5 日
編集済み: Rishav
2023 年 9 月 5 日
Hi Laila,
It is possible to retrieve the service time value of an entity server in Simulink without explicitly inserting a constant value. You can acheive this by using Simulink's Parameter Objects feature.
Here's an approach:
serviceTime = get_param('ServiceTime', 'Value');
This 'serviceTime' variable will reflect the current value of service time parameter of the entity server block.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Statistics and Data Analysis についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!