pyVisa RS232太慢

2024-09-23 16:30:29 发布

您现在位置:Python中文网/ 问答频道 /正文

简单程序:

import visa
rm = visa.ResourceManager()
list=rm.list_resources()
print(list) # list[0] is RS-232 reference
my_instrument = rm.open_resource(list[0])
print(my_instrument.query('*IDN?'))
#it works fine until this point, asking for one line of text only.
print(my_instrument.query('CURVE?'))
#After this oscilloscope is sending lots of data (1000 digits formatted as strings). 

我得到:

在python3.4中

"VI_ERROR_TMO (-1073807339): Timeout expired before operation completed."

在python3.6中

VI_ERROR_ASRL_OVERRUN "An overrun error occurred during transfer. A character was not read from the hardware before the next character arrived.

据我所知,与数据发送速度相比,pyVisa的读取速度太慢了。当我使用pyVisa/GPIB或pySerial/COM时,同样的过程也起作用。在

我怎样才能更快,或者怎样才能通过pyVisa/COM获取数据?在


Tags: ofrmismyvisaerrorthisquery