I have a MSO9404A, I want to use pyvisa to capture when I2C address write: 0x37 and inform the PC catching waveform data calculation time sequence.
What command does pyvisa have?
Is there a similar example?
Thank you.
I have a MSO9404A, I want to use pyvisa to capture when I2C address write: 0x37 and inform the PC catching waveform data calculation time sequence.
What command does pyvisa have?
Is there a similar example?
Thank you.
Python is no different than any other language when controlling a Keysight Oscilloscope. Command and/or Request ASCII strings are sent, and Responses (ASCII or binary) are received. There are quite a few Python examples available here: Search Results | Keysight (formerly Agilent’s Electronic Measurement) . You will need to filter by "Oscilloscopes". The Programming manual for your scope is part of the help system. It is also available online, and downloadable. I don't know what version of scope SW you have, so I can't add a link.
Al
In the Programmer's Guide for Infiniium Oscilloscopes (see http://www.keysight.com/find/9000a-manual), there is a basic PyVISA example in the "Sample Programs" chapter. The ":SBUS<N>:IIC:TRIGger:TYPE" command description has an example of triggering on a 7-bit address frame read. You'll want to use the ":SBUS1:IIC:TRIGger:TYPE WRITe7" and ":SBUS1:IIC:TRIGger:PATTern:ADDRess '0x37'" commands instead to trigger on a write of 0x37, and if you don't care what the data value is, the ":SBUS1:IIC:TRIGger:PATTern:DATA '0xXXXXXX'" command.
Best regards,
Pat
Thank you.
I am always getting an error on SBUS IIC CLOCK, SCPI Error: 25.
Is there a problem with the sequence?
DSO9104A.write(':SBUS1:IIC:SOURce:CLOCk %s' % ('CHANNEL2')) "SCPI Error: 25,This entry isn't a valid selection. The control has not been modified."
rm = visa.ResourceManager()
# DSO9104A-FW:03.50
DSO9104A = rm.open_resource('USB0::0x0957::0x900D::MY53020106::0::INSTR')
DSO9104A.write('*CLS')
DSO9104A.write('*RST')
identificationString = DSO9104A.query('*IDN?')
DSO9104A.timeout = 50000
DSO9104A.write(':WAVeform:BYTeorder %s' % ('LSBFirst'))
DSO9104A.write(':WAVeform:FORMat %s' % ('WORD'))
DSO9104A.write(':ACQuire:COMPlete %d' % (100))
DSO9104A.write(':DIGitize')
# Unable to generate code for step : (SET OpcBehavior to "OpcPerCommand")
DSO9104A.write(':AUToscale:CHANnels %s' % ('DISPlayed'))
DSO9104A.write(':AUToscale')
DSO9104A.write(':TRIGger:MODE %s' % ('SBUS1'))
DSO9104A.write(':SBUS1:IIC:TRIGger:TYPE %s' % ('WRITE7'))
DSO9104A.write(':SBUS1:IIC:TRIGger:PATTern:ADDRess "%s"' % ('0xb4'))
DSO9104A.write(':SBUS1:IIC:SOURce:DATA %s' % ('CHANNEL1'))
DSO9104A.write(':SBUS1:IIC:SOURce:CLOCk %s' % ('CHANNEL2'))
DSO9104A.write(':CHANnel3:SCALe %G V' % (1.0))
DSO9104A.write(':CHANnel4:SCALe %G V' % (1.0))
DSO9104A.write(':TIMebase:SCALe %G MS' % (10.0))
DSO9104A.write(':ACQuire:MODE %s' % ('RTIMe'))
DSO9104A.write(':ACQuire:POINts:ANALog %s' % ('AUTO'))
DSO9104A.write(':ACQuire:POINts:AUTO %d' % (1))
DSO9104A.close()
rm.close()
In the Programmer's Guide for Infiniium Oscilloscopes (see http://www.keysight.com/find/9000a-manual), there is a basic PyVISA example in the "Sample Programs" chapter. The ":SBUS<N>:IIC:TRIGger:TYPE" command description has an example of triggering on a 7-bit address frame read. You'll want to use the ":SBUS1:IIC:TRIGger:TYPE WRITe7" and ":SBUS1:IIC:TRIGger:PATTern:ADDRess '0x37'" commands instead to trigger on a write of 0x37, and if you don't care what the data value is, the ":SBUS1:IIC:TRIGger:PATTern:DATA '0xXXXXXX'" command.
Best regards,
Pat