07-20-2010 12:10 PM
Hi, I'm trying to remotely control the Bit Analyzer Bert Scope with PyVISA through GPIB interface.
For sanity check, I first swich to the generator view using BERT.write("VIEW GEN") and disable all the outputs using the following code:
BERT.write("GEN:DOP:ENAB 0")
BERT.write("GEN:DON:ENAB 0")
BERT.write("GEN:COP:ENAB 0")
BERT.write("GEN:CON:ENAB 0")
Then, I attemp to re-enable all the outputs again through the following codes:
BERT.write("GEN:DOP:ENAB 1")
BERT.write("GEN:DON:ENAB 1")
BERT.write("GEN:COP:ENAB 1")
BERT.write("GEN:CON:ENAB 1")
However, sometimes, after the generator of Bert execute the first enable command, it will return a TIMEOUT error for next line's execution.
That is, after the first enable line is executed, the command that follows it will run into such error. I tried commenting out the seconds enable line
but then it returns TIMEOUT error for third line's execution. I also tried to put 5 seconds delay in between by letting the OS sleep for 5 seconds but the error still shows up.
This error, however, is not consistent. In some occasion, the code would run fine but in some other time, the error condition is raised.
Does anyone know a solution that can guarantee the codes to run smoothly for every execution? Or this is just an anomaly that is related to the instrument?
People have suggested that it has something to do with the protocol where the handshake is not established. However, I think the handshake is handled within PyVISA's
implementation since I only encounter this problem when attempting to controll the Bert scope but not other instruments like multi-meter, frequency counter, pulse generator, and power supply units.
07-20-2010 12:57 PM
Sorry about the auto face expression. The happy face 😄 is really just : and D
07-21-2010 05:02 PM
Hi passion443,
I think a capture from NI-SPY would be helpful in debugging this. You can use KB 4P3FR2LQ: Performing a Good NI Spy Capture for Debugging/Troubleshooting as a guide to perform the capture. This will help us isolate the problem to a VISA call or a coding error.
07-21-2010 06:22 PM
Thanks, I'll give it a try.