Solution
The cause of Network Stream timeouts are different for the Reader functions and the Writer functions:
Timeout at Reader functions
These timeouts occur because the Reader function is not acquiring data within the specified timeout. To troubleshoot this, we can do the following: Change the timeout value to -1 (infinite timeout) to see if data is being read at all:
- If the program hangs at the Reader function, this means that:
- Data has not been written to the Network Stream. Ensure that your Writer side has established a connection and is writing data to the Network Stream.
- The connection has been lost from the Reader side of the Network Stream. Check that the connection has not been lost. We can first do so by pinging the target from the host. Programmatically, we can do this by using Watchdog VIs to check for connection failure.
- If the program does not hang at the Reader function, then likely your timeout value is too low. Increase the timeout value to remove the timeouts.
Timeout at Writer functions
Timeouts at Writer functions occur for the following reasons:
- The connection between the host and the target has been lost. This can again be checked by pinging the device or with Watchdog VIs.
- There is not yet data to be written to the writer function. Use probes or Execution Highlighting to see if data is available to be written to the Network Stream.
- The timeout is too low. Try increasing the timeout to give the Writer function more time to write to the Network Stream.