Main Content

linux.setXCPServiceConfiguration

R2026b

Set XCP service configuration for model

Since R2026b

Description

linux.setXCPServiceConfiguration("modelName") enables the XCP service for the specified model by using default settings.

linux.setXCPServiceConfiguration("modelName", Name=Value) configures the XCP service using one or more name-value arguments, such as specifying a TCP port or selecting a target computer.

example

Examples

collapse all

Enable and configure the XCP service for the model myModel.

Enable the XCP service with default settings.

linux.setXCPServiceConfiguration("myModel");

Disable the XCP service for the model.

linux.setXCPServiceConfiguration("myModel", Enabled=false);

Set TCP port for XCP connections.

linux.setXCPServiceConfiguration("myModel", TCPPort=12345);

Select a target computer for the XCP service.

linux.setXCPServiceConfiguration("myModel", Target="LinuxTarget3");

Enable the XCP service and configure the TCP port and target computer in a single call.

linux.setXCPServiceConfiguration("myModel", Enabled=true, TCPPort=12345, Target="LinuxTarget3");

Verify the configuration by retrieving the current settings.

[enabled, tcpPort, target] = linux.getXCPServiceConfiguration("myModel")
enabled =
  logical
    1

tcpPort =
  uint16
    12345

target = 
    "LinuxTarget3"

Input Arguments

collapse all

Simulink model name, specified as a character vector or string scalar. The model must be configured with the Embedded Coder Linux Docker Container or Embedded Coder Linux Docker Container-ARM64 hardware board.

Example: "myModel"

Data Types: char | string

Name-Value Arguments

collapse all

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Example: linux.setXCPServiceConfiguration("myModel", Target="LinuxTarget3");

XCP service enable flag, specified as true or false. Set to true to enable the XCP service for the generated code, or false to disable it.

Example: Enabled=false

Data Types: logical

TCP port for XCP connections, specified as a positive integer in the range [1, 65535]. The XCP service accepts connections on this port. The port is also included in the generated ASAP2 file.

Example: TCPPort=12345

Data Types: uint16

Target computer name, specified as a character vector or string scalar.

Example: Target="LinuxTarget3"

Data Types: char | string

Version History

Introduced in R2026b