Call downstream function-call subsystem when selected input edge transition occurs
Simulink Real-Time / Async
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.
You can use a Thread Trigger block with a Function-Call Subsystem block that resides inside a referenced model as shown in
the figure. This approach is compatible with Simulink®
Coder™. Because the Thread Trigger block output signal is asynchronous
Coder does not permit an asynchronous output block inside a referenced model, place
the Thread Trigger block at the top level of the model. This approach does not
permit explicit partitioning. Remember to match the Asynchronous Task Specification priority
P:245) to the priority selected in the Thread Trigger
block. For more information, see About RTOS Tasks and
T — Trigger input tested for selected transition
Detects the edge type that is selected by using the Trigger Edge parameter as 1 for detected and 0 for not detected..
F — Function call output for task
Outputs the call to the downstream function and provides the thread scheduling priority for the task
Trigger Edge — Selects trigger edge type
Rising Edge (default) |
Falling Edge |
Selects the trigger edge type that is detected by the block input.
ISR Task Priority — Selects the ISR task priority for function
245 (high priority) (default) |
235 (medium priority) |
225 (low priority)
Selects the interrupt service routine (ISR) 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.
C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.
Version HistoryIntroduced in R2020b
R2022b: Removed Thread Trigger Block Sample Time Parameter
The Sample Time parameter for the Thread Trigger block is removed. The block inherits sample time from the input signal to the block.