Hi Xiang,<br>
<br>
If you're using pyvisa, you can just use <code>read_raw()</code> with no arguments and it will automatically read the whole file and stop, there's no need to set the number of bytes to read.<br>
And in fact the argument to <code>read_raw()</code> isn't the number of bytes to read, it's the chunk size to do that reading in, different things, as documented here: <a href="https://pyvisa.readthedocs.io/en/latest/api/resources.html#pyvisa.resources.SerialInstrument.read_raw">https://pyvisa.readthedocs.io/en/latest/api/resources.html#pyvisa.resources.SerialInstrument.read_raw</a>