'Set Attributes' SimEvents Block Functionality in R2016a

I have a few signals in my R2016a Simulink/SimEvents model that I want to assign as attributes as I create entities. In the previous version it looked like the 'Set Attributes' block provided a signal input to achieve this. Any idea how I do this in R2016a?

回答(1 个)

In R2016a, you should be able to use the "Event Actions" tab in the Entity Generator block to set the attributes of your entities.
Here, you can enter MATLAB code or call Simulink Functions to pick up signals on entity generation events and assign them to your entity.
- Sebastian

3 个评论

Thanks for the response. I have read (several times!) those help pages you highlighted. I am thinking that my novice status is the problem here, and I am just not where I need to be WRT MATLAB code or Simulink function block usage.
The image below shows what I currently have in my model. I am trying to preload a stream of entities that will be released into the simulation at the time dictated by one of the attributes I am trying to assign to the entities (SMS Entry Time).
The signals show as expected in the scopes, but I cannot see how I can get those signals into the entities. Am I just failing to see the correct code to access the signals in my event actions? If so, can you direct me to any help that explains this type of code generation?
I don't blame you -- it can be a bit tricky to get a grasp for MATLAB/Simulink functions.
Also, the other tricky thing is that SimEvents works with intergeneration time, so you actually have to specify the difference in time between two entities.
Easiest thing I could do is attach an example model in a ZIP file. Give it a look! In particular:
  • View the contents of the Simulink functions, which contain MATLAB functions inside that extract an index of your data and then increment to the next index.
  • The first column, which is the entry time, is in the getEntryTime function. This is used in the Entity Generation tab of the Entity Generator block.
  • The second and third columns, which are the SMS_UID and Case_UID attributes, are in the getIDs function. This is used in the Event Actions > Generator section of the Entity Generator block.
- Sebastian
Hi ,I need help to assign attribute which its value is obtained from the memory block that adds one every time an entity passes through the set attribute block as shown in the attached image. how can i do it using the "Event Actions" tab in the Entity Generator block ..can anyone help me .? thank you

请先登录,再进行评论。

类别

帮助中心File Exchange 中查找有关 Generate and Destroy Entities and Messages 的更多信息

提问:

2016-4-7

评论:

2017-11-16

Community Treasure Hunt

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

Start Hunting!

Translated by