# Reporting RS-232 Errors

The functions in the RS-232 Library return negative values when an error occurs. In addition, the global variable rs232err is updated after each call to a RS-232 Library function. If the function executes properly, it sets rs232err to zero. Otherwise, the function sets rs232err to the same error code that it returns.

When an asynchronous write operation fails, the function sets rs232err to an error code unless rs232err already contains a negative value. ReturnRS232Error returns the same value as rs232err except that it keeps track of separate error codes for each thread in your application. In a multithreaded application, use ReturnRS232Error rather than rs232err.

GetRS232ErrorString translates each possible error code into a meaningful error string.

RS-232 Error Conditions lists the possible error conditions that can occur when you use the RS-232 Library functions.