Run on Target Hardware Pane

Run on Target Hardware Pane Overview

Specify the options for creating and running applications on target hardware.

Configuration

To configure a Simulink® model for Run on Target Hardware, select Tools > Run on Target Hardware > Prepare to Run.

Then:

  1. Set the Target hardware parameter to match your hardware.

  2. (Optional) Review and set the other parameters.

  3. Apply the changes.

Tip

After configuring a Simulink model for Run on Target Hardware, you can reopen the configuration parameters by selecting Tools > Run on Target Hardware > Options.

Target hardware

Select the type of hardware upon which to run your model.

Changing this parameter updates the Configuration Parameters dialog so it only displays parameters that are relevant to your target hardware.

To install support for target hardware, start Support Package Installer by selecting Get more, or by entering supportPackageInstaller in the MATLAB® Command Window.

After installing support for your target hardware, reopen the Configuration Parameters dialog and select your target hardware.

Settings

Default: None

None

This setting means your model has not been configured to run on target hardware. Choose your target hardware from the list of options.

Get more...

Select this option to start Support Package Installer and install support for additional hardware.

External mode transport layer

Select the transport layer the External mode uses to communicate between the Arduino® hardware and the host computer:

  • serial uses the standard serial USB connection.

  • tcpip uses the Ethernet connection specified by the Ethernet shield properties.

  • wifi uses the Wi-Fi connection specified by the WiFi shield properties.

Enable External mode

Enable External mode to tune and monitor a model while it runs on your target hardware.

With External mode, changing a parameter value in the model on the host changes the corresponding value in the model running on the target hardware. Similarly, scopes in the model display data from the model running on target hardware.

Enabling External mode adds a lightweight server to the model running on the target hardware. This server increases the processing burden upon the target hardware, which can result in an overrun condition. If you enable the Enable overrun detection check box, and the software reports an overrun, consider disabling External mode.

Enabling the External mode parameter makes the following communication-related parameters visible:

  • Set host COM port LEGO® MINDSTORMS® NXT hardware and Arduino Mega 2560 hardware

  • TCP/IP port (1024-65535) for BeagleBoard and PandaBoard hardware

Enabling the External mode parameter disables the Enable communication between two NXT bricks parameter LEGO MINDSTORMS NXT hardware.

Settings

Default: Disabled

Disabled

The model application does not support External mode.

Enabled

The model application supports External mode.

IP address

The IP address of the LEGO MINDSTORMS EV3 brick.

Connection type

Choose the connection Simulink uses to download your model from the host computer to the NXT hardware.

Set up a USB or Bluetooth® connection before running the model on the NXT hardware.

    Note:   The NXT hardware always uses a Bluetooth connection for External mode communications. The Connection type parameter does not affect External mode communications.

Settings

Default: USB connection

USB connection

Use a USB connection to download a model to the NXT hardware.

Bluetooth connection

Use a Bluetooth connection to download a model to the NXT hardware.

Device name

This parameter appears when the Target hardware parameter is set to LEGO MINDSTORMS NXT and the Connection type parameter is set to Bluetooth connection.

While you are setting up a Bluetooth connection, get the name of the NXT hardware in Windows® Devices and Printers and assign it to the Device name parameter. For example, if the Windows device name is "myNXT", enter myNXT for Device name parameter in the Configuration Parameters dialog.

TCP/IP port (1024-65535)

This parameter appears when the Target hardware setting supports External mode.

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

Settings

Default: 17725

Enable overrun detection

Detect when a task overruns occurs in a Simulink model running on the target hardware. Indicate when an overrun has occurred.

A task overrun occurs if the target hardware is still performing one instance of a task when the next instance of that task is scheduled to begin.

The "Detect and Fix Task Overruns" topics listed in the following "See Also" subtopic describe how your target hardware indicates that an overrun has occurred.

You can fix overruns by decreasing the frequency with which tasks are scheduled to run, and by reducing the number or complexity of the tasks defined by your model.

If those solutions do not fix the task overrun condition, and you are using External mode, consider disabling External mode.

Settings

Default: Disabled

Disabled

Do not detect overruns.

Enabled

Detect overruns and generate an error message when an overrun occurs.

Device

This parameter appears when the Target hardware parameter is set to one of the Samsung Galaxy Android™ devices, and Show advanced settings has been clicked.

Select the Samsung Galaxy device you are using. The list includes any devices that are connected to your computer and turned on, including Android emulators.

To see a device that was recently connected and turned on, click Refresh. Refreshing the parameters update Device, Host name, and Package name.

Settings

Default: None

Package name

This parameter appears when the Target hardware parameter is set to one of the Samsung Galaxy Android devices, and Show advanced settings has been clicked.

Update this value with a unique name. Refer to the Android Developer instructions the package attribute in <manifest>. The package name uniquely identifies the application you are creating, and determines the path names your application uses. To avoid conflicts with apps created by other developers, use a domain name that you own as the beginning of the package name. Reverse the order of the elements, like this: com.mydomain.myappname.

    Warning   Do not use com.example to publish applications (make the app publicly available).

Settings

Default: com.example

Digital output to set on overrun

This parameter appears when the Target hardware parameter is set to Arduino Mega 2560, Arduino Uno, and Arduino Nano and the Enable overrun detection check box is selected.

Select the digital output pin the Arduino hardware uses to signal a task overrun.

Do not use a pin that is assigned to another block within the model.

Settings

Default: 13

Enable communication between two NXT bricks

This parameter appears when the Target hardware parameter is set to LEGO MINDSTORMS NXT.

You can enable direct Bluetooth communication between two NXT bricks. Enabling this parameter makes the Bluetooth mode parameter appear.

Enabling the Enable communication between two NXT bricks parameter disables External mode for LEGO MINDSTORMS NXT hardware.

Settings

Default: Disabled

Disabled

Disable communication between two NXT bricks.

Enabled

Enable direct Bluetooth communication between two NXT bricks.

Bluetooth mode

This parameter appears when the Target hardware parameter is set to LEGO MINDSTORMS NXT.

If you enable the Enable communication between two NXT bricks parameter, configure the Bluetooth device on one NXT brick to be a Bluetooth master or slave.

This parameter only applies to Bluetooth communications between two NXT bricks. It does not apply to Bluetooth communications between the host computer and the NXT brick.

Selecting Master makes the Bluetooth slave address parameter appear.

Settings

Default: Master

Master

The Bluetooth device on the NXT brick operates as a master. Selecting this option enables the Slave Bluetooth address parameter.

Slave

The Bluetooth device on the NXT brick operates as a slave.

Slave Bluetooth address

This parameter appears when the Target hardware parameter is set to LEGO MINDSTORMS NXT and the Bluetooth mode parameter is set to Master.

Enter the address of the slave Bluetooth device on other NXT brick.

Host name

This parameter appears when the Target hardware requires a network connection to load the model or application to the target hardware.

When you use the Support Package Installer to update the firmware on the target hardware, the Support Package Installer automatically gets the value of the IP address from the target hardware and applies it to this parameter.

If you swap boards, or change the IP address of the target hardware, get the value of the new IP address and enter it here.

User name

This parameter appears when the Target hardware parameter is set to BeagleBoard or PandaBoard.

Enter the root user name for Linux® running on the BeagleBoard or PandaBoard hardware.

When you use the Support Package Installer to update the BeagleBoard or PandaBoard firmware, the Support Package Installer automatically applies the value you entered there to this parameter.

Settings

BeagleBoard Default: ubuntu

PandaBoard Default: linaro

Password

This parameter appears when the Target hardware parameter is set to BeagleBoard or PandaBoard.

Enter the root password for Linux running on the BeagleBoard or PandaBoard hardware.

When you use the Support Package Installer to update the firmware on the BeagleBoard or PandaBoard hardware, the Support Package Installer automatically applies the value you entered there to this parameter.

Settings

BeagleBoard Default: temppwd

PandaBoard Default: linaro

Build directory

This parameter appears when the Target hardware parameter is set to BeagleBoard or PandaBoard.

Enter the build directory for Linux running on the BeagleBoard or PandaBoard hardware.

When you use the Support Package Installer to update the firmware on the BeagleBoard or PandaBoard hardware, the Support Package Installer automatically applies the value you entered there to this parameter.

Settings

BeagleBoard Default: /home/ubuntu

PandaBoard Default: /home/linaro

Set host COM port

This parameter appears when the Target hardware parameter is set to LEGO MINDSTORMS NXT, Arduino Mega 2560, or Arduino Uno.

Automatically detect or manually set the COM port your host computer uses to communicate with the target hardware.

    Warning   Do not connect Arduino Uno and Arduino Mega 2560 to a RS-232 serial interface, commonly found on computers and equipment. RS-232 interfaces can use voltages greater than 5 Volts, which can damage your Arduino hardware.

Settings

Default: Automatically

Automatically

Let the software determine which COM Port your host computer uses.

Manually

Select this option to display the COM port number parameter.

COM port number

This parameter appears when the Target hardware parameter is set to LEGO MINDSTORMS NXT, Arduino Mega 2560, or Arduino Uno, and the Set host COM port parameter is set to Manually.

Manually set the number of the COM Port the host computer uses to communicate with the target hardware, and then enter it here.

    Warning   Do not connect Arduino Uno and Arduino Mega 2560 to a RS-232 serial interface, commonly found on computers and equipment. RS-232 interfaces can use voltages greater than 5 Volts, which can damage your Arduino hardware.

Settings

Default: 0

Analog input reference voltage

This parameter appears when the Target hardware parameter is set to Arduino Mega 2560 or Arduino Uno.

Set the reference voltage used to measure inputs to the ANALOG IN pins.

    Warning   Only connect an external power source to AREF while this parameter is set to External. Connecting an external power source to AREF while this parameter is set to any other option exposes the internal voltage references to the external voltage. This voltage difference can damage your hardware.

    Do not connect Arduino Uno and Arduino Mega 2560 to voltages greater than 5 Volts.

    Do not connect Arduino Due to voltages greater than 3.3 Volts.

    Voltages greater than the specified limits can damage your Arduino hardware.

Settings

Default: Default

Default

Use the default operating voltage of the board. For Arduino Uno and Arduino Mega 2560 the operating voltage is 5 Volts.

Internal (1.1 V)

Valid for Arduino Mega 2560 only: Use the internal 1.1 Volt reference.

Internal (2.56 V)

Valid for Arduino Mega 2560 only: Use the internal 2.56 Volt reference.

External

On the Arduino Uno, Arduino Nano and Arduino Mega 2560, use an external 0-5 volt power supply connected to the AREF pin. This voltage should match the voltage of the power supply connected to the Arduino hardware. If your application requires low-noise measurements, use this option with a filtered power supply.

Serial 0 baud rate, Serial 1 baud rate, Serial 2 baud rate, Serial 3 baud rate

Arduino Uno hardware has one serial port, Serial 0. Arduino Mega 2560 and Arduino Due hardwares have four serial ports, Serial 0 through Serial 3.

Set the baud rate of the serial port on the Arduino hardware.

If you set Set host COM port to Manually, then set Serial 0 baud rate as described in the "Set the COM Port and Baud Rate Manually" topic.

Settings

Default: 9600

300, 1200, 2400, 4800, 9600, 14400, 19200, 28800, 38400, 57600, 76800, 115200, 128000, 500000, 1000000

IP address

Enter the IP address of the Arduino Ethernet shield.

MAC address

Enter the machine address of the Arduino Ethernet shield.

IP address

Enter the IP address of the Arduino WiFi shield.

Service set identifier (SSID)

Enter the SSID of your network. An SSID is a unique ID consisting of 32 characters and is used for naming wireless networks. An SSID ensures that the data you send over the network reaches the correct destination.

WiFi encryption

The WiFi encryption that is used in the network you connect to.

Settings

Default: None

None

Select this option when you connect to a network that is not WiFi encrypted.

WPA

Select this option when you connect to a network that uses WPA WiFi encryption.

WEP

Select this option when you connect to a network that uses WEP WiFi encryption.

WPA password

This parameter appears only when you select WPA option in the WiFi encryption parameter. Enter the WPA password of the network.

WEP key

This parameter appears only when you select WEP option in the WiFi encryption parameter. Enter the WEP key of the network.

WEP key index

This parameter appears only when you select WEP option in the WiFi encryption parameter. Enter the WEP key index of the WEP key.

Was this topic helpful?