External mode operation enables you to run a Simulink model on an embedded target, while the host PC simulation runs using real-time data relayed back from the target. External mode is achieved by code generation from the model, code compilation, and code deployment to the target.
This mode of operation is useful to test the real-time execution performance of the model on real hardware and to view the results in Simulink in real-time at the same time. It allows for easy parameter tuning and signal logging.
For more details on preparing your model to run in external mode, along with details on the many features this mode provides, refer to the following documentation page:
You can run your model in external mode via two communication interfaces, serial or CAN:
1. EXTERNAL MODE OVER SERIAL
For serial interface, starting with R2019b, you have an option to choose between:
- Classic External Mode
- External Mode over XCP
1.1 Classic External Mode - Serial
In this mode, the communication channel is serial. SCI-A module on C2000 controllers is the default module for serial communication for external mode operation. The host (PC) and controller (C2000 device) exchange data over the SCI serial channel at the configured baud rate.
Texas Instruments ships Control Cards and Launchpads with an onboard Serial-USB emulator (FTDI chip). So, when a control card/Launchpad board is connected to the host PC, a virtual COM port is available in the host machine which is used to communicate with the controller for external mode operation.
For more details on configurations related to the COM port, SCI module, and external mode type, please refer to the section "Configure the Hardware and Model for Monitoring and Tuning" at the following documentation page:
You can also have a look at:
It is also possible to use ‘Serial over RS-232’ as an alternative to ‘serial over USB emulation’. For more details on getting your hardware ready for serial over RS-232, please refer to the following documentation page:
Please pay attention to the J9 jumper on the docking station in the above page.
1.2 External Mode via XCP - Serial
In this Mode, the communication channel is based on the universal measurement and calibration protocol, i.e XCP on serial – XCP being the de-facto industry standard for signals streaming and calibration. External mode over XCP brings some advantages over classic like improved performance, data streaming to SDI (Signal Data Inspector), Dashboard blocks, Logic Analyzer.
Additional details on XCP based external mode can be found from the below documentation page.
1.3 Additional note
Starting with R2020b, you can now select any supported SCI module (e.g. SCI_B, SCI_C etc.) to run the serial external mode which is true for a custom hardware board depending upon which serial module is exposed (Rx and Tx pins). On top of this, you would need a Serial-USB emulator for a custom hardware board.
2. EXTERNAL MODE OVER CAN
As of R2020b, only Classic External Mode over CAN is supported.
2.1 Classic External Mode - CAN
Classic External Mode over CAN makes use of the CAN calibration protocol (CCP) to monitor signals and tune parameters in the application code running on the target device. To prepare your model for external mode operation over CAN, please refer to the following documentation page:
For setting up the CAN hardware for communication between Target and Host, please refer to the documentation page: