Thanks for using libplctag and especially for including the log files. The first log file is not conclusive because whatever happened to the connection happened before the log started.
The second log file has some clear breadcrumbs in it to follow.
Here is the last write:
Info 2025-12-29 11:08:39.138 thread(3) tag(0) INFO send_eip_request:1876 Starting.
Info 2025-12-29 11:08:39.138 thread(3) tag(0) INFO send_eip_request:1889 Sending packet of size 66
Info
2025-12-29 11:08:39.138 thread(3) tag(0) INFO send_eip_request:1890 00000 70 00 2a 00 0a 00 12 00 00 00 00 00 00 00 00 00
Info
2025-12-29 11:08:39.139 thread(3) tag(0) INFO send_eip_request:1890 00016 00 00 00 00 00 00 00 00 00 00 00 00 01 00 02 00
Info
2025-12-29 11:08:39.139 thread(3) tag(0) INFO send_eip_request:1890 00032 a1 00 04 00 03 50 f3 ff b1 00 16 00 3b 22 4d 05
Info
2025-12-29 11:08:39.139 thread(3) tag(0) INFO send_eip_request:1890 00048 91 07 47 61 6d 65 70 61 64 00 c4 00 01 00 00 49
Info
2025-12-29 11:08:39.139 thread(3) tag(0) INFO send_eip_request:1890 00064 02 00
Detail
2025-12-29 11:08:39.139 thread(3) tag(0) DETAIL socket_write:1945 Starting.
Detail 2025-12-29 11:08:39.140 thread(3) tag(0) DETAIL socket_write:2072 Done: result = 66.
The write succeeds. Now that doesn't mean that the PLC got the data. It just means that the operating system told us that it accepted all the data.
But then there is no response for about 2 seconds and then the code gives up. I assume you were using a timeout of about 2000 milliseconds?
After that point no packets can be sent and the whole connection is torn down and restarted. We see an attempt at trying to tear down the connection gently with a Forward Close, but that does not get a response. Again the OS tells us that the data was accepted to be sent.
Here is the trace:
Warn 2025-12-29 11:08:41.201 thread(2) tag(0) WARN check_write_request_status:1211 Session reported failure of request: PLCTAG_ERR_TIMEOUT.
2025-12-29 11:08:41.201 thread(2) tag(0) DETAIL check_write_request_status:1229 Write not ready with status PLCTAG_ERR_TIMEOUT.
Here is where we try to send a Forward Close.
2025-12-29 11:08:41.206 thread(3) tag(0) INFO send_eip_request:1889 Sending packet of size 64
2025-12-29 11:08:41.207 thread(3) tag(0) INFO send_eip_request:1890 00000 6f 00 28 00 0a 00 12 00 00 00 00 00 a5 60 00 00
2025-12-29 11:08:41.209 thread(3) tag(0) INFO send_eip_request:1890 00016 00 00 00 00 00 00 00 00 00 00 00 00 01 00 02 00
2025-12-29 11:08:41.211 thread(2) tag(0) DETAIL tag_raise_event:243 PLCTAG_EVENT_WRITE_COMPLETED raised with status PLCTAG_ERR_TIMEOUT.
2025-12-29 11:08:41.211 thread(2) tag(0) DETAIL tag_raise_event:255 Disabled PLCTAG_EVENT_WRITE_COMPLETE.
2025-12-29 11:08:41.213 thread(2) tag(0) DETAIL plc_tag_tickler_wake_impl:220 Starting. Called from tag_tickler_func:582.
2025-12-29 11:08:41.216 thread(2) tag(0) DETAIL plc_tag_tickler_wake_impl:233 Done. Called from tag_tickler_func:582.
2025-12-29 11:08:41.218 thread(2) tag(11) DETAIL plc_tag_generic_handle_event_callbacks:442 Tag write completed with status PLCTAG_ERR_TIMEOUT.
2025-12-29 11:08:41.220 thread(3) tag(0) DETAIL socket_write:1945 Starting.
2025-12-29 11:08:41.220 thread(2) tag(12) DETAIL tag_tickler_func:550 Tickling tag 12.
2025-12-29 11:08:41.221 thread(3) tag(0) DETAIL socket_write:2072 Done: result = 64.
And above the OS said it was done. So the OS accepted the data to be sent.
2025-12-29 11:08:41.221 thread(2) tag(12) DETAIL plc_tag_generic_tickler:281 Tickling tag 12.
2025-12-29 11:08:41.228 thread(1) tag(11) INFO plc_tag_abort:1484 Starting.
2025-12-29 11:08:41.233 thread(3) tag(0) INFO send_forward_close_req:2462 Done
2025-12-29 11:08:41.233 thread(3) tag(0) INFO recv_forward_close_resp:2473 Starting
2025-12-29 11:08:41.236 thread(3) tag(0) INFO recv_eip_response:1952 Starting.
2025-12-29 11:08:41.264 thread(3) tag(0) DETAIL socket_read:1807 Starting.
2025-12-29 11:08:41.264 thread(2) tag(11) DETAIL tag_tickler_func:550 Tickling tag 11.
2025-12-29 11:08:41.264 thread(3) tag(0) DETAIL socket_read:1836 Immediate read attempt did not succeed, now wait for select().
2025-12-29 11:08:41.264 thread(2) tag(11) DETAIL tag_tickler_func:603 Skipping tag as it is already locked.
And that is the end of the abort sequence.
Then we timeout internally trying to get the response from the Forward Close and close the socket.
2025-12-29 11:08:41.429 thread(3) tag(0) DETAIL session_handler:1226 in SESSION_UNREGISTER state.
2025-12-29 11:08:41.429 thread(3) tag(0) INFO session_unregister:783 Starting.
2025-12-29 11:08:41.429 thread(3) tag(0) INFO session_unregister:787 Done.
2025-12-29 11:08:41.429 thread(3) tag(0) DETAIL session_handler:1237 in SESSION_CLOSE_SOCKET state.
2025-12-29 11:08:41.430 thread(3) tag(0) INFO session_close_socket:796 Starting.
2025-12-29 11:08:41.430 thread(3) tag(0) INFO socket_close:2083 Starting.
2025-12-29 11:08:41.430 thread(3) tag(0) INFO socket_close:2119 Done.
2025-12-29 11:08:41.430 thread(3) tag(0) INFO socket_destroy:2128 Starting.
2025-12-29 11:08:41.430 thread(3) tag(0) INFO socket_close:2083 Starting.
2025-12-29 11:08:41.431 thread(3) tag(0) INFO socket_close:2119 Done.
2025-12-29 11:08:41.431 thread(3) tag(0) INFO socket_destroy:2145 Done.
2025-12-29 11:08:41.431 thread(3) tag(0) INFO session_close_socket:804 Done.
2025-12-29 11:08:41.431 thread(3) tag(0) DETAIL session_handler:1252 in SESSION_START_RETRY state.
2025-12-29 11:08:41.431 thread(3) tag(0) DETAIL session_handler:1264 in SESSION_WAIT_RETRY state.
This leaves the library waiting for a bit before trying to reconnect.
After the wait of 5 seconds, we try again:
2025-12-29 11:08:46.498 thread(3) tag(0) DETAIL session_handler:1264 in SESSION_WAIT_RETRY state.
2025-12-29 11:08:46.498 thread(3) tag(0) DETAIL session_handler:1267 Transitioning to SESSION_OPEN_SOCKET_START.
2025-12-29 11:08:46.499 thread(3) tag(0) DETAIL session_handler:1058 in SESSION_OPEN_SOCKET_START state.
2025-12-29 11:08:46.499 thread(3) tag(0) INFO session_open_socket:644 Starting.
2025-12-29 11:08:46.499 thread(3) tag(0) DETAIL socket_create:1311 Starting.
Detail 2025-12-29 11:08:46.501 thread(3) tag(0) DETAIL socket_create:1334 Done.
2025-12-29 11:08:46.501 thread(3) tag(0) DETAIL session_open_socket:678 Using default port 44818.
2025-12-29 11:08:46.501 thread(3) tag(0) DETAIL socket_connect_tcp_start:1355 Starting.
2025-12-29 11:08:46.502 thread(3) tag(0) DETAIL socket_connect_tcp_start:1404 Found numeric IP address: 192.168.1.56
2025-12-29 11:08:46.502 thread(3) tag(0) DETAIL socket_connect_tcp_start:1444 Setting up wake pipe.
2025-12-29 11:08:46.502 thread(3) tag(0) INFO sock_create_event_wakeup_channel:2161 Starting.
2025-12-29 11:08:46.503 thread(3) tag(0) INFO sock_create_event_wakeup_channel:2308 Done.
2025-12-29 11:08:46.503 thread(3) tag(0) DETAIL socket_connect_tcp_start:1475 Socket connection attempt 0 started successfully.
2025-12-29 11:08:46.503 thread(3) tag(0) DETAIL socket_connect_tcp_start:1501 Done.
2025-12-29 11:08:46.504 thread(3) tag(0) INFO session_open_socket:693 Done.
2025-12-29 11:08:46.504 thread(3) tag(0) DETAIL session_handler:1074 Connect started, going to state SESSION_OPEN_SOCKET_WAIT.
2025-12-29 11:08:46.504 thread(3) tag(0) DETAIL session_handler:1086 in SESSION_OPEN_SOCKET_WAIT state.
2025-12-29 11:08:46.504 thread(3) tag(0) DETAIL socket_connect_tcp_check:1518 Starting.
2025-12-29 11:08:46.505 thread(3) tag(0) DETAIL socket_connect_tcp_check:1538 Socket is connected.
2025-12-29 11:08:46.505 thread(3) tag(0) DETAIL socket_connect_tcp_check:1598 Done.
2025-12-29 11:08:46.506 thread(3) tag(0) INFO session_handler:1092 Socket connection succeeded.
And the TCP connection attempt is successful.
After that we register an EtherNet/IP session:
2025-12-29 11:08:46.506 thread(3) tag(0) DETAIL session_handler:1113 in SESSION_REGISTER state.
2025-12-29 11:08:46.506 thread(3) tag(0) INFO session_register:706 Starting.
2025-12-29 11:08:46.506 thread(3) tag(0) INFO send_eip_request:1876 Starting.
2025-12-29 11:08:46.506 thread(3) tag(0) INFO send_eip_request:1889 Sending packet of size 28
2025-12-29 11:08:46.506 thread(3) tag(0) INFO send_eip_request:1890 00000 65 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00
2025-12-29 11:08:46.506 thread(3) tag(0) INFO send_eip_request:1890 00016 00 00 00 00 00 00 00 00 01 00 00 00
2025-12-29 11:08:46.507 thread(3) tag(0) DETAIL socket_write:1945 Starting.
2025-12-29 11:08:46.507 thread(3) tag(0) DETAIL socket_write:2072 Done: result = 28.
2025-12-29 11:08:46.507 thread(3) tag(0) INFO send_eip_request:1932 Done.
2025-12-29 11:08:46.507 thread(3) tag(0) INFO recv_eip_response:1952 Starting.
2025-12-29 11:08:46.507 thread(3) tag(0) DETAIL socket_read:1807 Starting.
2025-12-29 11:08:46.507 thread(3) tag(0) DETAIL socket_read:1836 Immediate read attempt did not succeed, now wait for select().
2025-12-29 11:08:46.508 thread(3) tag(0) DETAIL socket_read:1864 Socket can read data.
2025-12-29 11:08:46.509 thread(3) tag(0) DETAIL socket_read:1934 Done: result = 24.
2025-12-29 11:08:46.509 thread(3) tag(0) DETAIL socket_read:1807 Starting.
2025-12-29 11:08:46.509 thread(3) tag(0) DETAIL socket_read:1934 Done: result = 4.
2025-12-29 11:08:46.509 thread(3) tag(0) INFO recv_eip_response:2023 request received all needed data (28 bytes of 28).
2025-12-29 11:08:46.509 thread(3) tag(0) INFO recv_eip_response:2025 00000 65 00 04 00 0a 00 13 00 00 00 00 00 00 00 00 00
2025-12-29 11:08:46.509 thread(3) tag(0) INFO recv_eip_response:2025 00016 00 00 00 00 00 00 00 00 01 00 00 00
2025-12-29 11:08:46.510 thread(3) tag(0) INFO recv_eip_response:2032 Done.
2025-12-29 11:08:46.510 thread(3) tag(0) INFO session_register:773 Done.
Pretty fast response time. About 1 millisecond. So there is a PLC there and it is responding at least at the EIP level.
Then things go off the rails. We try to send a Forward Open:
2025-12-29 11:08:46.510 thread(3) tag(0) INFO send_extended_forward_open_request:2259 Starting
2025-12-29 11:08:46.511 thread(3) tag(0) INFO send_eip_request:1876 Starting.
2025-12-29 11:08:46.511 thread(3) tag(0) INFO send_eip_request:1889 Sending packet of size 92
2025-12-29 11:08:46.511 thread(3) tag(0) INFO send_eip_request:1890 00000 6f 00 44 00 0a 00 13 00 00 00 00 00 a6 60 00 00
2025-12-29 11:08:46.511 thread(3) tag(0) INFO send_eip_request:1890 00016 00 00 00 00 00 00 00 00 00 00 00 00 01 00 02 00
2025-12-29 11:08:46.511 thread(3) tag(0) INFO send_eip_request:1890 00032 00 00 00 00 b2 00 34 00 5b 02 20 06 24 01 0a 05
2025-12-29 11:08:46.511 thread(3) tag(0) INFO send_eip_request:1890 00048 00 00 00 00 0a 2e 00 00 3e 5c 3d f3 45 43 50 21
2025-12-29 11:08:46.512 thread(3) tag(0) INFO send_eip_request:1890 00064 01 00 00 00 40 42 0f 00 a2 0f 00 42 40 42 0f 00
2025-12-29 11:08:46.512 thread(3) tag(0) INFO send_eip_request:1890 00080 a2 0f 00 42 a3 03 01 00 20 02 24 01
2025-12-29 11:08:46.512 thread(3) tag(0) DETAIL socket_write:1945 Starting.
2025-12-29 11:08:46.512 thread(3) tag(0) DETAIL socket_write:2072 Done: result = 92.
2025-12-29 11:08:46.512 thread(3) tag(0) INFO send_eip_request:1932 Done.
2025-12-29 11:08:46.512 thread(3) tag(0) INFO send_extended_forward_open_request:2318 Done
It all looks good. We built the Forward Open request and sent it.
But then... nothing comes back for a looooooong time:
2025-12-29 11:08:47.499 thread(3) tag(0) INFO recv_eip_response:2023 request received all needed data (70 bytes of 70).
2025-12-29 11:08:47.499 thread(3) tag(0) INFO recv_eip_response:2025 00000 6f 00 2e 00 0a 00 13 00 00 00 00 00 a6 60 00 00
2025-12-29 11:08:47.499 thread(3) tag(0) INFO recv_eip_response:2025 00016 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 00
2025-12-29 11:08:47.499 thread(3) tag(0) INFO recv_eip_response:2025 00032 00 00 00 00 b2 00 1e 00 db 00 00 00 fd 4e f3 ff
2025-12-29 11:08:47.499 thread(3) tag(0) INFO recv_eip_response:2025 00048 0a 2e 00 00 3e 5c 3d f3 45 43 50 21 40 42 0f 00
2025-12-29 11:08:47.499 thread(3) tag(0) INFO recv_eip_response:2025 00064 40 42 0f 00 00 00
2025-12-29 11:08:47.500 thread(3) tag(0) INFO recv_eip_response:2032 Done.
2025-12-29 11:08:47.500 thread(3) tag(0) INFO receive_forward_open_response:2393 ForwardOpen succeeded with our connection ID 2e0a and the PLC connection ID fff34efd with packet size 4002.
So when we registered the EIP session layer, we got a response in 1ms. When we did a Forward Open, it took almost exactly one second to respond. That is really slow. Even my PLC/5 responds 4 times faster than that, usually 5 or 6x. Based on the logs, I can see that the libplctag library is trying again and again to get data but nothing is coming in. So that one second delay is either in the OS of the PC or in the PLC. Given that the OS seems responsive, my guess is that it is either the network or the PLC.
To me this says that something is not right with the PLC. Is it heavily loaded? What kind of PLC is it?
After this weird delay, we see a tag read go through ("Gamepad"?):
2025-12-29 11:08:47.503 thread(3) tag(0) INFO send_eip_request:1889 Sending packet of size 64
2025-12-29 11:08:47.503 thread(3) tag(0) INFO send_eip_request:1890 00000 70 00 28 00 0a 00 13 00 00 00 00 00 00 00 00 00
2025-12-29 11:08:47.503 thread(3) tag(0) INFO send_eip_request:1890 00016 00 00 00 00 00 00 00 00 00 00 00 00 01 00 02 00
2025-12-29 11:08:47.503 thread(3) tag(0) INFO send_eip_request:1890 00032 a1 00 04 00 fd 4e f3 ff b1 00 14 00 3c 22 52 05
2025-12-29 11:08:47.504 thread(3) tag(0) INFO send_eip_request:1890 00048 91 07 47 61 6d 65 70 61 64 00 01 00 00 00 00 00
2025-12-29 11:08:47.504 thread(3) tag(0) DETAIL socket_write:1945 Starting.
2025-12-29 11:08:47.504 thread(3) tag(0) DETAIL socket_write:2072 Done: result = 64.
2025-12-29 11:08:47.504 thread(3) tag(0) INFO send_eip_request:1932 Done
2025-12-29 11:08:47.504 thread(3) tag(0) INFO recv_eip_response:1952 Starting.
2025-12-29 11:08:47.504 thread(3) tag(0) DETAIL socket_read:1807 Starting.
2025-12-29 11:08:47.504 thread(3) tag(0) DETAIL socket_read:1836 Immediate read attempt did not succeed, now wait for select().
2025-12-29 11:08:47.508 thread(3) tag(0) DETAIL socket_read:1864 Socket can read data.
2025-12-29 11:08:47.508 thread(3) tag(0) DETAIL socket_read:1934 Done: result = 24.
2025-12-29 11:08:47.508 thread(3) tag(0) DETAIL socket_read:1807 Starting.
2025-12-29 11:08:47.508 thread(3) tag(0) DETAIL socket_read:1934 Done: result = 32.
2025-12-29 11:08:47.508 thread(3) tag(0) INFO recv_eip_response:2023 request received all needed data (56 bytes of 56).
2025-12-29 11:08:47.508 thread(3) tag(0) INFO recv_eip_response:2025 00000 70 00 20 00 0a 00 13 00 00 00 00 00 00 00 00 00
2025-12-29 11:08:47.509 thread(3) tag(0) INFO recv_eip_response:2025 00016 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 00
2025-12-29 11:08:47.509 thread(3) tag(0) INFO recv_eip_response:2025 00032 a1 00 04 00 0a 2e 00 00 b1 00 0c 00 3c 22 d2 00
2025-12-29 11:08:47.509 thread(3) tag(0) INFO recv_eip_response:2025 00048 00 00 c4 00 00 49 02 00
2025-12-29 11:08:47.509 thread(3) tag(0) INFO recv_eip_response:2032 Done.
So the response to a tag read of a DINT took 5ms but the response to a Forward Open took ~1000ms???
I would argue that something is not OK with either your network or your PLC. It is possible it is the PC, but the OS responds so quickly to writing data that I suspect it is OK. Plus the PC itself usually has a couple of orders of magnitude more CPU horsepower than the PLC and especially and network module (for ControlLogix).
I would suggest opening a browser to your network module: "http://192.168.1.56:80". See what the stats say about the network module's CPU load, number of connections, packets per second etc.
Now, why are we always waiting five seconds... that is confusing, but I cannot see the start of the whole process.
What version of the library are you using?
Best,
Kyle