jeffg - 2024-09-19
  • I just installed codesys runtime on a raspberry pi Cortex-A72 (ARM v8) 64-bit SoC @ 1.5GHz (Compute Module 4) I am running on Codesys control for raspberry pi 64 SL ver 4.13.0 and I keep getting a crash after about five to ten minutes.
    This program was running fine on a 32bit system with runtime 4.8 previously but they upgraded the panel PC cause it got smashed.

Looking at the logs I see this error "ERROR: GetNetLinkSockAndInfoByMac(): could not open netlink socket: Too many open files" at the time of crash.

I do have a UDP socket open for a serial to ethernet adapter and im wondering if maybe its opening a bunch of sockets and while receiving messages, Im not sending anything to the device only receiving.

Below is the code used for the UDP

VAR
// Scale Comm
fbPeerServer : NBS.UDP_Peer;
ipAddress : NBS.IPv4Address;
fbReceive : NBS.UDP_Receive;
xPeerActiv : BOOL := TRUE;
abyReceive : ARRAY [0..255] OF BYTE;
sLastValidReceive : STRING(255);
udiIndex : UDINT;
END_VAR

IF xPeerActiv AND NOT fbPeerServer.xBusy THEN
ipAddress.SetInitialValue(ipAddress := gvlSettings.sIPAddres);
fbPeerServer(xEnable := TRUE,
itfIPAddress := ipAddress,
uiPort := gvlSettings.uiPort);
END_IF

fbPeerServer();

fbReceive(xEnable := fbPeerServer.xBusy, itfPeer := fbPeerServer, pData := ADR(abyReceive), udiSize := SIZEOF(abyReceive));

IF fbReceive.udiCount > 0 THEN
IF fbReceive.udiCount < SIZEOF(sLastValidReceive) THEN
SysMem.SysMemCpy(pDest := ADR(sLastValidReceive), pSrc := ADR(abyReceive), udiCount := fbReceive.udiCount);
// Set End of String
sLastValidReceive[fbReceive.udiCount] := 0;
END_IF
END_IF

If anyone as seen this I could really use some help figuring it out.
I included the Log report