Main Content

target.CommunicationInterface クラス

名前空間: target

ターゲット ハードウェアのデータ I/O の詳細を記述

R2020b 以降

説明

target.CommunicationInterface クラスを使用して、ターゲット ハードウェアのデータ転送について記述します。データ転送用の通信チャネルおよびデバイス ドライバーの API 実装を target.CommunicationInterface オブジェクトと関連付けます。

プロパティ

すべて展開する

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

属性:

GetAccess
public
SetAccess
public

ターゲット ハードウェアに接続する通信チャネルのタイプ。たとえば、target.RS232Channel を介した target.TargetConnection を使用して PIL 接続を定義する場合、このプロパティを 'RS232Channel' に設定します。

属性:

GetAccess
public
SetAccess
public

通信インターフェイス チャネルを使用してターゲット ハードウェアとのデータ転送をサポートする API 実装の詳細。たとえば、PIL 接続性のための rtiostream API 実装。

属性:

GetAccess
public
SetAccess
public

すべて折りたたむ

ターゲット ハードウェアの通信インターフェイスを作成します。Set Up PIL Connectivity by Using Target Framework (Embedded Coder)から抜粋した以下のコードは、インターフェイスの作成方法を示しています。

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;

バージョン履歴

R2020b で導入