Syntax
task_periodic <name> [frequency_hz] [priority]:Available in
- File scope
Native C++
Compiles supported task logic to machine code. Combine with fixed channels to reduce name-lookup work and use coherent fixed-input snapshots. Runtime attribution, commit, recording and inline reactions still have allocation or locking costs; neither the backend nor task priority guarantees a deadline.
Lifecycle
Activation creates the task and its channels; start runs once, task repeats while running, and end runs when stopped.
Persistence
Values stored in state remain available between handler calls while the task is loaded.
Reload behavior
DARTWIC tracks changes to the block and its template dependencies when loading the task.
Runtime sections
starttaskmissedend
Generated channels
<name>_running<name>_target_frequency<name>_actual_frequency<name>_execution_time<name>_missed_cycles<name>_timing_status<name>_hold<name>_failed_cycles
Example
task_periodic task_name 100 ${3|background,normal,high,critical|}:
start:
-- setup
task elapsed_seconds:
local current = |channel|
end:
-- cleanup