Signal User Event

This MotoHawk™ block allows the event associated with USER_EVENT trigger(s) to be signalled. Signalling the event will result in those triggers executing.

Block ID

Signal User Event

Library

motohawk_tasking_lib/Trigger Blocks

Description

This MotoHawk™ block allows the event associated with USER_EVENT trigger(s) to be signalled. Signalling the event will result in those triggers executing.

Shutdown Example

The legacy Event Call block offered a way to implement a shutdown event, however that block does not give the developer the same sort of flexibility offered by a USER_EVENT trigger type solution. Shutdown could be implemented as an event with a USER_EVENT trigger like so.

When does a signaled trigger execute?

A single execution of the Signal Execution Block will result in all the USER_EVENT triggers that have a corresponding User Event Name (as specified by this block) to be scheduled to execute. When the trigger will execute is determined by the priority of the Task of each USER_EVENT trigger instance. The priority of execution where the event is signalled does not influence when the resultant USER_EVENT trigger will execute.

Consider that we have three USER_EVENT triggers, all which reference the same User Event Name, but where each has a different task priority. Say the priorities are HighestPriorityTask1, MediumTaskPriority2 and LowestPriorityTask3. The execution would be as follows if the event was signalled once from the task executing at MediumTaskPriority2.

The HighestPriorityTask1 would begin to execute as soon as the MediumTaskPriority2 execution signaled the event because it has more priority and would pre-empt the execution of the MediumTaskPriority2. Once the HighestPriorityTask1 execution was done it would yield execution. MediumTaskPriority2, which had been pre-empted, would then continue execution. The event trigger associated with the MediumTaskPriority2 won't execute until the rest of the work already scheduled to execute at the MediumTaskPriority2 had completed. The MediumTaskPriority2 event trigger would then execute. The MediumTaskPriority2 task will yield once all of its work has done. Only then can the event trigger associated with the LowestPriorityTask3 be able to execute.

Block Parameters

Parameter Field Values Comments/Description
Signal Instance Name (optional) Single quote enclosed alpha numeric that is c-legal and unique This optional name allows this instance of the event signal to be identified. There is no restriction on the number of instances of this block existing in a model that signal the same event and so naming them might be of value. If an empty cell [] is used then MotoHawk™ will automatically assign a unique name to this instance.
User Event Name Single quote enclosed alpha numeric that is c-legal This is the name of the user event to be signalled. Signalling the event will cause any USER_EVENT triggers in the model that reference this name to execute.

It is an error to signal an event that does not have at least one corresponding trigger associated with it.