Record, output, or terminate input message
SoC Blockset / I/O Data Source and Sink
The IO Data Sink block records, outputs, or terminates the received input message signal. The input of this block connects to the output of the TCP Write, UDP Write, or Register Write block. This block enables you to save the received input data to a file that you can play back using the IO Data Source block in the model. You can also terminate the signal or output the signals through an output port which can be fed as an input to IO Data Source block.
msg
— SoC message dataThis port receives the data vector from the msg port of the processor io blocks, which includes Stream WriteTCP Write, UDP Write, or Register Write blocks.
Data Types: SoCData
data
— Output dataOutput data, returned as a numeric vector. The block converts the received input message into a data signal.
To enable this port, set the Output parameter to
To output port
.
Data Types: uint32
| double
| single
| int8
| uint8
| int16
| uint16
| int32
| int64
| uint64
| Boolean
| fixedpoint
length
— Length of output dataLength of output data, returned as a nonnegative scalar.
To enable this port, set the Output parameter to
To output port
.
Data Types: double
valid
— Indication of valid dataControl signal that indicates whether the output data is valid. When this value is
1
(true), the value on the output data port
is valid.
To enable this port, set the Output parameter to
To output port
.
Data Types: Boolean
done
— Completion of data streamingWhen done is 1
, the block has no more
stream output data to return in the data port. When
done is 0
, the block has more stream data to
return in the data port.
To enable this port, set the Device type parameter to
Stream
.
Data Types: Boolean
event
— Task event signalThis port sends a task event signal that triggers the Task Manager block to execute the associated event-driven task.
To enable this port, set the Show port parameter to
Data and Event
.
Data Types: rteEvent
Output
— Sink of output data from blockTo file
(default) | To output port
| To terminator
Set the sink of output data from the block by selecting one of these values.
To file
— Save output data to a file.
To output port
— Output data and signals by using
output ports on the block.
To terminator
— Terminate the received input
signal.
Device type
— Device type selectionUDP
(default) | TCP
| Register
| Stream
Select a device type to enable the corresponding input data port.
UDP
— Enable the msg input
port to receive UDP data as message from a msg port of UDP Write
block.
TCP
— Enable the msg input
port to receive TCP data as message from a msg port of TCP Write
block.
Register
— Enable the msg
input port to receive Register data as message from a msg
port of Register
Write block.
Stream
— Enable the msg input
port to receive Stream data as message from a msg port of
Stream
Write block.
Show port
— Enable output portsData
(default) | Data and Event
Select one of these values to enable the corresponding output ports towards the writing source.
Data
— Enable only the msg input
port.
Data and event
— Enable the msg
input and event output ports.
Number of buffers
— Number of data buffers8
(default) | nonnegative scalarSpecify the number of data elements to store in the data queue. This parameter must match the Number of buffers parameter specified in the Memory Channel block.
To enable this parameter, set the Device type parameter to
Stream
.
Sample time
— Time interval of sampling-1
(default) | nonnegative numeric scalarSpecify a discrete time interval, in seconds, at which the block outputs data. The
default value -1
inherits the sample time from the solver used for
simulating the model.
Dataset name
— Name of data fileSpecify the full path to where you want to save the file on the host PC. This block saves the output data as a TGZ file. You can import this file into the model by using the IO Data Source block.
To enable this parameter, set the Output parameter to
To file
.
Source name
— Name of datasetSpecify a name for the output data source in which to save the data in the dataset file.
To enable this parameter, set the Output parameter to
To file
.
Data type
— Data type of output datauint32
(default) | double
| single
| int8
| uint8
| int16
| uint16
| int32
| int64
| uint64
| boolean
| fixedpoint
Select the data type of the output data. This value must match the data type of the input data.
To enable this parameter, set the Output parameter to
To file
or To output
port
.
To automatically generate C code for your design, and execute on an SoC device, use the SoC Builder tool. See Generate SoC Design. You must have an Embedded Coder® license to generate and execute C code for your SoC device.
Embedded Coder does not generate code for this block. In the generated code, the device I/O connects directly to the TCP Write, UDP Write, or Register Write block.
IO Data Source | Register Write | Stream Write | Task Manager | TCP Write | UDP Write