External mode

Communication interface

Select the transport layer External mode uses to exchange data between the host computer and the target hardware.

Settings

Default: XCP on TCP/IP

  • XCP on TCP/IP

  • TCP/IP

Run external mode in a background

Select this check box to force the External mode engine to run the generated code in a background task.

Make sure you do not select this option for a model that has very small time step or that may encounter overruns as this may result in Simulink becoming nonresponsive.

Logging buffer size (in bytes)

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 Raspberry Pi™ 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 Raspberry Pi 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.

Port

Specify the port number through which the ThingSpeak block connects to the ThingSpeak server.

Port

Set the value of the TCP/IP or WiFi port number, from 1024 to 65535. External mode uses this port for communications between the hardware board and host computer.

Settings

Default: 17725

Verbose

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 TCP/IP or WiFi for Communication interface.