Main Content

target.Connection class

Package: target

Base class for target connection properties

Description

Capture target connection properties by using a class derived from target.Connection. For example, use the target.TargetConnection class to describe a target connection from the development computer, inheriting properties from the target.Connection class.

Class Attributes

Abstract
true
HandleCompatible
true

For information on class attributes, see Class Attributes.

Properties

expand all

Name of the connection object.

Attributes:

GetAccess
public
SetAccess
private

Use this property to associate the connection with a specific target.CommunicationChannel that is used to determine common connection properties between the connected systems. For example, target.RS232Channel.

Attributes:

GetAccess
public
SetAccess
public

Examples

collapse all

This code from Set Up PIL Connectivity by Using target Package shows how to specify the connection between your development computer and target hardware. In the example, the target application runs on your development computer as a separate process and uses a TCP communication channel through localhost.

connection = target.create('TargetConnection');
connection.Name = 'Host Process Connection';
connection.Target = hostTarget;
connection.CommunicationChannel = target.create('TCPChannel');
connection.CommunicationChannel.Name = 'External Process TCPCommunicationChannel';
connection.CommunicationChannel.IPAddress = 'localhost';
connection.CommunicationChannel.Port = '0';
Introduced in R2020b