Table of Contents

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
PropertyChangedBase
AnalogControlledPowerSupplyModule
Implements
INotifyPropertyChangedEx
Inherited Members
PropertyChangedBase.Refresh()
PropertyChangedBase.IsNotifying
PropertyChangedBase.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 string

Name of the module.

analogVoltageOutput IAnalogOutput

Optional analog output, which is connected to the power supply to control the voltage.

analogCurrentOutput IAnalogOutput

Optional 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

double

InitializationState

Gets the initialization state.

public InitializationState InitializationState { get; }

Property Value

InitializationState

SubModules

Gets the sub modules.

public ILisrtModuleCollection SubModules { get; }

Property Value

ILisrtModuleCollection

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

double

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 double

Current 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 bool

State 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 double

Voltage 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

voltage double

Voltage in Volt to regulate.

current double

Current in Ampere to regulate.

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 or current is greater than MaximumCurrent.