| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → SimEvents |
| Contents | Index |
| Learn more about SimEvents |
Event Translation
This block converts a signal-based event or a function-call input into one or two function calls that you can use to invoke function-call subsystems, Stateflow blocks, or other blocks that accept function-call inputs. You specify the type of event the block translates and whether the block suppresses its output under certain conditions. You can also delay the output function calls by an amount of time that you specify via a parameter or an input signal.
The primary criterion, based on the Generate function call only upon parameter, is a signal-based event or a function call. By default, the block generates a function call upon each event of the type you specify.
To generate up to two function calls upon each event, select Generate optional f2 function call. If the block generates function calls at both the f1 and f2 output ports, then it generates the f1 call first and generates the f2 call as a subsequent part of the same operation.
To make the f1 or f2 output function call contingent upon a secondary criterion, select Suppress function call f1 if enable signal e1 is not positive or Suppress function call f2 if enable signal e2 is not positive. The block acquires an additional signal input port, labeled e1 or e2, to which you connect a control signal. If the control signal is zero or negative when the block is about to generate the function call, then the block suppresses the function call. The e1 and e2 ports operate independently of each other as secondary criteria for their respective function-call output ports.
Signal Input Ports
| Label | Description |
|---|---|
| t | The delay, in seconds, between the input event and the output function call. A positive value schedules the function call in the future, while a value of zero schedules the function call at the current simulation time. You see this port only if you select Resolve simultaneous signal updates according to event priority, and then set Function-call delay from to Signal port t. |
| ts | Primary criterion is satisfied when the application updates the signal at this port. You see this port only if you set Generate function call only upon to Sample time hit from port ts. |
| tr | Primary criterion is satisfied when the signal has a rising or falling edge, depending on the Trigger type parameter. You see this port only if you set Generate function call only upon to Trigger from port tr. |
| vc | Primary criterion is satisfied when the signal at this port increases or decreases, depending on the Type of change in signal value parameter. You see this port only if you set Generate function call only upon to Change in signal from port vc. |
| fcn | Primary criterion is satisfied when this input port detects a function call. You see this port only if you set Generate function call only upon to Function call from port fcn. Do not connect this port to an output port from the same instance of this block. |
| e1 | When this signal is 0 or negative, the block does not generate a function call at the f1 output port. You see this input port only if you select Suppress function call f1 if enable signal e1 is not positive. |
| e2 | When this signal is 0 or negative, the block does not generate a function call at the f2 output port. You see this input port only if you select Suppress function call f2 if enable signal e2 is not positive. |
Signal Output Ports
| Label | Description | Order of Update |
|---|---|---|
| f1 | Function call, possibly contingent on e1 input signal | 1 |
| f2 | Function call, possibly contingent on e2 input signal | 2 |
| #f1 | Number of function calls the block has generated at the f1 port during the simulation | 3 |
| #f2 | Number of function calls the block has generated at the f2 port during the simulation | 3 |
Output signals having the same number in the Order of Update column in the table above are updated in an arbitrary sequence relative to each other; you should not rely on a specific sequence for your simulation results.
The initial output value for the numerical signals, which is in effect from the start of the simulation until the first update by the block, is 0.

The primary criterion for determining when the block generates a function call. Optional secondary criteria are established by the Suppress function call... parameters below.
Determines whether rising, falling, or either type of trigger edge causes the block to generate a function call. You see this field only if you set Generate function call only upon to Trigger from port tr.
Determines whether rising, falling, or either type of value change causes the block to generate a function call. You see this field only if you set Generate function call only upon to Change in signal from port vc.
Selecting this option causes f1 function calls to be contingent upon a positive value at the e1 signal input port.
Selecting this option causes the block to generate a function call at the optional f2 output port when appropriate criteria are satisfied.
Selecting this option causes f2 function calls to be contingent upon a positive value at the e2 signal input port. You see this field only if you select Generate optional f2 function call.

Select this option to control the sequencing of the function-call event, relative to other simultaneous events in the simulation. If you do not select this option, the application issues the function call immediately upon detecting the signal-based event that causes it. For details, see Choosing How to Resolve Simultaneous Signal Updates.
The priority of the function-call event, relative to other simultaneous events in the simulation. For details, see Specifying Event Priorities to Resolve Simultaneous Signal Updates. You see this field only if you select Resolve simultaneous signal updates according to event priority.
Determines whether the delay between the input event and the output function call is computed from a parameter in this dialog box or from an input signal. You see this field only if you select Resolve simultaneous signal updates according to event priority.
The delay, in seconds, between the input event and the output function call. A positive value schedules the function call in the future, while a value of zero schedules the function call at the current simulation time. You see this field only if you select Resolve simultaneous signal updates according to event priority, and then set Function-call delay from to Dialog.

Controls the presence and behavior of the signal output port labeled #f1.
Controls the presence and behavior of the signal output port labeled #f2. This field is active only if you select Generate optional f2 function call on the Function Call tab of this dialog box.
Entity Departure Event to Function-Call Event
![]() | Signal Scope | Signal-Based Function-Call Event Generator | ![]() |

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 |