Documentation Center

  • 評価版
  • 製品アップデート

Event Filter

Conditionalize, suppress, or prioritize execution of Atomic Subsystem

Library

SimEvents Ports and Subsystems

Description

This block influences an Atomic Subsystem block by specifying the signal-based events upon which the subsystem executes. This block can also prioritize the execution of a subsystem with regard to other events occurring simultaneously by scheduling a subsystem execution on the event calendar. Consider an event-based signal that is an input to an Atomic Subsystem block. Without the Event Filter block, every sample time hit of the signal causes the subsystem to execute immediately. Inserting the Event Filter block on that signal line enables you to influence the subsystem behavior as follows:

  • Specify the type of signal-based event that causes the subsystem to execute. Choices are:

    • Sample time hit

    • Change in signal value (rising, falling, or either)

    • Trigger (rising, falling, or either)

    If the input signal of this block is a nonscalar array, the block detects one qualifying event if any of the positions in the array has a qualifying event. For example, a change in signal value from [1 2 3] to [1 5 6] represents one qualifying event, not two. If N distinct qualifying events occur at distinct sample time hits in the input signal of this block, the subsystem executes N times and updates its output signals N times.

  • Prevent the input signal of this block from causing the subsystem to execute. In this case, the signal passively provides data to the subsystem. The subsystem can still execute based on signal-based events of a different input signal.

  • Prioritize the subsystem execution, relative to other simultaneous events in the simulation. Instead of occurring immediately upon a signal-based event, the execution becomes a scheduled event on the event calendar.

Connecting to Other Blocks

The output port of this block can connect to only one input port of an Atomic Subsystem block. The connection line cannot branch.

Behavior During Simulation

When the input signal of an Event Filter block has a sample time hit, it does the following:

  1. Updates its output signal with the value of the input signal. This value is available to the Atomic Subsystem block to which the Event Filter block connects.

  2. Determines whether to execute the Atomic Subsystem block, based on the settings in the block dialog box of the Event Filter block. If the Event Filter block is not supposed to execute the Atomic Subsystem block, the Event Filter does nothing further, until the next sample time hit of the input signal. Otherwise, processing continues to the next step.

  3. Determines when to execute the Atomic Subsystem block.

    • If you did not select the Resolve simultaneous signal updates according to event priority option, the Event Filter block executes the Atomic Subsystem block immediately.

    • If you select the Resolve simultaneous signal updates according to event priority option, the Event Filter block schedules an event on the event calendar. The event time is the current simulation time. The event priority is the value of the Event priority parameter in the Event Filter block. When the event calendar executes this event, the Atomic Subsystem block performs its computation.

    • If you select both the Resolve simultaneous signal updates according to event priority option, and the configuration parameter Prevent duplicate events on multiport blocks and branched signals, the software uses the Event priority parameter to help Simulink® to sort blocks in the model. In this case, the software no longer schedules an event on the event calendar.

Ports

Signal Input Ports

LabelDescription
NoneEvent-based signal. The signal can have any fixed dimension or complexity. It has data type double.

Signal Output Ports

LabelDescription
NoneEvent-based signal whose value matches that of the input signal. This output signal connects to an input port of an Atomic Subsystem block. When the Event Filter block detects a qualifying signal-based event in its input signal, the subsystem executes immediately or the block schedules an execution event on the event calendar. (Block parameters determine the type of event that qualifies and the choice of immediate or scheduled execution.)

The initial output value is the same as that of the input signal. This value is in effect before the first sample time hit of the input signal.

Dialog Box

Execute atomic subsystem

Determines what constitutes a qualifying event in the input signal of this block. If the signal is complex, you must select Upon sample time hit or Never.

Trigger type

The type of trigger that further restricts the event type specified in Execute atomic subsystem. You see this field only if you set Execute atomic subsystem to Upon trigger.

Type of change in signal value

The type of change in the signal value that further restricts the event type specified in Execute atomic subsystem. You see this field only if you set Execute atomic subsystem to Upon change in signal.

Resolve simultaneous signal updates according to event priority

Select this option to control the sequencing of the subsystem execution in response to updates in the input signal of this block, relative to other simultaneous events in the simulation. If you do not select this option, the application executes the subsystem immediately upon detecting the signal-based event. For details, see Resolve Simultaneous Signal Updates.

Event priority

The priority of the subsystem execution event (in response to updates in the input signal of this block), relative to other simultaneous events in the simulation. For details, see Specify Event Priorities to Resolve Simultaneous Signal Updates.

Use of this parameter depends on the following:

  • You see this field only if you select Resolve simultaneous signal updates according to event priority.

  • If you also select the configuration parameter Prevent duplicate events on multiport blocks and branched signals in your model, the software uses the Event priority parameter to help Simulink to sort blocks in the model. In this case, the software does not schedule an event that you can view on the SimEvents® event calendar.

Was this topic helpful?