I just realised that bytes_received := SysSockGetRecvSizeUdp(socket_handle, 0, ADR(sys_result)); also works once for each port I specify, i.e. when I define a port, download the application and start it, receiving works. After a restart, bytes_received will remain 0. To make it work again, I need to specify another port or restart the PC. Edit: It looks like Control Win does not close open ports during a cold restart or application download. Is this intended or a bug? For now, I added a PrepareStop...
I just realised that bytes_received := SysSockGetRecvSizeUdp(socket_handle, 0, ADR(sys_result)); also works once for each port I specify, i.e. when I define a port, download the application and start it, receiving works. After a restart, bytes_received will remain 0. To make it work again, I need to specify another port or restart the PC.
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. Basically, the code looks like this: PROGRAM UdpTest VAR test_string : STRING(25) := 'Test string'; socket_handle : RTS_IEC_HANDLE; socket_address : SOCKADDRESS; sys_result : RTS_IEC_RESULT; enable_option : DINT := 1; bytes_sent : __XINT; bytes_received : __XINT; bytes_available : DINT; receive_buffer : ARRAY [0..63] OF BYTE; udp_reply : UDP_REPLY2;...