Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
f0a3168
initial commit of DPO2000 & MSO2000 support.
nicedwarf Jun 20, 2016
33724b2
Added MSO2014B
nicedwarf Jun 20, 2016
ab06942
Fixed minor syntax error
nicedwarf Jun 20, 2016
ffe9063
updated trigger source conditional to support 'edg' case.
nicedwarf Jun 28, 2016
f1bcff8
Updated MSO2000 to support model specific acquisition type and slope …
nicedwarf Jun 29, 2016
2bbd94b
Made acq type and slope map a class variable.
nicedwarf Jun 29, 2016
88275a4
updated variable
nicedwarf Jun 29, 2016
9e921ca
adds _trigger_value_map to class for mapping trigger values like 'ris…
tslateman Jul 13, 2016
7ec10e8
Merge pull request #1 from tslateman/master
nicedwarf Jul 13, 2016
1d10e6b
adds acq mapping, changes naming convention of class set_maps and get…
tslateman Jul 13, 2016
c811a5d
Merge pull request #2 from tslateman/master
nicedwarf Aug 1, 2016
fb0ac0d
Updated vertical divisions to 8
nicedwarf Aug 17, 2016
1f90b38
Merge remote-tracking branch 'refs/remotes/origin/master'
nicedwarf Aug 17, 2016
342c987
Merge remote-tracking branch 'refs/remotes/origin/master'
nicedwarf Nov 7, 2016
9688ae8
Initial commit of Tektronix DPO7034C support
nicedwarf Nov 7, 2016
46702ab
Fixed typo
nicedwarf Nov 7, 2016
84623ed
Initial commit for DSOS804A
nicedwarf Nov 9, 2016
c47d69d
New DPO features to support GRL
nicedwarf Dec 5, 2016
31f6b43
updated comment for DSO of agilent
nicedwarf Dec 7, 2016
2c76682
Incorporating updates to endianness
nicedwarf Dec 22, 2016
d1aac14
Fixed class for super
nicedwarf Dec 22, 2016
16d2b8a
Initial checkin of MSO5204B support.
nicedwarf Jan 30, 2017
50588bd
Adding updates to init file for new scopes
nicedwarf Jan 30, 2017
e6037f3
update
nicedwarf Jan 30, 2017
fb47e2d
fixed typo
nicedwarf Jan 30, 2017
274ea5a
Fixed indentation
nicedwarf Jan 30, 2017
f2366fd
fixed add_property bug
nicedwarf Jan 30, 2017
226f52b
fix
nicedwarf Jan 30, 2017
c804dbc
Added screenshot fetch
nicedwarf Jan 31, 2017
7fea817
Updated measurement mapping to support negative and positive overshoot
nicedwarf Feb 24, 2017
87a6458
First test checkin of new rigol
nicedwarf Apr 19, 2017
7c4949b
Happy new year
nicedwarf Apr 19, 2017
affad6f
Initial checkin of Rigol driver support
nicedwarf Apr 19, 2017
abc4251
Adding DS2000A
nicedwarf Apr 20, 2017
96d87d4
updated channel naming
nicedwarf May 12, 2017
1767935
Updated measurement syntax
nicedwarf May 12, 2017
4563512
Minor tweak to measurement function
nicedwarf May 13, 2017
ef936fb
Updated channel offset sign
nicedwarf Jun 1, 2017
5610184
Updating vertical divisions number
nicedwarf Jun 16, 2017
fd9a1db
adding support for channel position
nicedwarf Jun 16, 2017
1fc9041
Decached timebase values
nicedwarf Jun 20, 2017
7e161cd
added negative duty cycle measurement and fixed bug in channel coupli…
nicedwarf Jul 6, 2017
e704932
fixed channel offset sign and fixed channel_range
nicedwarf Jul 6, 2017
417ed35
Fixed memory depth bugs
nicedwarf Jul 6, 2017
61f4c51
fixed caches
nicedwarf Jul 6, 2017
d25fdd0
Updated cache for offset
nicedwarf Jul 6, 2017
1a4cb98
Updated vertical divisions to 8
nicedwarf Jul 24, 2017
898dda6
Support for RigolDS1054Z
nicedwarf Jul 27, 2017
fe28b8b
fixed minor bug
nicedwarf Jul 27, 2017
3d194b0
updated divisions
nicedwarf Jul 28, 2017
54756d5
Initial checkin of DPO3014 support.
nicedwarf Sep 11, 2017
84b64b0
Update for DPO3014
nicedwarf Sep 13, 2017
e8f09b5
added DPO3034
nicedwarf Sep 13, 2017
709064c
fixed super class
nicedwarf Sep 13, 2017
c4b0d3a
updated vertical divisions
nicedwarf Nov 8, 2017
1898201
Initial commit of MSO9104A and MSO9604A support.
nicedwarf Aug 10, 2018
34e7221
added timebase reference to infiniuum base
nicedwarf Sep 8, 2018
409c142
digital waveform fetch
nicedwarf Sep 11, 2018
c13777d
cleaned up text
nicedwarf Sep 11, 2018
0272e3e
support AUTO in mdepth
nicedwarf Sep 18, 2018
f9ece1f
added analog sample rate
nicedwarf Sep 25, 2018
f92b05e
'getpointsmin'
nicedwarf Oct 1, 2018
507b934
Merge branch 'master' of https://github.com/nicedwarf/python-ivi
nicedwarf Oct 1, 2018
99e4c47
'coupling'
nicedwarf Oct 1, 2018
23ffff6
wip
nicedwarf Oct 2, 2018
a19b282
'updates_for_9064'
nicedwarf Oct 2, 2018
8105d80
updated_mso9104A
nicedwarf Oct 4, 2018
ddcafad
samplerate
nicedwarf Oct 15, 2018
1396b36
updated start time and scale
nicedwarf Oct 17, 2018
fbc7408
timebase position fix
nicedwarf Oct 19, 2018
302b5a8
updated init_channels for MDO3000
nicedwarf Jan 10, 2019
e53cf2c
Merge branch 'master' of https://github.com/nicedwarf/python-ivi
nicedwarf Jan 10, 2019
2a9aeb8
updated setting of acq points
nicedwarf Jan 24, 2019
ba24571
updated version
nicedwarf Jan 24, 2019
21e1a8e
Updated to always return get cache valid false
nicedwarf Feb 22, 2019
3f02fbc
added support for new Rigol scope models
nicedwarf Apr 4, 2019
0ccf6f0
updated fetch waveform measurement function
nicedwarf Apr 5, 2019
e7c98a5
version 19.5
nicedwarf Apr 5, 2019
7e0aabb
updated tektronix driver support
nicedwarf Apr 12, 2019
e6b9e12
updates for Rigol
nicedwarf May 7, 2019
90595c1
update to inits
nicedwarf May 7, 2019
587f427
rev version
nicedwarf May 7, 2019
77e545b
changed autoscale to autoset
nicedwarf May 15, 2019
985c8ef
rev'd version
nicedwarf May 15, 2019
169e665
updated acquisition length
nicedwarf May 24, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion ivi/agilent/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@
from .agilentMSO7052B import agilentMSO7052B
from .agilentMSO7054B import agilentMSO7054B
from .agilentMSO7104B import agilentMSO7104B
# Infiniium 9000A
from .agilentMSO9104A import agilentMSO9104A
from .agilentMSO9064A import agilentMSO9064A
# Infiniium 90000A
from .agilentDSO90254A import agilentDSO90254A
from .agilentDSO90404A import agilentDSO90404A
Expand Down Expand Up @@ -153,7 +156,9 @@
from .agilentMSOX92504A import agilentMSOX92504A
from .agilentMSOX92804A import agilentMSOX92804A
from .agilentMSOX93204A import agilentMSOX93204A

# # Infinium S series
# from .agilentDSOS204A import agilentDSOS204A
# from .agilentDSOS804A import agilentDSOS804A
# Spectrum Analyzers
# 859xA series
from .agilent8590A import agilent8590A
Expand Down
353 changes: 353 additions & 0 deletions ivi/agilent/agilent9000.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,353 @@
"""

Python Interchangeable Virtual Instrument Library

Copyright (c) 2012-2016 Alex Forencich

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

"""

from .agilentBaseInfiniium import *

AcquisitionModeMapping = {
'etim': ('normal', 'equivalent_time'),
'rtim': ('normal', 'real_time'),
'pdet': ('peak_detect', 'real_time'),
'hres': ('high_resolution', 'real_time'),
'segm': ('normal', 'segmented'),
'segp': ('peak_detect', 'segmented'),
'segh': ('high_resolution', 'segmented')
}
AcquisitionType = set(['normal', 'peak_detect', 'high_resolution'])
VerticalCoupling = set(['dc'])
ScreenshotImageFormatMapping = {
'tif': 'tif',
'tiff': 'tif',
'bmp': 'bmp',
'bmp24': 'bmp',
'png': 'png',
'png24': 'png',
'jpg': 'jpg',
'jpeg': 'jpg',
'gif': 'gif'}
SampleMode = set(['real_time', 'equivalent_time', 'segmented'])

class agilent9000(agilentBaseInfiniium):
"Agilent Infiniium 9000A series IVI oscilloscope driver"

def __init__(self, *args, **kwargs):
self.__dict__.setdefault('_instrument_id', '')
self._analog_channel_name = list()
self._analog_channel_count = 4
self._digital_channel_name = list()
self._digital_channel_count = 16
self._channel_count = self._analog_channel_count + self._digital_channel_count
self._channel_common_mode = list()
self._channel_differential = list()
self._channel_differential_skew = list()
self._channel_display_auto = list()
self._channel_display_offset = list()
self._channel_display_range = list()
self._channel_display_scale = list()

super(agilent9000, self).__init__(*args, **kwargs)

self._analog_channel_name = list()
self._analog_channel_count = 4
self._digital_channel_name = list()
self._digital_channel_count = 16
self._channel_count = self._analog_channel_count + self._digital_channel_count
self._bandwidth = 4e9

self._horizontal_divisions = 10
self._vertical_divisions = 8

self._display_color_grade = False

self._identity_description = "Agilent Infiniium 9000A series IVI oscilloscope driver"
self._identity_supported_instrument_models = ['MSO9104A', 'MSO9064A']

self._add_property('channels[].common_mode',
self._get_channel_common_mode,
self._set_channel_common_mode,
None,
ivi.Doc("""
Turns on/off common mode for the channel. Channels 2 and 4 may form a
common mode channel and channels 1 and 3 may form a common mode channel.
"""))
self._add_property('channels[].differential',
self._get_channel_differential,
self._set_channel_differential,
None,
ivi.Doc("""
Turns on/off differential mode for the channel. Channels 2 and 4 may form
a differential channel and channels 1 and 3 may form a differential
channel.
"""))
self._add_property('channels[].differential_skew',
self._get_channel_differential_skew,
self._set_channel_differential_skew,
None,
ivi.Doc("""
Specifies the skew that is applied to the differential or common mode pair
of channels. Units are seconds.
"""))
self._add_property('channels[].display_auto',
self._get_channel_display_auto,
self._set_channel_display_auto,
None,
ivi.Doc("""
Sets the differential and common mode display scale and offset to track
the acquisition scale and offset.
"""))
self._add_property('channels[].display_offset',
self._get_channel_display_offset,
self._set_channel_display_offset,
None,
ivi.Doc("""
Sets the displayed offset of the selected channel. Setting this parameter
disables display_auto. Units are volts.
"""))
self._add_property('channels[].display_range',
self._get_channel_display_range,
self._set_channel_display_range,
None,
ivi.Doc("""
Sets the full scale vertical range of the selected channel. Setting this
parameter disables display_auto. Units are volts.
"""))
self._add_property('channels[].display_scale',
self._get_channel_display_scale,
self._set_channel_display_scale,
None,
ivi.Doc("""
Sets the displayed scale of the selected channel per division. Setting
this parameter disables display_auto. Units are volts.
"""))

self._init_channels()


def _utility_error_query(self):
error_code = 0
error_message = "No error"
if not self._driver_operation_simulate:
error_code = self._ask(":system:error?")
error_code = int(error_code)
if error_code != 0:
error_message = "Unknown"
return (error_code, error_message)

def _init_channels(self):
try:
super(agilent9000, self)._init_channels()
except AttributeError:
pass

self._channel_common_mode = list()
self._channel_differential = list()
self._channel_differential_skew = list()
self._channel_display_auto = list()
self._channel_display_offset = list()
self._channel_display_range = list()
self._channel_display_scale = list()

for i in range(self._analog_channel_count):
self._channel_common_mode.append(False)
self._channel_differential.append(False)
self._channel_differential_skew.append(0)
self._channel_display_auto.append(True)
self._channel_display_offset.append(0.0)
self._channel_display_range.append(1.0)
self._channel_display_scale.append(0.1)


def _display_fetch_screenshot(self, format='png', invert=False):
if self._driver_operation_simulate:
return b''

if format not in ScreenshotImageFormatMapping:
raise ivi.ValueNotSupportedException()

format = ScreenshotImageFormatMapping[format]

self._write(":display:data? %s, screen, on, %s" % (format, 'invert' if invert else 'normal'))

return self._read_ieee_block()

def _get_channel_common_mode(self, index):
index = ivi.get_index(self._analog_channel_name, index)
if not self._driver_operation_simulate and not self._get_cache_valid(index=index):
self._channel_common_mode[index] = bool(int(self._ask(":%s:commonmode?" % self._channel_name[index])))
self._set_cache_valid(index=index)
return self._channel_common_mode[index]

def _set_channel_common_mode(self, index, value):
index = ivi.get_index(self._analog_channel_name, index)
value = bool(value)
if not self._driver_operation_simulate:
self._write(":%s:commonmode %d" % (self._channel_name[index], int(value)))
self._channel_common_mode[index] = value
self._set_cache_valid(index=index)

def _get_channel_differential(self, index):
index = ivi.get_index(self._analog_channel_name, index)
if not self._driver_operation_simulate and not self._get_cache_valid(index=index):
self._channel_differential[index] = bool(int(self._ask(":%s:differential?" % self._channel_name[index])))
self._set_cache_valid(index=index)
return self._channel_differential[index]

def _set_channel_differential(self, index, value):
index = ivi.get_index(self._analog_channel_name, index)
value = bool(value)
if not self._driver_operation_simulate:
self._write(":%s:differential %d" % (self._channel_name[index], int(value)))
self._channel_differential[index] = value
self._set_cache_valid(index=index)

def _get_channel_differential_skew(self, index):
index = ivi.get_index(self._analog_channel_name, index)
if not self._driver_operation_simulate and not self._get_cache_valid(index=index):
self._channel_differential_skew[index] = float(self._ask(":%s:differential:skew?" % self._channel_name[index]))
self._set_cache_valid(index=index)
return self._channel_differential_skew[index]

def _set_channel_differential_skew(self, index, value):
index = ivi.get_index(self._analog_channel_name, index)
value = float(value)
if not self._driver_operation_simulate:
self._write(":%s:differential:skew %e" % (self._channel_name[index], value))
self._channel_differential_skew[index] = value
self._set_cache_valid(index=index)

def _get_channel_display_auto(self, index):
index = ivi.get_index(self._analog_channel_name, index)
if not self._driver_operation_simulate and not self._get_cache_valid(index=index):
self._channel_display_auto[index] = bool(int(self._ask(":%s:display:auto?" % self._channel_name[index])))
self._set_cache_valid(index=index)
return self._channel_display_auto[index]

def _set_channel_display_auto(self, index, value):
index = ivi.get_index(self._analog_channel_name, index)
value = bool(value)
if not self._driver_operation_simulate:
self._write(":%s:display:auto %d" % (self._channel_name[index], int(value)))
self._channel_display_auto[index] = value
self._set_cache_valid(index=index)

def _get_channel_display_offset(self, index):
index = ivi.get_index(self._analog_channel_name, index)
if not self._driver_operation_simulate and not self._get_cache_valid(index=index):
self._channel_display_offset[index] = float(self._ask(":%s:display:offset?" % self._channel_name[index]))
self._set_cache_valid(index=index)
return self._channel_display_offset[index]

def _set_channel_display_offset(self, index, value):
index = ivi.get_index(self._analog_channel_name, index)
value = float(value)
if not self._driver_operation_simulate:
self._write(":%s:display:offset %e" % (self._channel_name[index], value))
self._channel_display_offset[index] = value
self._set_cache_valid(index=index)

def _get_channel_display_range(self, index):
index = ivi.get_index(self._analog_channel_name, index)
if not self._driver_operation_simulate and not self._get_cache_valid(index=index):
self._channel_display_range[index] = float(self._ask(":%s:display:range?" % self._channel_name[index]))
self._set_cache_valid(index=index)
return self._channel_display_range[index]

def _set_channel_display_range(self, index, value):
index = ivi.get_index(self._analog_channel_name, index)
value = float(value)
if not self._driver_operation_simulate:
self._write(":%s:display:range %e" % (self._channel_name[index], value))
self._channel_display_range[index] = value
self._set_cache_valid(index=index)

def _get_channel_display_scale(self, index):
index = ivi.get_index(self._analog_channel_name, index)
if not self._driver_operation_simulate and not self._get_cache_valid(index=index):
self._channel_display_scale[index] = float(self._ask(":%s:display:scale?" % self._channel_name[index]))
self._set_cache_valid(index=index)
return self._channel_display_scale[index]

def _set_channel_display_scale(self, index, value):
index = ivi.get_index(self._analog_channel_name, index)
value = float(value)
if not self._driver_operation_simulate:
self._write(":%s:display:scale %e" % (self._channel_name[index], value))
self._channel_display_scale[index] = value
self._set_cache_valid(index=index)

def _measurement_fetch_waveform(self, index):
index = ivi.get_index(self._channel_name, index)

if self._driver_operation_simulate:
return list()

if sys.byteorder == 'little':
self._write(":waveform:byteorder lsbfirst")
else:
self._write(":waveform:byteorder msbfirst")
self._write(":waveform:format word")
self._write(":waveform:streaming on")
self._write(":waveform:source %s" % self._channel_name[index])

# Read preamble

pre = self._ask(":waveform:preamble?").split(',')

format = int(pre[0])
type = int(pre[1])
points = int(pre[2])
count = int(pre[3])
xincrement = float(pre[4])
xorigin = float(pre[5])
xreference = int(float(pre[6]))
yincrement = float(pre[7])
yorigin = float(pre[8])
yreference = int(float(pre[9]))

# if type == 1:
# raise scope.InvalidAcquisitionTypeException()

if format != 2:
raise UnexpectedResponseException()

# Read waveform data
raw_data = self._ask_for_ieee_block(":waveform:data?")

# Split out points and convert to time and voltage pairs
y_data = array.array('h', raw_data[0:points*2])

data = [(((i - xreference) * xincrement) + xorigin, float('nan') if y == 31232 else ((y - yreference) * yincrement) + yorigin) for i, y in enumerate(y_data)]

return data

def _measurement_read_waveform(self, index, maximum_time):
return self._measurement_fetch_waveform(index)

def _measurement_initiate(self):
if not self._driver_operation_simulate:
self._write(":acquire:complete 100")
self._write(":digitize")
self._set_cache_valid(False, 'trigger_continuous')

Loading