1

I am using a Agilent 4155C Semiconductor Parameter Analyzer. I am having a controller/device synchronization issue. I am using python PyVisa to write SCPI commands to it. I am also reading data straight from the machine by using PyVisa's query command.

The issue is that as many of you may know, if you send a query command to a system before its finished all its operations, the system spits out a timeout/query interupted error. I read from this manual (Manual Link) (Specifically pages 10-12) and found that people use a for loop with the *CLS, *OPC, and *ESR? commands with a sleep command to check manually if all operations are complete.

The code below is a portion of the code I am trying to run. The proposed solution from the manual has no become the problem because I cannot send the *ESR? query command without timing out either.

Note: The timeout error pops up at instr.query("*ESR?") line.

...
instr.write(":FORM:DATA ASC")

instr.write("*CLS")
instr.write("*OPC")
ESRvalue = 0

while (ESRvalue & 1) == 0:
    instr.query("*ESR?")
    time.sleep(0.01)

I_unicode_data = instr.query(":DATA? 'ID' ")

V_unicode_data = instr.query(":DATA? 'VD' ")

I_raw_data = I_unicode_data.encode('utf-8')

V_raw_data = V_unicode_data.encode('utf-8')
...
Kira
  • 115
  • 9
  • You could try `instr.query(":FORM:DATA ASC; *STB?")` that should return when the operation has completed. The value of `*STB?` should also indicate if some error occurred. – J.J. Hakala Jun 25 '16 at 00:44

0 Answers0