Qcodes icon indicating copy to clipboard operation
Qcodes copied to clipboard

Add a wait_till_complete() function to the VisaInstrument class

Open rohit19081995 opened this issue 7 years ago • 5 comments

Prior to this change, the instrument timeout needed to be changed for long operations. This is not ideal since a large timeout may hinder debugging.

This change adds a function which checks the ESR to make sure the operation is complete.

@jenshnielsen

rohit19081995 avatar Jun 29 '18 04:06 rohit19081995

Codecov Report

Merging #1168 into master will increase coverage by 12.36%. The diff coverage is 28.57%.

@@             Coverage Diff             @@
##           master    #1168       +/-   ##
===========================================
+ Coverage   67.21%   79.57%   +12.36%     
===========================================
  Files         145       47       -98     
  Lines       17951     6672    -11279     
===========================================
- Hits        12065     5309     -6756     
+ Misses       5886     1363     -4523

codecov[bot] avatar Jun 29 '18 05:06 codecov[bot]

This seems sensible to me. In my experience there are several instruments that do not implement the opc and esr correctly e.g. *OPC? returns immediately regardless of the status of the device presumably this will have the same issue but looks useful for correctly implemented instruments

jenshnielsen avatar Jun 29 '18 08:06 jenshnielsen

Just for completeness, I'd like to add that the timeout can be dynamically changed. Some drivers do this when e.g. capturing long traces. Here is an example of that: https://github.com/QCoDeS/Qcodes/blob/dadc1aba6c8fa4f6b2921114719d8e530c973583/qcodes/instrument_drivers/Keysight/Keysight_34465A.py#L71

WilliamHPNielsen avatar Jun 29 '18 08:06 WilliamHPNielsen

@rohit19081995 any chance you'll finish this PR? do you need help/assistance in completing it?

astafan8 avatar Sep 14 '19 01:09 astafan8

While we wait for that, here's a relevant document from R&S recommending the practice introduced in this PR: https://cdn.rohde-schwarz.com/pws/dl_downloads/dl_application/application_notes/1gp79/1GP79_1E_SCPI_Programming_Guide_SigGens.pdf

WilliamHPNielsen avatar Sep 18 '19 09:09 WilliamHPNielsen