Task Sync

Spawn VxWorks task to run code of downstream function-call subsystem or Stateflow® chart

Library

Interrupt Templates, VxWorks

Description

The Task Sync block spawns a VxWorks task that calls a function-call subsystem or Stateflow chart. Typically, you place the Task Sync block between an Async Interrupt block and a function-call subsystem block or Stateflow chart. Alternatively, you might connect the Task Sync block to the output port of a Stateflow diagram that has an event, Output to Simulink, configured as a function call.

The Task Sync block performs the following functions:

When you design your application, consider when timer and signal input values should be taken for the downstream function-call subsystem that is connected to the Task Sync block. By default, the time and input data are read when VxWorks activates the task. For this case, the data (input and time) are synchronized to the task itself. If you select the Synchronize the data transfer of this task with the caller task option and the Task Sync block is driven by an Async Interrupt block, the time and input data are read when the interrupt occurs (that is, within the ISR). For this case, data is synchronized with the caller of the Task Sync block.

Parameters

Task name (10 characters or less)

The first argument passed to the VxWorks taskSpawn system call. VxWorks uses this name as the task function name. This name also serves as a debugging aid; routines use the task name to identify the task from which they are called.

Simulink task priority (0–255)

The VxWorks task priority to be assigned to the function-call subsystem task when spawned. VxWorks priorities range from 0 to 255, with 0 representing the highest priority.

Stack size (bytes)

Maximum size to which the task's stack can grow. The stack size is allocated when VxWorks spawns the task. Choose a stack size based on the number of local variables in the task. You should determine the size by examining the generated code for the task (and all functions that are called from the generated code).

Synchronize the data transfer of this task with the caller task

If not checked (the default),

If checked,

Timer resolution (seconds)

The resolution of the block's timer in seconds. This option appears only if Synchronize the data transfer of this task with the caller task is not checked. By default, the block gets the timer value by calling the VxWorks tickGet function. The default resolution is 1/60 second. The tickGet resolution for your BSP might be different. You should determine the tickGet resolution for your BSP and enter it in the Timer resolution field.

Timer size

The number of bits to be used to store the clock tick for a hardware timer. The size can be 32bits (the default), 16bits, 8bits, or auto. If you select auto, the Real-Time Workshop software determines the timer size based on the settings of Application lifespan (days) and Timer resolution.

By default, timer values are stored as 32-bit integers. However, when Timer size is auto, you can indirectly control the word size of the counters by setting the Application lifespan (days) option. If you set Application lifespan (days) to a value that is too large for the code generator to handle as a 32-bit integer of the specified resolution, it uses a second 32-bit integer to address overflows.

For more information, see Controlling Memory Allocation for Time Counters. See also Using Timers in Asynchronous Tasks.

Inputs and Outputs

Input

A call from an Async Interrupt block.

Output

A call to a function-call subsystem.

See Also

Async Interrupt
Asynchronous Support in the Real-Time Workshop documentation

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS