Main Content

target.TCPChannel クラス

名前空間: target

TCP 通信のプロパティを記述

R2020b 以降

説明

target.CommunicationChannel から機能を継承する target.TCPChannel を使用して、TCP 通信のプロパティについて記述します。

target.TCPChannel オブジェクトの作成には関数 target.create を使用します。

プロパティ

すべて展開する

TCP サーバーの IP アドレス。

属性:

GetAccess
public
SetAccess
public

TCP ポート。

属性:

GetAccess
public
SetAccess
public

すべて折りたたむ

Set Up PIL Connectivity by Using Target Frameworkから抜粋した以下のコードは、開発用コンピューターとターゲット ハードウェア間で接続を指定する方法を示しています。この例では、ターゲット アプリケーションが開発用コンピューター上で個別のプロセスとして実行され、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 オブジェクトを作成できます。

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

バージョン履歴

R2020b で導入