Class AnalogControlledPowerSupplyModule
- Namespace
- Loehnert.Lisrt.PowerSupply
- Assembly
- Loehnert.Lisrt.PowerSupply.dll
Represents an analog controlled power supply.
public class AnalogControlledPowerSupplyModule : PowerSupplyModuleBase, IHasDeviceLabel, IHasServiceView, IPowerSupply, ICompositeModule, ILisrtModule, IInitializable, INotifyPropertyChangedEx, INotifyPropertyChanged
- Inheritance
-
PropertyChangedBaseAnalogControlledPowerSupplyModule
- Implements
-
INotifyPropertyChangedEx
- Inherited Members
-
PropertyChangedBase.Refresh()PropertyChangedBase.IsNotifyingPropertyChangedBase.PropertyChanged
Examples
This example creates an analog controlled power supply, that supports only voltage control.
var voltageControlOutput = ...;
var powerSupply = new AnalogControlledPowerSupplyModule(
name: "PowerSupply",
analogVoltageOutput: voltageControlOutput,
analogCurrentOutput: null);
// When the voltageControlOutput implements ILisrtModule, you should add it to the SubModules,
// for example to access the adjustment via the service view.
powerSupply.SubModules.Add(voltageControlOutput);
Remarks
The adjustment is made via the analog outputs, Adjustment.
Constructors
AnalogControlledPowerSupplyModule(string, IAnalogOutput, IAnalogOutput)
Initializes a new instance of the AnalogControlledPowerSupplyModule class.
public AnalogControlledPowerSupplyModule(string name, IAnalogOutput analogVoltageOutput, IAnalogOutput analogCurrentOutput)
Parameters
name
stringName of the module.
analogVoltageOutput
IAnalogOutputOptional analog output, which is connected to the power supply to control the voltage.
analogCurrentOutput
IAnalogOutputOptional analog output, which is connected to the power supply to control the current.
Exceptions
- ArgumentNullException
Thrown when
name
is null.
Properties
CurrentScalingFactor
Gets or sets the factor with which the current input is scaled.
[Configuration(1, Description = "The factor with which the current input is scaled.")]
public double CurrentScalingFactor { get; set; }
Property Value
InitializationState
Gets the initialization state.
public InitializationState InitializationState { get; }
Property Value
SubModules
Gets the sub modules.
public ILisrtModuleCollection SubModules { get; }
Property Value
VoltageScalingFactor
Gets or sets the factor with which the voltage input is scaled.
[Configuration(1, Description = "The factor with which the voltage input is scaled.")]
public double VoltageScalingFactor { get; set; }
Property Value
Examples
Power supply output voltage is 24V at 10V input voltage, the factor is 2.4.
Methods
Exit()
De initializes the module.
public void Exit()
Initialize()
Initializes the module.
public void Initialize()
Exceptions
- InvalidOperationException
Thrown when any IInitializable analog output is not Initialized.
SetCurrent(double)
Sets the current.
public override void SetCurrent(double current)
Parameters
current
doubleCurrent in Ampere to regulate.
Exceptions
- NotInitializedException
Thrown when the module is not initialized.
- ArgumentOutOfRangeException
Thrown when
current
is greater than MaximumCurrent.- NotSupportedException
Thrown when no IAnalogOutput for current is set.
SetOutput(bool)
Enables or disables the output.
public override void SetOutput(bool isEnabled)
Parameters
isEnabled
boolState for the output.
Exceptions
- NotInitializedException
Thrown when the module is not initialized.
SetVoltage(double)
Sets the voltage.
public override void SetVoltage(double voltage)
Parameters
voltage
doubleVoltage in Volt to regulate.
Exceptions
- NotInitializedException
Thrown when the module is not initialized.
- ArgumentOutOfRangeException
Thrown when
voltage
is greater than MaximumVoltage.- NotSupportedException
Thrown when no IAnalogOutput for voltage is set.
SetVoltageAndCurrent(double, double)
Sets the voltage, current and enables the output.
public override void SetVoltageAndCurrent(double voltage, double current)
Parameters
Exceptions
- NotSupportedException
Thrown when no IAnalogOutput for voltage or current is set.
- NotInitializedException
Thrown when the module is not initialized.
- ArgumentOutOfRangeException
Thrown when
voltage
is greater than MaximumVoltage orcurrent
is greater than MaximumCurrent.