target.CommunicationInterface - Describe data I/O details for target hardware - MATLAB (original) (raw)
Main Content
Namespace: target
Describe data I/O details for target hardware
Since R2020b
Description
Use the target.CommunicationInterface
class to describe data transfer for your target hardware. Associate the communication channel for data transfer and the device driver API implementation with a target.CommunicationInterface
object.
Properties
Name of target.CommunicationInterface
object.
Attributes:
GetAccess | public |
---|---|
SetAccess | public |
Type of communication channel that connects to the target hardware. For example, if you define PIL connectivity by using a target.TargetConnection
over atarget.RS232Channel
, set this property to'RS232Channel'
.
Attributes:
GetAccess | public |
---|---|
SetAccess | public |
Details of the API implementations that use the communication interface channel to support data transfer to and from the target hardware. For example, anrtiostream
API implementation for PIL connectivity.
Attributes:
GetAccess | public |
---|---|
SetAccess | public |
Examples
Create the communication interface for the target hardware. This code snippet from Set Up PIL Connectivity by Using Target Framework shows how to create the interface.
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;
Version History
Introduced in R2020b