Home AMX User Forum AMX General Discussion

IP - Offline/Error not working!

I've creating a module for a device connecting over IP and thought I was finished until I tested the DATA_EVENT offline/error return and found that even if I unplug the device from the network and send a string to the open port, Netlinx does NOT get/send an OFFLINE/ERROR message.

Has anyone else experienced this using Netlinx v.3.12.332 ?

I have the port open as TCP so it should be a guaranteed delivery (response after ever send string). From what I remember it shouldn't take longer then a couple minutes to get an error response back. I even tried setting Netlinx "SET ICSP TCP TIMEOUT" to 15 seconds, but still no response.

Any ideas are appreciated!


  • I wrote a small test program and I can reproduce this (NI-900, v3.12.335).

    It seems that the TCP/IP stack would need much longer to detect the network disconnect if strings are sent to it permanently (my testfile sends a "'ECHO ON',13,10" to another master every second, tooks 7 minutes to get the offline with ONERROR code 17). If working with a manually written response timeout would speed up "offline" detection (send a string -> if no response for 30 seconds -> IP_CLIENT_CLOSE() ).
  • DHawthorneDHawthorne Posts: 4,584
    IMO, this has been a longstanding issue with all NetLinx class devices and IP connections. Even Studio and TPD4 have the problem; most likely, there is a flaw in a common library function. But IP disconnects are not detected in a 100% reliable way, and disconnects are not always gracefully recovered from. I have been saying this for so long, it feels like a mantra. There is a problem in the IP connection handling with NetLinx. It has been there a long time.

    I had a system that drove me insane for months, and I spent countless hours working on finding the problem and developing tools to find the problem. The symptoms were the system becoming increasingly sluggish, then unresponsive. When re-booted, it would be fine again for weeks. It turned out to be an IP device that the master did not reliably detect disconnects with. When I converted that device to RS-232, with no other code change, the system became stable.
  • GSLogicGSLogic Posts: 562
    Looks like I'll have to send a beacon to monitor the IP.

  • Hi,

    I tried the technote below.


    I wrote a simple program to connect to hyperterminal of my PC. The flag bClientOnline did change from true to false immediately when my hyperterminal goes offline.

    Connection timeout after my hyperterminal offline for some time.

    Charles Law
  • DHawthorneDHawthorne Posts: 4,584
    It's not reliable though Charles, and seems to vary with the device.
  • GSLogicGSLogic Posts: 562
    I have three devices that Netlinx will not report when they go offline.
Sign In or Register to comment.