Receive TCP/IP messages on specified server from client
Configure TCP/IP stack to receive TCP/IP data from a client to the specified server port. The TCP/IP block in your model generates code that is configured for TCP/IP on the target hardware to receive messages.
Use this block when your model has the following requirements:
Reliable message transmission
Intact message order
Acceptable compromise on the transmission speed.
The Arduino Ethernet shield uses the following pins on different variants of Arduino boards. If you set the Target hardware parameter to:
Arduino Mega 2560, pin numbers from 50 to 53 are used.
Arduino Uno, pin numbers from 10 to 13 are used.
The TCP/IP Receive block has two block outputs, Data and Status.
When data is available:
The Data block output emits data received from the TCP/IP server port on the Arduino.
The Status block output emits 1.
When data is not available:
No data is available on the Data block output.
The Status block output emits 0.
The datatype of the Data block output is uint8.
The datatype of the Status block output is int.
You cannot use this block for Arduino Nano target hardware.
If you run a simulation of a model that contains this block without the target hardware, this block outputs zeroes. See Block Produces Zeros or Does Nothing in Simulation
Enter the port number through which you need the TCP/IP server to initiate the message reception. The server port numbers range from 0 to 65535.