主要内容

target.CommunicationChannel 类

命名空间: target

描述通信信道属性

描述

使用 target.CommunicationChannel 对象描述两个系统之间 I/O 连接的通信信道属性。您可以将该对象用作 target.Connection 对象的一部分。target.RS232Channeltarget.TCPChanneltarget.UDPChannel 是预定义通信信道的示例。

属性

全部展开

target.CommunicationChannel 对象的名称。

特性:

GetAccess
public
SetAccess
public

示例

全部折叠

以下代码来自Set Up PIL Connectivity by Using Target Framework (Embedded Coder),显示如何指定开发计算机和目标硬件之间的连接。在该示例中,目标应用程序作为单独进程在开发计算机上运行,并通过 localhost 使用 TCP 通信通道。

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';

注意

使用名称-值参量,您可以通过以下命令创建连接对象:

connection = target.create('TargetConnection', ...
                      'Name', 'Host Process Connection', ...
                      'Target', hostTarget, ...
                      'CommunicationType', 'TCPChannel', ...
                      'IPAddress', 'localhost', ... 
                      'Port', '0')

版本历史记录

在 R2020b 中推出