Reads a status byte of the service request.

    Corresponds to viReadSTB function of the VISA library.

    :param library: the visa library wrapped by ctypes.
    :param session: Unique logical identifier to a session.
    :return: Service request status byte, return value of the library call.
    :rtype: int, :class:`pyvisa.constants.StatusCode`

def read_stb(library, session):
    """Reads a status byte of the service request.

    Corresponds to viReadSTB function of the VISA library.

    :param library: the visa library wrapped by ctypes.
    :param session: Unique logical identifier to a session.
    :return: Service request status byte, return value of the library call.
    :rtype: int, :class:`pyvisa.constants.StatusCode`
    """
    status = ViUInt16()
    ret = library.viReadSTB(session, byref(status))
    return status.value, ret