主要内容

Logging buffer size (in bytes)

Number of bytes to preallocate for buffer

Model Configuration Pane: Hardware Implementation / Hardware board settings / Target hardware resources / External mode

Description

Specify the number of bytes to preallocate for the buffer in the hardware during Universal Measurement and Calibration Protocol (XCP)-based External mode simulation. Specify Logging buffer size (in bytes) to a value large enough to accommodate the logged signals.

When specifying the buffer size, ensure that:

  • The maximum value of this parameter does not exceed the available Arduino® memory, which the Simulink® Real-Time™ also uses to store other items. For example, in addition to signal logging data, the software also uses the target computer memory for the Simulink Real-Time kernel, real-time application, and scopes.

    Assume that your model has six data items (time, two states, two outputs, and task execution time). If you enter a buffer size of 100000, the target object property tg.MaxLogSamples is calculated as floor(100000 / 6) = 16666. After the buffer saves 16666 sample points, it wraps and further samples overwrite the older ones.

  • You enter a logging buffer size larger than the available RAM on Arduino. When you download and initialize the real-time application, the hardware displays a message, ERROR: allocation of logging memory failed. To avoid this error, either install more RAM or reduce the buffer size for logging, and then restart the hardware. To calculate the maximum buffer size available for your real-time application logs, divide the amount of available RAM by sizeof(double), or 8. Specify that value in the Logging buffer size (in bytes) value.

Settings

1000

Default: 1000

Programmatic Use

No programmatic use is available.

Version History

Introduced in R2019a