Timeouts and Errors

One potential source of errors when using the ETH32 device is from network problems. When the ETH32 is used on a Local Area Network (LAN), these kinds of problems should typically be quite small, but if the ETH32 is used over the internet, the probability of dropped packets or broken connections will increase. The ETH32 uses the TCP/IP protocol for all communications. TCP/IP is a robust, time-tested standard that includes data buffering and the provision for retrying data transmission, allowing connections to recover from lost or corrupted packets.

One problem that may occur due to network problems is a delay in receiving a response back from the ETH32. To deal with that the API includes a timeout setting. The timeout setting applies to any function that queries the ETH32 for data and waits for the response. For example, it would apply to reading the state of an LED, but it would not apply to setting the state of an LED. The timeout setting specifies a maximum amount of time the API should wait for a response. If the timeout period is ever exceeded, an error is generated or returned by the API. When a timeout occurs, it does not necessarily mean that the connection has been completely broken. The TCP/IP retransmissions may still recover from the error.

If communication is completely cut off, further requests will continue to time out until the TCP/IP stack of your operating system decides to give up and close the connection. After that happens, any further API calls that communicate with the ETH32 in any way will immediately fail with a network error.

Besides timeouts and broken connections, other errors include things such as specifying a value for a setting that is outside of the allowable limits, internal API errors, and others.

The way your application is notified of errors depends on the programming language you are using. Please see the Error Handling section for your programming language below. When errors are provided, an error code is included to identify the cause of the error. The error codes and their meanings are included in this document. The API also provides a function which will translate an error code into a string that briefly describes the error.

Applicable Functions and Information

TaskC / C++.NET LanguagesVisual Basic 6
Configure API Timeout Timeout PropertyTimeout Property
Translate error codeseth32_error_stringErrorString MethodErrorString Method
Error handlingError HandlingError HandlingError Handling