| Using Simulink | ![]() |
Assigning Block Priorities
You can assign evaluation priorities to nonvirtual blocks in a model. Higher priority blocks evaluate before lower priority blocks, though not necessarily before blocks that have no assigned priority.
You can assign block priorities interactively or programmatically. To set priorities programmatically, use the command
set_param(b,'Priority','n')
where b is a block path and n is any valid integer. (Negative numbers and 0 are valid priority values.) The lower the number, the higher the priority; that is, 2 is higher priority than 3. To set a block's priority interactively, enter the priority in the Priority field of the block's Block Properties dialog box (see Block Properties Dialog Box).
Simulink honors the block priorities that you specify only if they are consistent with Simulink's block sorting algorithm (see Determining Block Update Order). If the specified priorities are inconsistent, Simulink ignores the specified priority and places the block in an appropriate location in the block execution order. If Simulink is unable to honor a block priority, it displays a Block Priority Violation diagnostic message (see The Diagnostics Pane).
| Disconnecting Blocks | Displaying Block Execution Order | ![]() |