Use the ‘serial’ option to run your model in the External mode with serial communication.
When running a model in External mode over serial, Simulink® generates error if the Hardware Serial Port
parameter is set to
Serial 0. The error is generated because the
External mode uses serial port 0 to communicate with the Arduino board by default.
Browse to WiFi properties, and ensure that the Hardware Serial Port
parameter is set to a port other than
External mode over
XCP on WiFi on Simulink models having more than 3 multirate systems result in a connection
Serial — For AVR-based boards
XCP on Serial — For ARM-based
XCP on Serial
XCP on TCP/IP
XCP on WiFi
Select the interface through which the host computer communicates to target Arduino board for signal monitoring and parameter tuning.
This parameter appears only if you choose
Serial as the Communication
If you use the third-party product CANape® for
calibrating parameters, select
CANape from the
drop-down list. When you perform Monitor & Tune action,
an A2L file is generated, which lets you navigate through the model and access
parameters and measured values directly in CANape.
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
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,
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
that value in the Logging buffer size (in bytes)
Select this check box to view the External Mode execution progress and updates in
the Diagnostic Viewer or in the MATLAB® Command Window. This parameter appears when you select