Main Content

Thread Trigger

Call downstream function-call subsystem when selected input edge transition occurs

  • Library:
  • Simulink Real-Time / Async

  • Thread Trigger block

Description

When the selected input edge transition occurs, the Thread Trigger block calls the downstream Function-Call Subsystem block or Triggered Subsystem block and sets the interrupt priority of the task. The block checks for the edge transition at the block sample rate.

If the input transition occurs while the task is running, a CPU overload occurs on the target computer.

Ports

Input

expand all

Detects the edge type that is selected by using the Trigger Edge parameter as 1 for detected and 0 for not detected..

Example: 0

Output

expand all

Outputs the call to the downstream function and provides the thread scheduling priority for the task

Parameters

expand all

Selects the trigger edge type that is detected by the block input.

Programmatic Use

Block Parameter: edge

Selects the interrupt service routine task priority for the function call. You can select task priority values from 254 (highest priority) to 193 (lowest priority).

The Thread Trigger block provides means to call a Function-Call Subsystem block or Triggered Subsystem block that is a separate model thread. This thread can run with higher or lower priority than other execution threads. Each rate group in the model executes as a different execution thread. For more information, see About RTOS Tasks and Priorities.

Programmatic Use

Block Parameter: taskpri

Select the sample time for the block input to sample for edge detection.

Programmatic Use

Block Parameter: sampletime
Introduced in R2020b