code: def read_to_file(library, session, filename, count):
      
      return_count = ViUInt32()
      ret = library.viReadToFile(session, filename, count, return_count)
      return return_count, ret
docs: Read data synchronously, and store the transferred data in a file.
  
      Corresponds to viReadToFile function of the VISA library.
  
      :param library: the visa library wrapped by ctypes.
      :param session: Unique logical identifier to a session.
      :param filename: Name of file to which data will be written.
      :param count: Number of bytes to be read.
      :return: Number of bytes actually transferred, return value of the library call.
      :rtype: int, :class:`pyvisa.constants.StatusCode`