swtch

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package swtch provides the Defined Values and other structs, interfaces, methods, etc. that are common among all instruments meeting the IVI-4.6: IviSwtch Class Specification.

Files are split based on the class capability groups.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPathExists          = errors.New("path exists")
	ErrPathUnsupported     = errors.New("path unsupported")
	ErrResourceInUse       = errors.New("resource in use")
	ErrSourceConflict      = errors.New("source conflict")
	ErrChannelNotAvailable = errors.New("channel not available")
)

Error values for the PathCapability Parameter used in the CanConnect method as defined in Section 4.3.1 of IVI-4.6: IviSwtch Class Specification.

View Source
var (
	ErrExplicitConnectionExists = errors.New("explicit connection exists")
	ErrIsConfigChannel          = errors.New("is config channel")
	ErrAttemptToConnectSources  = errors.New("attempt to connect sources")
	ErrCannotConnectToSelf      = errors.New("cannot connect to self")
	ErrPathNotFound             = errors.New("path not found")
)

Error values that can be returned by the Connect method as defined in Section 4.3.2 of IVI-6.4: IviSwtch Class Specification.

Functions

This section is empty.

Types

type Base

type Base interface {
	CanConnect(ch1, ch2 string) error
	Channel(name string) (BaseChannel, error)
	ChannelByID(id int) (BaseChannel, error)
	ChannelCount() int
	Channels() ([]BaseChannel, error)
	Connect(ch1, ch2 string) error
	Disconnect(ch1, ch2 string) error
	DisconnectAll() error
	GetPath(ch1, ch2 string) ([]string, error)
	SetPath(chs []string) error
	WaitForDebounce(maxTime time.Duration) error
}

Base provides the interface required for the IviSwtchBase capability group.

type BaseChannel

type BaseChannel interface {
	Name() string
	VirtualName() string
	ACCurrentCarryMax() float64
	ACCurrentSwitchingMax() float64
	ACPowerCarryMax() float64
	ACPowerSwitchingMax() float64
	ACVoltageMax() float64
	Bandwidth() float64
	Impedance() float64
	DCCurrentCarryMax() float64
	DCCurrentSwitchingMax() float64
	DCPowerCarryMax() float64
	DCPowerSwitchingMax() float64
	DCVoltageMax() float64
	IsConfigChannel() bool
	SetConfigChannel(b bool) error
	EnableConfigChannel() error
	DisableConfigChannel() error
	IsDebounced() bool
	IsSourceChannel() bool
	SetSourceChannel(b bool) error
	EnableSourceChannel() error
	DisableSourceChannel() error
	SettlingTime() time.Duration
	WireMode() int
}

BaseChannel prives the interface for the channel repeated capability for the IviSwtchBase capability group.

type Channel

type Channel struct {
	// contains filtered or unexported fields
}

Channel models the repeated capability of a generic channel.

func NewChannel

func NewChannel(id int, name string, inst ivi.Instrument) Channel

NewChannel returns a Channel for a switch.

func (*Channel) QueryBool

func (ch *Channel) QueryBool(cmd string) (bool, error)

QueryBool queries the channel and returns a bool.

func (*Channel) QueryFloat64

func (ch *Channel) QueryFloat64(cmd string) (float64, error)

QueryFloat64 queries the channel and returns a float64.

func (*Channel) QueryInt

func (ch *Channel) QueryInt(cmd string) (int, error)

QueryInt queries the channel and returns an int.

func (*Channel) QueryString

func (ch *Channel) QueryString(cmd string) (string, error)

QueryString queries the channel and returns a string.

func (*Channel) Set

func (ch *Channel) Set(format string, a ...interface{}) error

Set writes the format string, using the given paarameters to the channel.

Directories

Path Synopsis
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