MotoHawk OBD Fault Iterator

Use this block to iterate through the OBD Fault Definitions in the OBD Fault Manager, and get a obdfault_T reference to each one matching a given criteria.

This block can be used to iterate through:

Input a obdfault_T reference, and the next fault will be output. If a null obdfault_T is provided at the input, the first fault will be output. If no faults are available matching the given criteria, then the block will output a null obdfault_T, and the Valid output will be false.

Because the output is null at the end of the iteration, it may be used as the next input, starting the iteration over. To skip the null obdfault_T, and simply loop back to the beginning, check 'Continue looping through faults'. When this is checked, the Valid will remain true, and there will be no way to determine when the loop starts over. Of course, if no faults are available, the output will be null and Valid will be false.

The faults are kept in a fixed list and this block iterates through them in a fixed order. If a fault condition changes during the iteration of the fault list the fault's status may or may not be detected during the current scan of the list. If the fault is ordered before the current fault, the changed condition will not be detected unless the list is rescanned. If the fault is ordered after the current fault the changed condition will be found as the application iterates through the faults.

It is possible for another task to preempt the fault iterator and thus change the fault conditions. For example, a fault can enter the Suspected condition while trying to count the number of "Suspected" faults in another task using this block. If the iteration of the faults needs to be coherent, then it is recommended that the user place the entire operation within a critical region.

Block ID

OBD Fault Iterator


MotoHawk OBD Fault Manager


Block Parameters

Parameter Field Values Comments/Description
Loop through Drop-down list Choose one of the following conditions: Suspected, Pending, Confirmed, Ready, MIL Request, Previously Active, Permanent, Test Failed Since Last Clear, Failed This Drive Cycle, Test Complete This Drive Cycle, Test Failing, Failed Last Drive Cycle, or Test Failed Since Key Cycle.
Continue looping through faults Checkbox Checked = loop through all faults (no NULL occurs at end of list), Unchecked = loop through all faults (no NULL)