Main Content

VxWorks Task

Spawn task function as separate VxWorks thread

Add-On Required: This feature requires the Embedded Coder Support Package for AMD SoC Devices add-on.

  • VxWorks Task block

Libraries:
Embedded Coder Support Package for AMD SoC Devices

Description

Use this block to create a task function that spawns as a separate VxWorks® thread. The task function runs the code of the downstream Function-Call Subsystem block.

The VxWorks Task block uses a first-in, first-out (FIFO) scheduling algorithm, which executes real-time processes without time slicing. With FIFO scheduling, a higher-priority process preempts a lower-priority process. While the higher-priority process runs, the lower-priority process remains at the top of the list for its priority. When the scheduler blocks the higher-priority processes, the lower-priority process resumes.

The default thread scheduling policy is FIFO Scheduling.

Examples

Ports

Output

expand all

A function-call control signal that triggers a Function-Call Subsystem block.

Parameters

expand all

To edit block parameters interactively, use the Property Inspector. From the Simulink® Toolstrip, on the Simulation tab, in the Prepare gallery, select Property Inspector.

To set the block parameter value programmatically, use the set_param function.

To get the block parameter value programmatically, use the get_param function.

Assign a name to this task. You can enter up to 32 letters and numbers. Do not use standard C reserved characters, such as the / and : characters.

Programmatic Use

Block Parameter: taskName

When you set Thread scheduling policy to SCHED_FIFO, you can set the priority of the thread from 1 to 99 (low-to-high). Higher-priority tasks can preempt lower-priority tasks.

Programmatic Use

Block Parameter: taskPriority

Version History

Introduced in R2016b