- 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
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
Rishav
el 5 de Sept. de 2023
Editada: Rishav
el 5 de Sept. de 2023
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 comentarios
Ver también
Categorías
Más información sobre Simulink Functions en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!