def ib_error(code):
    """Given an error code, return the error text. """

    error_strings = [ \
                     "System error", \
                     "Function requires GPIB board to be CIC", \
                     "No Listeners on the GPIB", \
                     "GPIB board not addressed correctly", \
                     "Invalid argument to function call", \
                     "GPIB board not System Controller as required", \
                     "I/O operation aborted (timeout)", \
                     "Nonexistent GPIB board", \
                     "DMA error", \
                     "", \
                     "Asynchronous I/O in progress", \
                     "No capability for operation", \
                     "File system error", \
                     "", \
                     "GPIB bus error", \
                     "", \
                     "SRQ stuck in ON position", \
                     "", \
                     "", \
                     "", \
                     "Table problem", \
                     "Interface is locked", \
                     "Ibnotify callback failed to rearm", \
                     "Input handle is invalid", \
                     "", \
                     "", \
                     "Wait in progress on specified input handle", \
                     "Event notification was cancelled due to a reset of the interface", \
                     "The interface lost power" \
                     ]
    
    return error_strings[code]