S01: Simple TCP Client (C++)
This example implements a TCP client that issues a simple HTTP request and receives the response.
The download available here is preconfigured to call a test website 62.159.14.51:80.
Download
Download the sample: https://github.com/Beckhoff/TF6311_Samples/tree/main/S01-IpStackTcpClient
- 1. Get the sample from GitHub, unzip the downloaded ZIP file if necessary
- 2. Open the project with TwinCAT XAE
- 3. Select your target system
- 4. Configure the network card (see below) for the target system
- 5. Build the sample on your local machine (e.g. Build->Build Solution)
- 6. Activate the configuration
Preparing the network card
For the TCP/UDP RT module, make sure that the RT Ethernet adapter in the TwinCAT solution is connected with the correct network card (with TwinCAT driver).
![]() | Local configuration only Installation of the driver on compatible network cards via the button "Compatible Devices" always takes place locally. On a controller with TwinCAT XAR, the program TcRteInstall.exe can be used. It is included in the installation (usually under C:TwinCAT\3.1\System). |
