Function Trigger

This MotoHawk™ block triggers a Simulink Function-Call subsystem, via ControlCore's tasking kernel.

Block ID

motohawk_trigger

Library

MotoHawk_lib/Trigger Blocks

Description

 

This block is the root of each MotoHawk task. More than one trigger may be placed in a model associated with the same event. In this case, use the 'Priority Order' to order these independent triggers. If the priorities are the same, then the order is implementation dependent. In case of periodic triggers (e.g. BGND_BASE_PERIODIC) it is possible to enable the execution time measurement. See Component Control Core Performance Measurement for details.

A MotohHawk help topic on Triggers will also provide further detail on the operation of triggers.

Block Parameters

Parameter Field Values Comments/Description
Trigger Name Alpha-numeric text, single-quote enclosed Set the text that will be appended to code generated function name. This is useful when using a difference tool to compare the difference from one build to another. If this is left as an empty cell the appended value will be generated at build time, and can change from build to build.
Trigger Set the type of trigger.
  IDLE_EVENT Trigger when ControlCore detects an idle condition (no work of any priority besides idle is pending).
STARTUP_EVENT Trigger when ControlCore detects a startup condition. Startup can be because of power-up because of a key on event, or because of a module reset. This trigger will execute before any periodic triggers (like RTI) will execute.
SHUTDOWN_EVENT Triggers in response to the execution of the Event Call block with the "SHUTDOWN_EVENT" selected. Trigger execution is synchronous if the Event Call used Send and will be asynchronous if a Post was used. A post by a ClassicControlCore target will execute at the lowest priority. MotoCoder based targets will execute this post in the Shutdown task, which has a priority higher than most other work. The intent of this event is to allow the application to execute work associated with preparing to shutdown the module.
FW_CLOSE Triggers when ControlCore has completed all of its activities related to the execution of the shutdown block. Such activities could include saving the calibration. The trigger will execute at the same tasking context as was used to execute the shutdown block. Care should be taken when executing code from this trigger because only limited functionality is available due to ControlCore having shutdown. Most modules do not support this trigger.
FGND_30 Trigger occurs approximately every 30 degCA with foreground priority
FGND_60 Trigger occurs approximately every 60 degCA with foreground priority
FGND_90 Trigger occurs approximately every 90 degCA with foreground priority
FGND_120 Trigger occurs approximately every 120 degCA with foreground priority
FGND_180 Trigger occurs approximately every 180 degCA with foreground priority
FGND_360 Trigger occurs approximately every 360 degCA with foreground priority
FGND_720 Trigger occurs approximately every 720 degCA with foreground priority
FGND_HIRES Trigger occurs on each detected encoder tooth with foreground priority
FGND_RTI_PERIODIC Trigger occurs same as FGND_RTI set in Trigger Definition Block.
FGND_2XRTI_PERIODIC Trigger occurs every second FGND_RTI event (as set in Trigger Definition Block).
FGND_5XRTI_PERIODIC Trigger occurs every five FGND_RTI events (as set in Trigger Definition Block).
FGND_10XRTI_PERIODIC Trigger occurs every ten FGND_RTI events (as set in Trigger Definition Block).
FGND_20XRTI_PERIODIC Trigger occurs every 20 FGND_RTI events (as set in Trigger Definition Block).
FGND_TDC_EVENT Trigger on each firing TDC with foreground priority.
FGND_TDC1_EVENT Trigger once per cycle on TDC#1 with foreground priority.
FGND_MIDTDC_EVENT Trigger midway between each firing TDC.
BGND_30 Trigger occurs approximately every 30 degCA with background priority.
BGND_60 Trigger occurs approximately every 60 degCA with background priority.
BGND_90 Trigger occurs approximately every 90 degCA with background priority.
BGND_120 Trigger occurs approximately every 120 degCA with background priority.
BGND_180 Trigger occurs approximately every 180 degCA with background priority.
BGND_360 Trigger occurs approximately every 360 degCA with background priority.
BGND_720 Trigger occurs approximately every 720 degCA with background priority.
BGND_HIRES Trigger occurs on each detected encoder tooth with background priority.
BGND_BASE_PERIODIC Same as BGND_BASE set in Trigger Definition Block.
BGND_BASEx2_PERIODIC Multiple of BGND_BASE in Trigger Definition Block.
BGND_BASEx10_PERIODIC Multiple of BGND_BASE in Trigger Definition Block.
BGND_BASEx20_PERIODIC Multiple of BGND_BASE in Trigger Definition Block.
BGND_BASEx40_PERIODIC Multiple of BGND_BASE in Trigger Definition Block.
BGND_BASEx80_PERIODIC Multiple of BGND_BASE in Trigger Definition Block.
BGND_BASEx1200_PERIODIC Multiple of BGND_BASE in Trigger Definition Block.
BGND_TDC_EVENT Trigger on each firing TDC with background priority.
BGND_TDC1_EVENT Trigger once per cycle on TDC#1 with background priority.
ONE_SECOND_EVENT Trigger every second, regardless of base rate settings.
ONE_MINUTE_EVENT Trigger every second, regardless of base rate settings.
Execution Order within Task Numeric (Integer) More than one trigger may be placed in a model that is driven by the same event. Use the Execution Order within Task attribute to define the execution order of these triggers relative to one another. The triggers will execute from the lowest Execution Order within Task value to the highest.

Only triggers with the same tasking priority will be guaranteed to execute in the defined order. See the Control Core Tasking help topic for more information.
This trigger is inside another triggered subsystem Check Box (enable) Enable if trigger is inside another triggered subsystem. Trigger attempts to simulate the block inside of another triggered rate, when the rate is periodic. The most common reason to enable is to place a background periodic task inside of a foreground periodic task, or vice versa. The trigger from this block may occur in bursts, synchronized to the outer rate, while simulating, but will perform as expected on the target. Do not enable on top-level triggers, otherwise the block will not simulate at all.
Trigger even when containing subsystem is disabled Check Box (enable) If this trigger is used inside of a containing subsystem, normally the triggered subsystem will pause and resume based on the enable/disable status of the containing subsystem. Checking this causes triggers to occur even while the parent is disabled. Note that this feature will not simulate, but will execute correctly on the target.
Trigger even when Application Monitor is paused or stopped Check Box (enable) When checked this trigger will fire even when the Application Monitor indicates that execution is paused or stopped.
  • NOTE1: This feature will not simulate, but will execute correctly on the target.
  • NOTE2: When checked, IO must NOT be driven from this trigger. Outputs are continuallly disabled when the Application Monitor stops the application. Driving an output in an enabled trigger could result in oscillation.