tektronix / tm_devices

Test & Measurement Device Management
https://tm-devices.readthedocs.io/stable/
Apache License 2.0
45 stars 19 forks source link

[BUG]: Impossible to launch twice a test on Keithley 2450 SMU #129

Open lucasgrjn opened 7 months ago

lucasgrjn commented 7 months ago

Description of the bug

I am not able to launch more than one time a script with my Keithley2450 connected through LAN.

Steps To Reproduce

  1. Launch any examples scripts (for example: the solar cell one)
  2. It works
  3. Try again with the same scripts
  4. I get the following message everytime
    in __clear_visa_output_buffer_and_get_idn
    raise SystemError(error_msg)
      visa_resource = <'TCPIPInstrument'('TCPIP0::192.168.XXX.YYY::inst0::INSTR')>
      idn_response = ''
      error_msg = "VI_ERROR_ABORT (-1073807312): User abort occurred during transfer.\n\tUnable to read data after 2s.\n\t\n\tPlease reboot or read/clear the VISA output buffer on your device and try again."
      old_timeout = 2000
    builtins.SystemError: VI_ERROR_ABORT (-1073807312): User abort occurred during transfer.
        Unable to read data after 2s.
        Please reboot or read/clear the VISA output buffer on your device and try again.

Environment Information

Additional Information

No response

lucasgrjn commented 7 months ago

@nfelt14 A way to avoid the problem was to add a visa_resource.write("*CLS?") between the two following lines to enforce the clearing. https://github.com/tektronix/tm_devices/blob/093f7a905182088302f8682df8cc8cc918447999/src/tm_devices/device_manager.py#L1242-L1243

u625355 commented 7 months ago

@lucasgrjn,If you have access to other series SMU, can you let us know whether this issue is observed on other series SMU as well? This issue seems to be independent of the device being connected, will soon look into this and find a possible fix.

ArunKrGupta commented 7 months ago

When system log massages gets full in the log table, it throws this kind of Visa communication Error. Either clear log messages manually if you have SMU device: MENU ->System ->System Events-> Clear Log. If you are running any tsp scripts use visa_resource.status.clear() to clear the event log table. I am doing smu.commands.status.clear() to clear event log table.

u625355 commented 7 months ago

@lucasgrjn, let us know whether clearing log messages manually is allowing the user to launch twice a test on the SMU 2450.