Table of Contents

Class ScpiMultimeter

Namespace
Loehnert.Lisrt.Multimeter.Scpi
Assembly
Loehnert.Lisrt.Multimeter.dll

Represents a ILisrtModule for a multimeter using SCPI commands.

public class ScpiMultimeter : InitializableCompositeModule, ICompositeModule, ILisrtModule, IInitializable, INotifyPropertyChangedEx, INotifyPropertyChanged, IMultimeter, IHasServiceView, IHasDeviceLabel
Inheritance
PropertyChangedBase
ScpiMultimeter
Implements
INotifyPropertyChangedEx
Derived
Inherited Members
PropertyChangedBase.Refresh()
PropertyChangedBase.IsNotifying
PropertyChangedBase.PropertyChanged

Constructors

ScpiMultimeter(string, ICommunication, IEnumerable<IScpiFunction>)

Initializes a new instance of the ScpiMultimeter class.

public ScpiMultimeter(string name, ICommunication communication, IEnumerable<IScpiFunction> functions)

Parameters

name string

Name of the module. See Name.

communication ICommunication

Communication device.

functions IEnumerable<IScpiFunction>

Addition functions, The multimeter contains by default ScpiVoltageDCFunction, ScpiVoltageACFunction, ScpiCurrentDCFunction and ScpiCurrentACFunction.

Exceptions

ArgumentNullException

Thrown when any argument is null.

Properties

Communication

Gets the communication instance.

protected ICommunication Communication { get; }

Property Value

ICommunication

DeviceLabel

Gets or sets the label for the device.

[Configuration("")]
public string DeviceLabel { get; set; }

Property Value

string

Function

Gets the current function.

[AlsoNotifyFor("Ranges")]
public IFunction Function { get; }

Property Value

IFunction

Functions

Gets an enumeration of possible functions.

public IEnumerable<IFunction> Functions { get; }

Property Value

IEnumerable<IFunction>

HardwareIdentification

Gets the identification (*IDN?).

public string HardwareIdentification { get; }

Property Value

string

Icon

Gets a icon which is representative for the module.

public override Uri Icon { get; }

Property Value

Uri

InstanceID

Gets the ID for this instance.

public int InstanceID { get; }

Property Value

int

LastMeasuredValue

Gets the last measured value.

public double LastMeasuredValue { get; }

Property Value

double

Range

Gets the current range.

public IRange Range { get; }

Property Value

IRange

Ranges

Gets an enumeration of possible ranges.

public IEnumerable<IRange> Ranges { get; }

Property Value

IEnumerable<IRange>

Source

Gets the current trigger source.

public ITriggerSource Source { get; }

Property Value

ITriggerSource

Sources

Gets an enumeration of possible trigger sources.

public IEnumerable<ITriggerSource> Sources { get; }

Property Value

IEnumerable<ITriggerSource>

Methods

Initialize()

Initializes the module and resets (*RST) the multimeter.

public override void Initialize()

Measure()

Measures with the current configuration.

public double Measure()

Returns

double

The measured value.

Reset()

Resets the device.

public void Reset()

SetFunction(string)

Configures measurement measure function.

public void SetFunction(string function)

Parameters

function string

A key from Functions.

Exceptions

ArgumentNullException

Thrown when any argument is null.

InvalidOperationException

Thrown when the module is not initialized.

KeyNotFoundException

Throw when the function key isn't found.

SetRange(object)

Sets the range.

public void SetRange(object range)

Parameters

range object

A range as floating point value (e.g. 10.0 means from -10.0V to +10.0V), or a string representing a range: "AUTO", "MIN" or "MAX.

Remarks

If range is a floating point value, the best range must be selected, e.g. 6.8 selects the 10V range.

Exceptions

ArgumentNullException

Thrown when any argument is null.

InvalidOperationException

Thrown when the module is not initialized or no function is selected.

KeyNotFoundException

Thrown when range is string, whose key is not Ranges.

NotSupportedException

Thrown when range is a number, but the current function doesn't support a value range.

SetTrigger(string)

Sets the trigger.

public void SetTrigger(string source)

Parameters

source string

Trigger source name, possible values are bus immediate and external.

Exceptions

ArgumentException

Thrown when the source is null or white space.

InvalidOperationException

Thrown when the module is not initialized.

KeyNotFoundException

Thrown when the source key isn't a valid key for a source.

ShowServiceView()

Shows the service window.

public void ShowServiceView()