ivi

package module
v0.7.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 31, 2023 License: MIT Imports: 3 Imported by: 0

README

ivi

Go-based implementation of the Interchangeable Virtual Instrument (IVI) standard.

GoDoc Go Report Card License Badge

Overview

The IVI Specifications developed by the IVI Foundation provide standardized APIs for programming test instruments. This package is a partial, Go-based implementation of the IVI Specifications, which are specified for C, COM, and .NET.

The main advantage of the ivi package is not having to learn the SCPI commands for each individual piece of test equipment. For instance, by using the ivi package both the Agilent 33220A and the Stanford Research Systems DS345 function generators can be programmed using one standard API. The only requirement for this is having an IVI driver for the desired test equipment.

If an ivi driver doesn't exist for a peice of test equipment that you want to use, please open an issue and/or submit a pull request. The [IVI Specifications][] don't provide APIs for every type of test equipment (e.g., they don't specify an API for electronic loads) in which case a set of APIs will be developed as needed for new types of test equipment.

Development focus is currently on solidifying the APIs and creating a few IVI drivers for each instrument type.

Installation

$ go get github.com/gotmc/ivi

Usage

The ivi package requires receiving an Instrument interface. The following gotmc packages meet the Instrument interface:

  • visa — Calls lxi or usbtmc as needed, so that you can identify instruments using a VISA resource address string.
  • lxi — Used to control LXI enabled instruments via Ethernet.
  • usbtmc — Used to control USBTMC compliant instruments via USB.
  • prologix — Used to communicate with instruments using a Prologix GPIB controller.

Examples

Examples can be found at https://github.com/gotmc/ivi-examples.

Documentation

Documentation can be found at either:

Contributing

Contributions are welcome! To contribute please:

  1. Fork the repository
  2. Create a feature branch
  3. Code
  4. Submit a pull request
Testing

Prior to submitting a pull request, please run:

$ make check
$ make lint

To update and view the test coverage report:

$ make cover

License

ivi is released under the MIT license. Please see the LICENSE.txt file for more information.

Documentation

Overview

Package ivi provides a Go-based implementation of the Interchangeable Virtual Instrument (IVI) standard. The IVI Specifications developed by the IVI Foundation provide standardized APIs for programming test instruments, such as oscilloscopes, power supplies, and function generators.

The main advantage of the ivi package is not having to learn the Standard Commands for Programmable Instruments (SCPI) commands for each individual piece of test equipment. Contrary to the name, SCPI commands differ from one piece of test equipment to another. For instance, with ivi both the Agilent 33220A and the Stanford Research Systems DS345 function generators can be programmed using one API.

Currently, ivi doesn't cache state. Every time an attribute is read directly from the instrument. Development focus is currently on fleshing out the APIs and creating a few IVI drivers for each instrument type.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func QueryID

func QueryID(q Querier) (string, error)

QueryID queries the identity of the instrument.

func Set

func Set(sw StringWriter, format string, a ...interface{}) error

Set formats according to a format specifier and then writes the resulting string to the given StringWriter interface.

Types

type Inherent

type Inherent struct {
	InherentBase
	// contains filtered or unexported fields
}

Inherent provides the inherent capabilities for all IVI instruments.

func NewInherent

func NewInherent(inst Instrument, base InherentBase) Inherent

NewInherent creates a new Inherent struct using the given Instrument interface and the InherentBase struct.

func (*Inherent) Clear

func (inherent *Inherent) Clear() error

Clear clears the instrument.

func (*Inherent) Disable

func (inherent *Inherent) Disable() error

Disable places the instrument in a quiescent state as quickly as possible. Disable provides the method described in Section 6.4 of IVI-3.2: Inherent Capabilities Specification.

func (*Inherent) FirmwareRevision

func (inherent *Inherent) FirmwareRevision() (string, error)

FirmwareRevision queries the instrument and returns the firmware revision of the instrument. FirmwareRevision is the getter for the read-only inherent attribute Instrument Firmware Revision described in Section 5.18 of IVI-3.2: Inherent Capabilities Specification.

func (*Inherent) InstrumentManufacturer

func (inherent *Inherent) InstrumentManufacturer() (string, error)

InstrumentManufacturer queries the instrument and returns the manufacturer of the instrument. InstrumentManufacturer is the getter for the read-only inherent attribute Instrument Manufacturer described in Section 5.19 of IVI-3.2: Inherent Capabilities Specification.

func (*Inherent) InstrumentModel

func (inherent *Inherent) InstrumentModel() (string, error)

InstrumentModel queries the instrument and returns the model of the instrument. InstrumentModel is the getter for the read-only inherent attribute Instrument Model described in Section 5.20 of IVI-3.2: Inherent Capabilities Specification.

func (*Inherent) InstrumentSerialNumber

func (inherent *Inherent) InstrumentSerialNumber() (string, error)

InstrumentSerialNumber queries the instrument and returns the S/N of the instrument.

func (*Inherent) Reset

func (inherent *Inherent) Reset() error

Reset resets the instrument.

type InherentBase

type InherentBase struct {
	ClassSpecMajorVersion     int
	ClassSpecMinorVersion     int
	ClassSpecRevision         string
	GroupCapabilities         []string
	SupportedInstrumentModels []string
	IDNString                 string
}

InherentBase provides the exported properties for the inherent capabilities of all IVI instruments.

type Instrument

type Instrument interface {
	Read(p []byte) (n int, err error)
	Write(p []byte) (n int, err error)
	StringWriter
	Querier
}

Instrument provides the interface required for all IVI Instruments.

type Querier

type Querier interface {
	Query(s string) (value string, err error)
}

Querier provides the interface to query using a given string and provide the resultant string.

type StringWriter

type StringWriter interface {
	WriteString(s string) (n int, err error)
}

StringWriter provides the interface to write a string.

Directories

Path Synopsis
Package com provides information about communication ports (Ethernet, serial, etc.) for various IVI devices.
Package com provides information about communication ports (Ethernet, serial, etc.) for various IVI devices.
Package dcpwr provides the Defined Values and other structs, methods, etc.
Package dcpwr provides the Defined Values and other structs, methods, etc.
keysight/e36xx
Package e36xx implements the IVI driver for the Agilent/Keysight E3600 series of power supplies.
Package e36xx implements the IVI driver for the Agilent/Keysight E3600 series of power supplies.
kikusui/pmx
Package pmx implements the IVI driver for the KIKUSUI PMX series of regulated DC power supplies.
Package pmx implements the IVI driver for the KIKUSUI PMX series of regulated DC power supplies.
rigol/dp800
Package dp800 implements the IVI driver for the Rigol DP800 series of programmable linear DC power supplies.
Package dp800 implements the IVI driver for the Rigol DP800 series of programmable linear DC power supplies.
template
Package template provides a template to create additional IVI drivers for DC power supplies.
Package template provides a template to create additional IVI drivers for DC power supplies.
dmm
fluke/fluke45
Package fluke45 implements the IVI driver for the Fluke 45 DMM.
Package fluke45 implements the IVI driver for the Fluke 45 DMM.
keysight/key3446x
Package key3446x implements the IVI Instrument driver for the Keysight 3446x family of DMM.
Package key3446x implements the IVI Instrument driver for the Keysight 3446x family of DMM.
dsa
Package dsa provides the Defined Values and other structs, methods, etc.
Package dsa provides the Defined Values and other structs, methods, etc.
Package fgen provides the Defined Values and other structs, methods, etc.
Package fgen provides the Defined Values and other structs, methods, etc.
keysight/key33220
Package key33220 implements the IVI Instrument driver for the Agilent 33220A function generator.
Package key33220 implements the IVI Instrument driver for the Agilent 33220A function generator.
srs/ds345
Package ds345 implements the IVI driver for the Stanford Research System DS345 function generator.
Package ds345 implements the IVI driver for the Stanford Research System DS345 function generator.
Package load provides the Defined Values and other structs, methods, etc.
Package load provides the Defined Values and other structs, methods, etc.
siglent/sdl10xx
Package sdl10xx implements the IVI driver for the Signlent SDL1000X and SDL1030X DC electronic loads.
Package sdl10xx implements the IVI driver for the Signlent SDL1000X and SDL1030X DC electronic loads.
keysight/esa
Package esa implements the IVI driver for the Agilent ESA series spectrum analyzers.
Package esa implements the IVI driver for the Agilent ESA series spectrum analyzers.
Package swtch provides the Defined Values and other structs, interfaces, methods, etc.
Package swtch provides the Defined Values and other structs, interfaces, methods, etc.
keysight/u2751a
Package u2751a implements the IVI driver for the Keysight U2751A 4x8 2-wire switch matrix.
Package u2751a implements the IVI driver for the Keysight U2751A 4x8 2-wire switch matrix.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL