Main Content

simulink.event.InputWriteTimeout

R2026b

Trigger schedule event when input port value does not update within specified time

Since R2022b

    Description

    Use a simulink.event.InputWrite object to configure a root-level input port in a rate-based model to create a schedule event each time the input port value does not update within a specified amount of time. You can model and simulate quality of service effects by using event triggers, such as the InputWriteTimeout object, to execute partitions in response to the flow of data into a model.

    Event triggers create schedule events based on the runtime activity at a particular location in the model. The schedule for the model determines which partitions execute in response to the schedule event as well as the event priority. To execute one or more partitions in response to the flow of data into a model, configure event triggers on one or more root-level input ports in the model. To configure the schedule for your model, use the Schedule Editor.

    The Events parameter of an Inport or In Bus Element block stores the event triggers associated with the port. Each event trigger maps an input event related to the flow of data into the port to the name of the schedule event to trigger. The table summarizes the event triggers you can configure on root-level input ports. You can configure an input port with one event trigger for each input event.

    Input EventInput Event DescriptionEvent Trigger Object
    Input writeValue for input port updates.simulink.event.InputWrite
    Input write timeoutInput port value does not update within a specified amount of time.simulink.event.InputWriteTimeout
    Input write lostInput port value update overwrites unprocessed data.simulink.event.InputWriteLost

    To configure the schedule for your model, use the Schedule Editor.

    Creation

    You can configure the event triggers for an input port programmatically or interactively.

    • When you configure an event trigger programmatically, create and configure the event trigger object yourself using the simulink.event.InputWriteTimeout function.

    • When you configure an event trigger interactively by using the Block Parameters dialog box or the Property Inspector, the software creates and configures the event trigger object.

    Description

    writeTimeout = simulink.event.InputWriteTimeout creates the event trigger writeTimeout that you can use to configure an input port to trigger a specified schedule event each time the input port value does not update within the specified amount of time.

    example

    Properties

    expand all

    Event to trigger when input port value does not update within specified time, specified as a string or a character vector. The event name must be 'Auto' or the name of an event defined in the Schedule Editor.

    By default, the event name is 'Auto'. When you update or compile a model that has an input port configured with an InputWriteTimeout event trigger with the event name 'Auto', the software creates a schedule event that is scoped to the block. For example, for a block named Inport, the software creates the event Inport.InputWriteTimeout. Use the Schedule Editor to configure the listener for the event.

    Example: inTimeout.EventName = "myEvent" configures the event trigger object inTimeout to trigger the event myEvent that is defined in the Schedule Editor.

    Data Types: char | string

    Time limit for update of input port value, specified as a string or a character vector that defines a positive numeric value.

    Example: inTimeout.Timeout = "1" configures the event trigger object inTimeout with a timeout of one second.

    Data Types: char | string

    Examples

    Version History

    Introduced in R2022b