Overview

This event is a request by the system asking the component to service its input and output interfaces. This will involve it in computing a time window, up to at least time->now. Processes that are logging should also update their log at this point, if appropriate. See Process Logs.

Context

This event is fired repeatedly during run phase (but F_FIRST_CALL and F_LAST_CALL are not set on this event).

  • On each successive call, time->now will have a new value, indicating the time at which service is being requested.
  • One or more input ports may have data available - specifically, any input port that is Due will hold a previously unseen data object, and any that is not Due will be empty. You can check if inputs are Due either by comparing time-now with the port's sample rate, or by asking the framework for the data on the port and seeing if you get anything back.
  • One or more output ports may be Due, and data on these following this call will be dispatched by the framework to any receiving processes, so this is the time to write them. You can check if outputs are Due either by comparing time-now with the port's sample rate, or by asking the framework for the data on the port and seeing if you get anything back.
  • If the process set flags F_INPUTS_SAME_RATE and F_OUTPUTS_SAME_RATE (F_NOT_RATE_CHANGER) then all inputs and all outputs will be due.

Return codes

C_STOP_USER
Return this to indicate that the execution should Soft Stop since the user has indicated cancel.
C_STOP_EXTERNAL
Return this to indicate that the execution should Soft Stop because an external input has indicated cancel.
C_STOP_CONDITION
Return this to indicate that the execution should Soft Stop because a predefined stop condition has been reached internally.

Action

  • Read new data from any inputs that are due.
  • Do your computations (this is where the real work actually gets done in BRAHMS, and it's worth three words... sheesh).
  • Update the state of any outputs as desired (this will only have an effect on the wider system when those outputs next become due). Generally, this will mean, more simply, update the state of all outputs that are due.
  • Return one of the soft stop codes to stop the execution immediately (this event will not be fired again).

Example

C++ Source Code (against 1199)
case EVENT_RUN_SERVICE: { // TODO // ok return C_OK; }