Main Content

target.CommunicationInterface Class

Namespace: target

Describe data I/O details for target hardware

Since R2020b

Description

Use the target.CommunicationInterface class to describe data transfer for your target hardware. Associate the communication channel for data transfer and the device driver API implementation with a target.CommunicationInterface object.

Properties

expand all

Name of target.CommunicationInterface object.

Attributes:

GetAccess
public
SetAccess
public

Type of communication channel that connects to the target hardware. For example, if you define PIL connectivity by using a target.TargetConnection over a target.RS232Channel, set this property to 'RS232Channel'.

Attributes:

GetAccess
public
SetAccess
public

Details of the API implementations that use the communication interface channel to support data transfer to and from the target hardware. For example, an rtiostream API implementation for PIL connectivity.

Attributes:

GetAccess
public
SetAccess
public

Examples

collapse all

Create the communication interface for the target hardware. This code snippet from Set Up PIL Connectivity by Using Target Framework (Embedded Coder) shows how to create the interface.

comms = target.create('CommunicationInterface');
comms.Name = 'Linux TCP Interface';
comms.Channel = 'TCPChannel';
comms.APIImplementations = target.create('APIImplementation', ...
                                         'Name', 'x86 rtiostream Implementation');
comms.APIImplementations.API = target.create('API', 'Name', 'rtiostream');
comms.APIImplementations.BuildDependencies = target.create('BuildDependencies');
comms.APIImplementations.BuildDependencies.SourceFiles = ...
                                                        {fullfile('$(MATLABROOT)', ...
                                                        'toolbox', ...
                                                        'coder', ...
                                                        'rtiostream', ...
                                                        'src', ...
                                                        'rtiostreamtcpip', ...
                                                        'rtiostream_tcpip.c')};
comms.APIImplementations.MainFunction = target.create('MainFunction', ...
                                                      'Name', 'TCP RtIOStream Main');
comms.APIImplementations.MainFunction.Arguments = {'-blocking', '1', '-port', '0'};
hostTarget.CommunicationInterfaces = comms;

Version History

Introduced in R2020b