| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → SimEvents |
| Contents | Index |
| Learn more about SimEvents |
| On this page… |
|---|
Procedure for Assigning Event Priorities |
To assign a numerical event priority to an event, use this procedure:
Find the block that produces the event you want to prioritize. For example, it might be an entity generator, a server, a gate, a counter, or a switch.
If the block's dialog box has an option called Resolve simultaneous signal updates according to event priority, select this option. A parameter representing the event priority appears; in most blocks, the parameter's name is Event priority.

Set the event priority parameter to a positive integer.
Note Some events have event priorities that are not numerical, such as SYS1 and SYS2. For more information about these priority values, see System-Priority Events on the Event Calendar and Processing Sequence for Simultaneous Events. |
Suppose you want to assign a numerical event priority value for Event X to defer its processing until after some simultaneous Event Y has been processed. A particular value for the event priority is not significant in isolation; what matters is the relative handling of simultaneous events. Keep these tips in mind when choosing a value for the event priority:
If Event Y does not have a numerical event priority, then any value for the event priority of Event X causes Event X to be processed later. (See Processing Sequence for Simultaneous Events for details.)
If Event Y has a numerical event priority, then choosing a larger value for the event priority of Event X causes Event X to be processed later. Simultaneous events having distinct numerical event priorities are processed in ascending order of the event priority values.
Leaving gaps in the set of numerical values you choose lets you include additional events that require intermediate-value priorities. For example, if Event Y has priority 1 and Event X has priority 2, then you cannot force an Event Z to be processed after Event Y and before Event X. On the other hand, priority values of 100 and 200 would better accommodate future growth of your model.
For examples that show the effect of changing event priorities, see Example: Choices of Values for Event Priorities and the Event Priorities demo.
If simultaneous events on the event calendar share the same numerical value for their event priorities, then the application arbitrarily or randomly determines the processing sequence, depending on a modelwide configuration parameter. To set this parameter, use this procedure:
Select Simulation > Configuration Parameters from the model window. This opens the Configuration Parameters dialog box.
In the left pane, select SimEvents.
In the right pane, set Execution order to either Randomized or Arbitrary.
If you select Arbitrary, the application uses an internal algorithm to determine the processing sequence for events on the event calendar that have the same event priority and sufficiently close event times.
If you select Randomized, the application randomly determines the processing sequence. All possible sequences have equal probability. The Seed for event randomization parameter is the initial seed of the random number generator; for a given seed, the generator's output is repeatable.
The processing sequence might be different from the sequence in which the events were scheduled on the event calendar.
![]() | Choosing an Approach for Simultaneous Events | Example: Choices of Values for Event Priorities | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |