Мой код: < /p>
Код: Выделить всё
import visa
rm = visa.ResourceManager()
name = rm.list_resources()
#using with allows to close explicitly the resource at the end of the script
with rm.open_resource('ASRL3::INSTR') as Power_Analyser:
Power_Analyser.values_format.is_binary = True
Power_Analyser.values_format.datatype = 'B'
Power_Analyser.values_format.is_big_endian = False
Power_Analyser.values_format.container = bytearray
Power_Analyser.timeout = 25000 #2,5 seconds
Power_Analyser.write_termination = '\n'
Data = Power_Analyser.query_ascii_values('P?',datatype='s')[0]
print(Data)
#write the Data to a file on my PC
PCfilePath = 'C:\\Users\\ApCha\\Documents\\Python Scripts\\a.txt'
newFile = open(PCfilePath, "wb")
newFile.write(Data)
newFile.close()
< /code>
показывает мне: visaioerror: vi_error_tmo (-1073807339): срок действия тайм-аута до завершения операции. Я предполагаю, что проблема происходит из синтаксиса в
Power_Analyser.query_ascii_values('P?',datatype='s')[0]
Я проверил в руководстве моего устройства:
https://scdn.rohde-schwarz.com/ur/pws/d ... 015_scmain < /p>
Но ничто не работает, и ничего ясно объяснено для Python Visa, и у меня нет опыта с этим. Кто -нибудь знает, как решить проблему?
Подробнее здесь: https://stackoverflow.com/questions/566 ... -completed