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
-
PropertyChangedBaseScpiMultimeter
- Implements
-
INotifyPropertyChangedEx
- Derived
- Inherited Members
-
PropertyChangedBase.Refresh()PropertyChangedBase.IsNotifyingPropertyChangedBase.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
stringName of the module. See Name.
communication
ICommunicationCommunication 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
DeviceLabel
Gets or sets the label for the device.
[Configuration("")]
public string DeviceLabel { get; set; }
Property Value
Function
Gets the current function.
[AlsoNotifyFor("Ranges")]
public IFunction Function { get; }
Property Value
Functions
Gets an enumeration of possible functions.
public IEnumerable<IFunction> Functions { get; }
Property Value
HardwareIdentification
Gets the identification (*IDN?).
public string HardwareIdentification { get; }
Property Value
Icon
Gets a icon which is representative for the module.
public override Uri Icon { get; }
Property Value
InstanceID
Gets the ID for this instance.
public int InstanceID { get; }
Property Value
LastMeasuredValue
Gets the last measured value.
public double LastMeasuredValue { get; }
Property Value
Range
Gets the current range.
public IRange Range { get; }
Property Value
Ranges
Gets an enumeration of possible ranges.
public IEnumerable<IRange> Ranges { get; }
Property Value
Source
Gets the current trigger source.
public ITriggerSource Source { get; }
Property Value
Sources
Gets an enumeration of possible trigger sources.
public IEnumerable<ITriggerSource> Sources { get; }
Property Value
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
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
objectA 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
stringTrigger 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()