Add a wait_till_complete() function to the VisaInstrument class
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
Codecov Report
Merging #1168 into master will increase coverage by
12.36%. The diff coverage is28.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
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
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
@rohit19081995 any chance you'll finish this PR? do you need help/assistance in completing it?
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