pythonpython-2.7instrumentsvisagpib

Anritsu PyVISA issues


I'm having issues communicating with the Anritsu MG69377B microwave generators.

I have no problem going into a remote mode and identifying the instrument, but any other command which returns a value is timed out and the instrument does seem to respond to any write command. I'm using PyVISA to communicate to the instrument.

>>>import visa
>>> x = visa.connect('GPIB::5') #Address the instrument
>>> x.ask('*IDN?')  # Works Fine
>>>'ANRITSU,69377B,010918,2.35'
>>>
>>> x.ask('*STB?')

Traceback (most recent call last):
    File "<pyshell#37>", line 1, in <module>
        x.ask('*STB?')
    File "C:\Python27\lib\site-packages\pyvisa\visa.py", line 502, in ask
        return self.read()
    File "C:\Python27\lib\site-packages\pyvisa\visa.py", line 433, in read
        return self._strip_term_chars(self.read_raw())
    File "C:\Python27\lib\site-packages\pyvisa\visa.py", line 407, in read_raw
        chunk = vpp43.read(self.vi, self.chunk_size)
    File "C:\Python27\lib\site-packages\pyvisa\vpp43.py", line 840, in read
        visa_library().viRead(vi, buffer, count, byref(return_count))
    File "C:\Python27\lib\site-packages\pyvisa\vpp43.py", line 398, in check_status
        raise visa_exceptions.VisaIOError, status
   VisaIOError: VI_ERROR_TMO: Timeout expired before operation completed.

*STB? is a standard IEEE command and should work across any instrument which follows the standard (which is basically all). I've looked in the manual and I can't seem to find anything wrong with syntax for other code as well. The instrument just does not seem to work when connected to remotely with PyVISA. (Unsure if this is a PyVISA problem or an issue with my instrument).


Solution

  • The 693xxB supports two languages, referred to as Native and SCPI. In that instrument the SCPI language was an option (option 19). In a 693xxB with option 19 the language is an instrument setting.

    Native mode only supports the common command *IDN?. SCPI mode supports more common commands, like *STB? for example.

    Your syntax and VISA connection seem fine. It's on the instrument setting/support side.