The program SR_UdpPeer implements the program code for the UDP peer functionality. For control and monitoring of this functionality, the visualization screen VisuUdpPeer is provided in the example project.
The variables which link the visualization with the program code are defined in the global variable list GVL_VisuUdpPeer.
In the visualization, enter the number of the port you want to open and the IP address of the corresponding Ethernet interface. To open this UDP port, click the Open & Bind button in the visualization.
You can close an open port by clicking the Close button.
When the UDP port is open and bound, a data packet can be sent to a remote UDP peer. The remote UDP peer is selected by its IP address and the UDP port. You can modify the text message in the visualization. To send data to the remote UDP peer, click the Send button in the visualization.
If the UDP peer detects that data has been received on the bound port, the data is read from the receive buffer. The received data is converted into the user-defined data format. In this example application, the data is not processed, but displayed on the visualization for information purposes.