VISA event handler with PYVisa

59 Views Asked by At

I have a problem with the event handler, with the Service Request Register.

def enviarsend_command():
    sleep(5)
    instr.write("ASDdaw")
    print('mensaje enviado')

rm = pyvisa.ResourceManager()

#instr = rm.open_resource('USB0::0x0699::0x0362::C060465::INSTR')   'ASRL3::INSTR'
lista_visa = rm.list_resources()

instr = rm.open_resource(lista_visa[0]) 
print(lista_visa[0])

#Indicamos el tipo de evento del que queremos notificacion
event_type = constants.EventType.service_request

event_ges = pyvisa.constants.EventMechanism.queue



instr.enable_event(event_type, event_ges)
thread = threading.Thread(target=send_command)
thread.start()


respuesta = instr.wait_on_event(event_type, 10000 )
print(respuesta)


instr.disable_event(event_type, event_ges)

I am using a TDS 1001B osciloscopie from Tektronix. I tryed sendind the command *ESR 1, to habilitate the ESR register but always have a Timeout error on wait_on_event.

0

There are 0 best solutions below