The TCP/IP Send block sends data from your model to remote machines using the TCP/IP protocol. This data is sent at the end of the simulation or at fixed intervals during a simulation.
Note: You need a license for both the Instrument Control Toolbox™ and Simulink® software to use this block.
The TCP/IP Send block has one input port. The size of the input port is dynamic, and is inherited from the driving block. This block has no output ports.
Use the Sink Block Parameters dialog box to select your communication parameters.
Specify the IP address, name, or the Web server address of the machine to which you need to send data. This field is empty by default.
Specify the remote port on the host you need to send the data to. The default port value is 80. Valid port values are 1 to 65535.
Click this button to:
Check if the specified remote address is correct.
Establish connection with the specified remote address and port.
When using binary or binblock format with more than 8 bits, you can specify the instrument's byte order for the data. Your options are Big Endian or Little Endian.
Specify if you want to block the simulation while sending data. This option is selected by default. Clear this check box if you do not want the write operation to block the simulation.
The following diagrams show the difference between sending data using blocking mode and nonblocking mode.
In this example, you start the simulation at time (t=0). At time step (T1), data output is initiated and simulation stops until the block of data (B1) is sent to the specified remote address and port. After the data is sent, simulation resumes until time step (T2), where the block initiates another data output and simulation is blocked until the block of data (B2) is sent to the remote address and port, and the simulation resumes.
Nonblocking Mode – Scenario 1
In this scenario, the data output outpaces the simulation speed. Data output is initiated at the first time step (T1) and the corresponding block of data (B1) is sent to the specified remote address asynchronously. The simulation runs continuously in this mode.
Nonblocking Mode – Scenario 2
In this scenario, the simulation speed outpaces the data acquisition.
At time step T1: The block of data (B1) is sent to the specified remote address and port asynchronously.
At time step T2: The simulation is blocked until the block of data (B1) is sent completely. When B1 is completely sent, the new block of data (B2) is sent asynchronously, and the simulation resumes.
Specify the amount of time that the model will wait when data is sent during each simulation time step. The default value is 10 (seconds). This field is unavailable if you have not enabled blocking mode.