Can a signal go to a server ? in simulink

2 views (last 30 days)
john
john on 1 Feb 2025
Commented: john on 20 Feb 2025
In simulink, I want some incoming signals to be delayed before reaching their final destination. Because I want to have knowledge about how many signals are being delayed and other statistics, I want to use a server instead of a delay block to use its statistics option. Can a signal pass through a entity server? Any ideas?

Answers (2)

Anay
Anay on 5 Feb 2025
Hi John,
Yes, it is possible to pass signals to an “Entity Server” block. The signals will be delayed by the amount in “Service time value” parameter of the Entity Server. Entities are discrete items which can be defined in a discrete-event simulation.
So, the signals you want to pass to the entity server must be discrete. You must use an “Entity Generator” block to generate entities for your signals before passing them to the Entity Server.
Here is an example Simulink model for your reference to pass signals to an Entity Generator:
To replicate the example, add the following blocks to your Simulink model: Entity Generator Block, Entity Server Block, Simulink Function Block, and Scope Block. Connect them as depicted in the reference image. Configure the Simulink Function Block to output your desired signal.
However, keep in mind that if the Entity Server's capacity is less than the number of entities generated during its service time, it may lead to missed entities.
You can refer to the documentation of Entity Server block from the below attached link.
I hope this clarifies your query.
  3 Comments
Anay
Anay on 6 Feb 2025
Hi John,
As I mentioned, you have to convert the signals to entities before passing them to the “Entity Server” block. You can convert the output entities from the Entity Server back to signal using a “Simulink Function” block.
Following is the implementation of Simulink Function block which implements the function “sig_output” used to convert entities to signal for your reference:
In the Block Parameters dialog of the Entity Server block under the “Events action” tab, call the function implemented by the Simulink Function block.
This will make the Entity Server call the Simulink Function block every time it services an entity. Output of this Simulink Function block is the delayed signal.
john
john on 6 Feb 2025
I dont understand, sorry. I want the signal coming from enabling the number of entites departed from the entity server's block statistics to somehow generate a new entity. At the beginning of the mode I have an entity generator that provides entities to a server but from that entities I want to make some others from the signal generated.

Sign in to comment.


Laurent Royer
Laurent Royer on 19 Feb 2025
Hi John,
Does the attached example fit your need? Run the simulation and open the Data Inspector to compare the server block and the delay block approaches.
  1 Comment
john
john on 20 Feb 2025
thanks, I used a different aproach with a matlab function.

Sign in to comment.

Products


Release

R2024b

Community Treasure Hunt

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

Start Hunting!