template

package
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

Documentation

Overview

Package template provides a template to create additional IVI drivers for DC power supplies.

State Caching: Not implemented

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AvailableCOMPorts

func AvailableCOMPorts() []string

AvailableCOMPorts lists the avaialble COM ports, including optional ports.

func DefaultGPIBAddress

func DefaultGPIBAddress() int

DefaultGPIBAddress lists the default GPIB interface address.

func DefaultSerialBaudRate

func DefaultSerialBaudRate() int

DefaultSerialBaudRate returns the default baud rate for the RS-232 serial port.

func DefaultSerialDataFrame

func DefaultSerialDataFrame() string

DefaultSerialDataFrame returns the default RS-232 data frame format.

func SerialBaudRates

func SerialBaudRates() []int

SerialBaudRates lists the available baud rates for the RS-232 serial port from the fastest to the slowest.

func SerialConfig

func SerialConfig() string

SerialConfig lists whether the RS-232 serial port is configured as a DCE (Data Circuit-Terminating Equipment) or a DTE (Data Terminal Equipment). Computers running the IVI program are DTEs; therefore, use a straight through serial cable when connecting to DCEs and a null modem cable when connecting to DTEs.

func SerialDataFrames

func SerialDataFrames() []string

SerialDataFrames lists the available RS-232 data frame formats.

Types

type Channel

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

Channel models the output channel repeated capabilitiy for the DC power supply output channel.

func (*Channel) ConfigureCurrentLimit

func (ch *Channel) ConfigureCurrentLimit(behavior dcpwr.CurrentLimitBehavior, limit float64) error

ConfigureCurrentLimit configures the current limit. It specifies the output current limit value and the behavior of the power supply when the output current is greater than or equal to that value.

ConfigureCurrentLimit implements the IviDCPwrBase function described in Section 4.3.1 of IVI-4.4: IviDCPwr Class Specification.

func (*Channel) ConfigureOVP

func (ch *Channel) ConfigureOVP(b bool, limit float64) error

ConfigureOVP configures the Over-Voltage Protection (OVP). It specifies the over-voltage limit and the behavior of the power supply when the output voltage is greater than or equal to that value. When the Enabled parameter is False, the Limit parameter does not affect the instrument’s behavior, and the driver does not set the OVP Limit attribute.

ConfigureOVP implements the IviDCPwrBase function described in Section 4.3.4 of IVI-4.4: IviDCPwr Class Specification.

func (*Channel) ConfigureOutputRange

func (ch *Channel) ConfigureOutputRange(rt dcpwr.RangeType, rng float64) error

ConfigureOutputRange configures either the power supply’s output voltage or current range on an output. Setting a voltage range can invalidate a previously configured current range. Setting a current range can invalidate a previously configured voltage range.

ConfigureOutputRange implements the IviDCPwrBase function described in Section 4.3.3 of IVI-4.4: IviDCPwr Class Specification.

func (*Channel) CurrentLimit

func (ch *Channel) CurrentLimit() (float64, error)

CurrentLimit determines the output current limit. The units are Amps.

CurrentLimit implements the getter for the read-write IviDCPwrBase Attribute Current Limit described in Section 4.2.1 of IVI-4.4: IviDCPwr Class Specification.

func (*Channel) CurrentLimitBehavior

func (ch *Channel) CurrentLimitBehavior() (dcpwr.CurrentLimitBehavior, error)

CurrentLimitBehavior determines the behavior of the power supply when the output current is equal to or greater than the value of the Current Limit attribute.

CurrentLimitBehavior implements the getter for the read-write IviDCPwrBase Attribute Current Limit Behavior described in Section 4.2.2 of IVI-4.4: IviDCPwr Class Specification.

func (*Channel) DisableOVP

func (ch *Channel) DisableOVP() error

DisableOVP is a convenience function for disabling Over-Voltage Protection (OVP).

func (*Channel) DisableOutput

func (ch *Channel) DisableOutput() error

DisableOutput is a convenience function for setting the Output Enabled attribute to false.

func (*Channel) EnableOVP

func (ch *Channel) EnableOVP() error

EnableOVP is a convenience function for enabling Over-Voltage Protection (OVP).

func (*Channel) EnableOutput

func (ch *Channel) EnableOutput() error

EnableOutput is a convenience function for setting the Output Enabled attribute to true.

func (*Channel) MeasureCurrent

func (ch *Channel) MeasureCurrent() (float64, error)

MeasureCurrent takes a measurement on the output signal and returns the measured current.

MeasureCurrent implements the IviDCPwrMeasurement function Measure for the Current MeasurementType parameter described in Section 7.2.1 of IVI-4.4: IviDCPwr Class Specification.

func (*Channel) MeasureVoltage

func (ch *Channel) MeasureVoltage() (float64, error)

MeasureVoltage takes a measurement on the output signal and returns the measured voltage.

MeasureVoltage implements the IviDCPwrMeasurement function Measure for the Voltage MeasurementType parameter described in Section 7.2.1 of IVI-4.4: IviDCPwr Class Specification.

func (*Channel) OVPEnabled

func (ch *Channel) OVPEnabled() (bool, error)

OVPEnabled returns true if Over-Voltage Protection (OVP) is enabled.

OVPEnabled is the getter for the read-write IviFgenBase Attribute OVP Enabled described in Section 4.2.4 of IVI-4.4: IviDCPwr Class Specification.

func (*Channel) OVPLimit

func (ch *Channel) OVPLimit() (float64, error)

OVPLimit reads the voltage limit currently set for Over-Voltage Protection (OVP).

OVPLimit is the getter for the read-write IviDWPwrBase Attribute OVP Limit described in Section 4.2.5 of IVI-4.4: IviDCPwr Class Specification.

func (*Channel) OutputEnabled

func (ch *Channel) OutputEnabled() (bool, error)

OutputEnabled determines if all three output channels are enabled or disabled.

OutputEnabled is the getter for the read-write IviDCPwrBase Attribute Output Enabled described in Section 4.2.3 of IVI-4.4: IviDCPwr Class Specification.

func (*Channel) QueryCurrentLimitMax

func (ch *Channel) QueryCurrentLimitMax(voltage float64) (float64, error)

QueryCurrentLimitMax returns the maximum programmable current limit that the power supply accepts for a particular voltage level on an output.

QueryCurrentLimitMax implements the IviDCPwrBase function described in Section 4.3.7 of IVI-4.4: IviDCPwr Class Specification.

func (*Channel) QueryOutputState

func (ch *Channel) QueryOutputState(os dcpwr.OutputState) (bool, error)

QueryOutputState returns whether the power supply is in a particular output state.

QueryOutputState implements the IviDCPwrBase function described in Section 4.3.9 of IVI-4.4: IviDCPwr Class Specification.

func (*Channel) QueryVoltageLevelMax

func (ch *Channel) QueryVoltageLevelMax(currentLimit float64) (float64, error)

QueryVoltageLevelMax returns the maximum programmable voltage level that the power supply accepts for a particular current limit on an output.

QueryVoltageLevelMax implements the IviDCPwrBase function described in Section 4.3.8 of IVI-4.4: IviDCPwr Class Specification.

func (*Channel) ResetOutputProtection

func (ch *Channel) ResetOutputProtection() error

ResetOutputProtection resets the power supply output protection after an over-voltage or over-current condition occurs.

ResetOutputProtection implements the IviDCPwrBase function described in Section 4.3.10 of IVI-4.4: IviDCPwr Class Specification.

func (*Channel) SetCurrentLimit

func (ch *Channel) SetCurrentLimit(limit float64) error

SetCurrentLimit specifies the output current limit in Amperes.

SetCurrentLimit implements the setter for the read-write IviDCPwrBase Attribute Current Limit described in Section 4.2.1 of IVI-4.4: IviDCPwr Class Specification.

func (*Channel) SetCurrentLimitBehavior

func (ch *Channel) SetCurrentLimitBehavior(behavior dcpwr.CurrentLimitBehavior) error

SetCurrentLimitBehavior specifies the behavior of the power supply when the output current is equal to or greater than the value of the current limit attribute.

CurrentLimitBehavior implements the getter for the read-write IviDCPwrBase Attribute Current Limit Behavior described in Section 4.2.2 of IVI-4.4: IviDCPwr Class Specification.

func (*Channel) SetOVPEnabled

func (ch *Channel) SetOVPEnabled(v bool) error

SetOVPEnabled enables or disables Over-Voltage Protection (OVP).

SetOVPEnabled is the setter for the read-write IviFgenBase Attribute OVP Enabled described in Section 4.2.4 of IVI-4.4: IviDCPwr Class Specification.

func (*Channel) SetOVPLimit

func (ch *Channel) SetOVPLimit(limit float64) error

SetOVPLimit sets the voltage limit for Over-Voltage Protection (OVP).

SetOVPLimit is the setter for the read-write IviDCPwrBase Attribute OVP Limit described in Section 4.2.5 of IVI-4.4: IviDCPwr Class Specification.

func (*Channel) SetOutputEnabled

func (ch *Channel) SetOutputEnabled(v bool) error

SetOutputEnabled sets all three output channels to enabled or disabled.

SetOutputEnabled is the setter for the read-write IviDCPwrBase Attribute Output Enabled described in Section 4.2.3 of IVI-4.4: IviDCPwr Class Specification.

func (*Channel) SetVoltageLevel

func (ch *Channel) SetVoltageLevel(amp float64) error

SetVoltageLevel specifies the voltage level the DC power supply attempts to generate in Volts.

SetVoltageLevel is the setter for the read-write IviDCPwrBase Attribute Voltage Level described in Section 4.2.6 of IVI-4.4: IviDCPwr Class Specification.

func (*Channel) VoltageLevel

func (ch *Channel) VoltageLevel() (float64, error)

VoltageLevel reads the specified voltage level the DC power supply attempts to generate in Volts.

VoltageLevel is the getter for the read-write IviDCPwrBase Attribute Voltage Level described in Section 4.2.6 of IVI-4.4: IviDCPwr Class Specification.

type Device

type Device struct {
	Channels []Channel
	ivi.Inherent
	// contains filtered or unexported fields
}

Device provides the IVI driver for the Rigol DP800 series of DC power supplies.

func New

func New(inst ivi.Instrument, reset bool) (*Device, error)

New creates a new DC Power Supply IVI Instrument driver. The New function will query the instrument to determine the model and ensure it is one of the supported models. If reset is true, then the instrument is reset.

func (*Device) ChannelCount

func (dev *Device) ChannelCount() int

ChannelCount returns the number of available output channels.

ChannelCount is the getter for the read-only IviDCPwrBase Attribute Output Channel Count described in Section 4.2.7 of IVI-4.4: IviDCPwr Class Specification.

Jump to

Keyboard shortcuts

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