Hi, I try to send and receive data using a UDP connection via SysSocket 3.5.17.0. While sending data works fine, I have problems with the receiving part. I am able to capture the received data of client side in wireshark But unable to capture it on the codesys
Hi, I try to send and receive data using a UDP connection via SysSocket 3.5.17.0. While sending data works fine, I have problems with the receiving part.I am able to capture the data of client side in wireshark but i am unable to capture it in the codesys. Heres the below part of code of client side.
PROGRAM POU_udpclient_program
VAR
istep : INT := 1;//step variable for state machine
xStart: BOOL;// Flag to start the UDP protocol
CASE istep OF
1:
//create socket
IF xStart THEN
iecSocketId:= syssocket.SysSockCreate(syssocket.SOCKET_AF_INET,syssocket.SOCKET_DGRAM,syssocket.SOCKET_IPPROTO_IP,ADR(iecCreateResult));
IF iecSocketId = syssocket_interfaces.RTS_INVALID_HANDLE THEN
xStart := FALSE;
istep := 1;
ELSE
istep := 2;
Hi, I try to send and receive data using a UDP connection via SysSocket 3.5.17.0. While sending data works fine, I have problems with the receiving part.I am able to capture the data of client side in wireshark but i am unable to capture it in the codesys. Heres the below part of code of client side.
PROGRAM POU_udpclient_program
VAR
istep : INT := 1;//step variable for state machine
xStart: BOOL;// Flag to start the UDP protocol
END_VAR
syssocket.SysSockInetAddr(sIpAddress,ADR(ipAddr.sin_addr));
ipAddr.sin_family := syssocket.SOCKET_AF_INET;
ipAddr.sin_port := syssocket.SysSockHtons(wPort);
CASE istep OF
1:
//create socket
IF xStart THEN
iecSocketId:= syssocket.SysSockCreate(syssocket.SOCKET_AF_INET,syssocket.SOCKET_DGRAM,syssocket.SOCKET_IPPROTO_IP,ADR(iecCreateResult));
IF iecSocketId = syssocket_interfaces.RTS_INVALID_HANDLE THEN
xStart := FALSE;
istep := 1;
ELSE
istep := 2;
END_CASE
Last edit: anonymous 2024-06-03