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 Execution Order attribute to order these independent triggers. If the value of the attribute is the same then the order is implementation dependent.

The execution performance of a periodic trigger group (e.g. BGND_BASE_PERIODIC) can be measured by including the Global Periodic Trigger Slip and Execution Metric Definition block in the model. These performance metrics can be read by the application and/or exposed to instrumentation. This block, or its explicit alternative, also allow the timeliness of execution of the trigger group to be monitored.

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

The Common Event Trigger emulates the functionality of this block, but is designed to be used with the Advanced Target OS Configuration option.

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 Selects what event will fire this 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 each time an encoder tooth is detected with foreground priority. Whether missing teeth will cause the trigger to fire is dependant upon the encoder implementation. Flexible Encoder type encoder systems don't detect missing teeth, but Legacy Encoder implementations typically do detect missing teeth.
FGND_RTI_PERIODIC Trigger occurs same as FGND_RTI set in Trigger Definition Block.
FGND_2XRTI_PERIODIC Trigger occurs every second FGND_RTI event.
FGND_5XRTI_PERIODIC Trigger occurs every five FGND_RTI events.
FGND_10XRTI_PERIODIC Trigger occurs every ten FGND_RTI events.
FGND_20XRTI_PERIODIC Trigger occurs every 20 FGND_RTI events.
FGND_TDC_EVENT Trigger occurs each time the encoder observes an engine firing TDC angle (as defined by the relevent Encoder System). The execution may resolve to a physical encoder tooth or use interpolation depending upon the capability of the module being used. A Flexible Encoder implementation will use interpolation.
FGND_TDC1_EVENT Trigger occurs each time firing engine TDC#1 is observed. The execution may resolve to a physical encoder tooth or use interpolation depending upon the capability of the module being used. A Flexible Encoder implementation will use interpolation.
FGND_MIDTDC_EVENT Trigger occurs each time the encoder observes the mid way point of a firing engine TDC angle (as defined by the relevent Encoder System). Thus a two cylinder with TDCs of 0 degAfTDC#1 and 360 degAfTDC#1 would generate events at 180 degAfTDC#1 and 540 degAfTDC#1. The execution may resolve to a physical encoder tooth or use interpolation depending upon the capability of the module being used. A Flexible Encoder implementation will use interpolation.
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 each time an encoder tooth is detected with background priority. Whether missing teeth will cause the trigger to fire is dependant upon the encoder implementation. Flexible Encoder type encoder systems don't detect missing teeth, but Legacy Encoder implementations typically do detect missing teeth.
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 occurs each time the encoder observes an engine firing TDC angle (as defined by the relevent Encoder System). The execution may resolve to a physical encoder tooth or use interpolation depending upon the capability of the module being used. A Flexible Encoder implementation will use interpolation.
BGND_TDC1_EVENT Trigger occurs each time firing engine TDC#1 is observed. The execution may resolve to a physical encoder tooth or use interpolation depending upon the capability of the module being used. A Flexible Encoder implementation will use interpolation.
ONE_SECOND_EVENT Trigger every second, regardless of base rate settings.
ONE_MINUTE_EVENT Trigger every minute, 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.
  •