The OpenECU blockset provides varied access to the features of both Simulink and the target ECU. The OpenECU blockset library groups common functionality together (as described in Section 4.1.5, “In MATLAB — Library browser (R2015a - R2020a)”):
OpenECU provides a series of blocks to store information across power cycles. The information can be stored in scalars, arrays or maps, and the scalars and maps can be adapted over time (for instance, when learning the mechanical end stops for valve positions over time). See Section 4.6.2, “Adaptive parameters” for details.
OpenECU provides a series of blocks to run an engine, including tracking synchronisation with crank and cam trigger wheels, measuring A/D inputs on an angle basis, and generating injector and coil/spark pulses. See Chapter 6, Angular detail for details.
OpenECU provides a series of communication blocks, which handle CAN, CCP (a calibration protocol over CAN), J1939 (an SAE protocol for vehicle communication) and basic signal checking. The blockset provides support for Vector CANdb files (which describe networks, CAN messages and CAN signals in detail). See Section 4.6.3, “Communications” for details.
OpenECU provides a series of blocks to adjust the compiler and linker options for a model build. Support for selecting which compiler to use as well as adjusting the options given to the compiler and linker allow some control when incorporating custom code and working around compiler bugs. See Section 4.6.4, “Compiler options” for details.
OpenECU has a mechanism for retiring old blocks and replacing them with more capable blocks through deprecation. See Section 4.6.5, “Deprecated blocks” for details.
OpenECU provides a series of blocks for fault and diagnostic trouble code logging. The fault information can be stored across power cycles and the diagnostic trouble codes can be automatically handled in some J1939 messaging. See Section 4.6.6, “Fault support” for details.
OpenECU provides a series of blocks for analogue and digital input processing. Support includes measuring analogue inputs, digital, frequency and PWM inputs. See Section 4.6.11, “Analogue and digital inputs”.
OpenECU provides a series of blocks to interact with the operating system The operating system schedules the different operations the ECU must perform to function correctly, including running the functionality assigned to each model rate. The blocks provide access to run-time schedule information, including how much processing time is taken up running all the software. See Section 4.6.13, “Operating system”.
OpenECU provides a series of blocks for analogue and digital output processing. Support includes driving constant current outputs, digital, PWM and stepper outputs. See Section 4.6.14, “Analogue and digital outputs”.
OpenECU provides a series of utility blocks to make some of the example models easier to use the first time around. These blocks can be incorporated in other models and provide quick mechanisms to configure each of the auto-coders, turn on and decode the sample time colours and build a model. See Section 4.6.15, “Real-Time Workshop (RTW) support”.
OpenECU provides a series of blocks to configure each of the target ECU specific features, not covered in a general sense by other groups of blocks. For instance, the blocks provide a mechanism to select whether some inputs are VRS single-ended or Hall effect and select the over-current trip level for some outputs. See Section 4.6.16, “Target ECU identification and configuration”.
OpenECU provides a series of blocks which provide timing information. Simulink maintains a base rate time, with a resolution as accurate as the quickest model rate. The ECU maintains a much higher resolution timer as well as access to the current time since power on. The blocks provide access to these timers. See Section 4.6.17, “Timing”.
OpenECU provides a series of blocks to perform common and general functions. These blocks are provided by OpenECU to support the same functionality across all versions of Simulink that OpenECU supports. See Section 4.6.18, “Utilities”.
OpenECU provides a series of blocks to access version information when using Simulink and when running the model on an ECU. For instance, there is a block to determine if the expected version of OpenECU is being used when editing the model, and a block to get the version of OpenECU software running an ECU. See Section 4.6.19, “Versioning”.