Main Content

target.CommunicationChannel クラス

名前空間: target

通信チャネルのプロパティを記述

R2020b 以降

説明

target.CommunicationChannel オブジェクトを使用して、2 つのシステム間の I/O 接続に関する通信チャネル プロパティについて記述します。オブジェクトを target.Connection オブジェクトの一部として使用できます。target.RS232Channeltarget.TCPChannel、および target.UDPChannel は、事前定義された通信チャネルの例です。

プロパティ

すべて展開する

target.CommunicationChannel オブジェクトの名前。

属性:

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 で導入