.NET communication
This sample demonstrates how a suitable .NET communication partner for the PLC peer-to-peer device A can be realized. Only use this sample in conjunction with the PLC project PeerToPeerA.

The .NET Sample Client can be used to send single UPD data packages to a UPD Server, in this case the PLC project PeerToPeerA.
How it works
The sample uses the .Net libraries System.Net and System.Net.Sockets to implement a UDP client (class UdpClient). While listening for incoming UDP packets in a background thread, a string can be sent to a remote device by specifying its IP address and port number and clicking the Send button.
For a better understanding of this article, imagine the following setup:
- The PLC project Peer-to-Peer device A is running on a computer with IP address 10.1.128.21
- The .NET application is running on a computer with IP address 10.1.128.30
Description
The client itself uses port 11000 for sending. At the same time it opens this port and displays received messages in the upper part of the interface as a log:

Together with the PLC / C++ samples, this results in an echo sample:
A UDP message is sent from the client port 11000 to the server port 10000, which sends the same data back to the sender.
The client can be configured via the interface:
- Destination: Destination IP address
- Port: The port that is addressed in the target
- Source: Sender network card (IP address).
"OS-based" operating system deals with selection of the appropriate network card. - Message
The TF6311 "TCP/UDP Realtime" does not allow local communication. However, for testing purposes a different network interface can be selected via "Source", so that the UDP packet leaves the computer through one network card and arrives on the other network card ("loop cable").