Skip to main content

What is it

pyivi is a thin wrapper layer that is aware of all IVI-drivers installed on a windows computer and can wrap them to interface remote instruments from python modules or scripts. Since IVI-COM drivers are not always provided, IVI-C is also supported.

The specificity of pyivi is that it is not re-implementing the IVI interface using lower-level communication protocols, but rather directly communicating with the installed IVI-drivers. The main advantage of this approach is that all the boring code that needs to be written for every new instrument is done by the instrument’s manufacturer (99% of the instruments come with either IVI-C or IVI-COM drivers). The drawback is that pyivi is not cross-platform and needs to run on a windows computer.

Step-by-step communication with a spectrum analyzer:

A good example is better than 10000 words, so let’s try and install a new Agilent MXA N9020A Spectrum analyzer. If you don’t have 20 000 $ to spend just for the sake of testing pyivi, that’s OK, IVI drivers come with a simulation feature. We’ll go step-by-step to the point where we can communicate with our simulated spectrum analyzer.

1/ Install pyivi using the windows installer below.

2/ Install the IVI-driver for the MXA N9020A from Agilent’s website (you might have to create an account for this… ;-/) http://www.home.agilent.com/agilent/software.jspx?ckey=2044474&lc=eng&cc=US&nid=-33932.536910861&id=2044474 If this is the first IVI-driver you have been installing, you will be asked to install the IVI-shared components as well. They can be found for free either from National Instruments or directly from the IVI foundation website: http://www.ivifoundation.org/shared_components/

3/ Open your favorite python interpreter and look at the IVI software_modules installed on your computer

import pyivi
pyivi.software_modules

You should see the software module AgXSan that was just installed. This module provides at the same time an IVI-C and an IVI-COM interface. Every time a new IVI software module is installed it will appear in this list.

4/ Create a connection to a virtual N9020A instrument:

comspecan = pyivi.ivi_instrument('dummy_address', model='N9020A', simulate=True)

In the case where you would have a real instrument connected at address ‘USB0::12345678::INSTR’, the following code would have been enough:

comspecan = pyivi.ivi_instrument('USB0::12345678::INSTR')

The model would have been queried directly using the IDN? command. By default, the instrument uses the IVI-COM interface, but we can ask for the IVI-C interface using the appropriate keyword argument:

cspecan = ivi_instrument('dummy_address', flavour='IVI-C', model='N9020A', simulate=True)

That’s it! You can now browse through the attributes and functions of the instrument.

If you have tried both flavours of the driver, you have noticed that some attributes are not accessed in the same way, for instance, to set the measurement bandwidth to 10 kHz, one would write:

cspecan.resolution_bandwidth = 10000 # IVI-C interface
comspecan.sweep_coupling.resolution_bandwidth = 10000 # IVI-COM interface

Of course, that’s not very nice for us because, mostly, we will be using one or the other versions of the drivers interface because it is the only one available. Moreover, some functions are quite cumbersome to locate for instance, with trace-related capabilities. For this reason, shortcuts commands, identical for IVI-C and IVI-COM interfaces have been added:

5/ Using shortcut commands (on IVI-C or IVI-COM drivers):

cspecan.sc.trace_idx = 2 # all the manipulation will be performed on 'Trace2'
cspecan.sc.fetch() # Fetches the simulated trace

Supported IVI-interfaces:

In the current versions, the following IVI apis are supported:
  • IviScope (IVI-C, IVI-COM)

  • IviSpecAn (IVI-C, IVI-COM)

  • IviFGen (IVI-C)

The software module AgNA to control Agilent Network analyzers is also supported via the COM api.

Tested already on the following IVI software modules:

tktds1k2k, tkafg3k, AgSAn, Ag34410, ww257x, lcscope, AgInfiniiVision, AgM933x, TekScope, AgilentSAnBasic, AgN57xx, Tkdpo2k3k4k, Ag532xx, AgNA, AgXSAn,

Dependencies

  • comtypes (for communication with the IVI-configuration store and IVI-COM drivers)

  • ctypes (for communication with IVI-C drivers)

Metadata

Release files for pyivi 0.0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyivi 0.0.8
File Size Uploaded Provenance
pyivi-0.0.8.zip 32.3 kB Without provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for pyivi 0.0.8
File Interpreter ABI Platform
pyivi-0.0.8.win32.exe Details
pyivi-0.0.8-py2.7.egg Legacy Egg format - - Details

Total release size: 323.6 kB

Release files / pyivi-0.0.8.zip

Download URL pyivi-0.0.8.zip
Size 32.3 kB
Tags Source
SHA-256 checksum
How to use checksums
9db23286066be29538bac261186503bdd3ce4ad16931aed388336d389a77025b
BLAKE2b-256 checksum
How to use checksums
711a6f481e020171c2cc61f01778a9006868483790a4705534fe58451a2a5928
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pyivi-0.0.8.win32.exe

Download URL pyivi-0.0.8.win32.exe
Size 229.0 kB
Tags Source
SHA-256 checksum
How to use checksums
cc69236fa8e6f0056abb8f21c974e7bbb434af5d7312cc7c5ce8feb706e0f2e1
BLAKE2b-256 checksum
How to use checksums
33baa9f29bf76cf3f8d0716c8ad27912afd909617fa15e76f31be64d47ca3e67
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pyivi-0.0.8-py2.7.egg

Download URL pyivi-0.0.8-py2.7.egg
Size 62.3 kB
Tags Egg
SHA-256 checksum
How to use checksums
5d91ff0fae006d1bd741faf940e5997e00d1ce906c69020c9f2f4605cd004ba5
BLAKE2b-256 checksum
How to use checksums
c60679edde80b663159f4caf05a8eb6ae7bedee7bb05bf625a20cb3d3fd81d59
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for pyivi 0.0.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page