move TruConvertAc enums into files
This commit is contained in:
parent
e8ad29c64f
commit
1196aeeb8b
|
@ -1,58 +0,0 @@
|
||||||
namespace InnovEnergy.Lib.Devices.Trumpf.TruConvertAc;
|
|
||||||
|
|
||||||
public enum AcDcGridType : UInt16
|
|
||||||
{
|
|
||||||
GridTied400V50Hz = 0, // grid-tied, 400V, 50Hz
|
|
||||||
GridTied480V60Hz = 1, // grid-tied, 480V, 60Hz
|
|
||||||
Island400V50Hz = 2, // island mode, 400V, 50Hz
|
|
||||||
Island480V60Hz = 3, // island mode, 480V, 60Hz
|
|
||||||
GridTied380V60Hz = 4, // grid-tied, 380V, 60Hz
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum PreChargeDcLinkConfig : UInt16
|
|
||||||
{
|
|
||||||
External = 0, // device waits for external precharge of DC link
|
|
||||||
Internal = 1, // device precharges external DC link to necessary start-up voltage
|
|
||||||
InternalWithDc = 2, // behaviour similar to 1 with additional support of DC submodules (necessary for island operation)
|
|
||||||
InternalWithWait = 3 // device precharges external DC link to necessary start-up voltage and waits until PrechargeDcLinkConfig gets set back to 1 or 2
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum AcErrorPolicy : UInt16
|
|
||||||
{
|
|
||||||
Relaxed = 0, // 0 = relaxed (System keeps running even if some slaves are in error state.)
|
|
||||||
Strict = 1, // 1 = strict (System shuts down as soon as one component is in error state.)
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum SymmetricAcOperationMode : UInt16
|
|
||||||
{
|
|
||||||
//Configuration AC set values for phases L1 - L3
|
|
||||||
Asymmetric = 0,
|
|
||||||
Symmetric = 1,
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum PowerFactorConvention : UInt16
|
|
||||||
{
|
|
||||||
Producer = 0, // 0 = producer reference frame
|
|
||||||
Consumer = 1, // 1 = consumer reference frame
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum SubSlavesErrorPolicy : UInt16
|
|
||||||
{
|
|
||||||
Strict = 0, // (AC-DC module switches to error state if at least one submodules is in error state
|
|
||||||
Relaxed = 1, // (AC-DC module switches to error state if all submodules are in error state.)
|
|
||||||
Off = 2, // (If possible AC-DC module continues operation even if all submodules are in error state.
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum DcStageConfiguration : UInt16
|
|
||||||
{
|
|
||||||
Off = 0, // DC module is off, power electronic circuit is deactivated, battery voltage can be measured.
|
|
||||||
Active = 1, // DC module is active and the power distribution according to parameters 4303 is active.
|
|
||||||
ActiveIndependent = 2, // DC module is active and operates independent from the AC module. The battery current set point from register 4500 is getting applied.
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum AcDcDistributionMode : UInt16
|
|
||||||
{
|
|
||||||
Power = 0, // power distribution
|
|
||||||
Current = 1, // current distribution
|
|
||||||
Auto = 2, // auto
|
|
||||||
}
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
namespace InnovEnergy.Lib.Devices.Trumpf.TruConvertAc.Enums;
|
||||||
|
|
||||||
|
public enum AcDcDistributionMode : UInt16
|
||||||
|
{
|
||||||
|
Power = 0, // power distribution
|
||||||
|
Current = 1, // current distribution
|
||||||
|
Auto = 2, // auto
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
namespace InnovEnergy.Lib.Devices.Trumpf.TruConvertAc.Enums;
|
||||||
|
|
||||||
|
public enum AcDcGridType : UInt16
|
||||||
|
{
|
||||||
|
GridTied400V50Hz = 0, // grid-tied, 400V, 50Hz
|
||||||
|
GridTied480V60Hz = 1, // grid-tied, 480V, 60Hz
|
||||||
|
Island400V50Hz = 2, // island mode, 400V, 50Hz
|
||||||
|
Island480V60Hz = 3, // island mode, 480V, 60Hz
|
||||||
|
GridTied380V60Hz = 4, // grid-tied, 380V, 60Hz
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
namespace InnovEnergy.Lib.Devices.Trumpf.TruConvertAc.Enums;
|
||||||
|
|
||||||
|
public enum AcErrorPolicy : UInt16
|
||||||
|
{
|
||||||
|
Relaxed = 0, // 0 = relaxed (System keeps running even if some slaves are in error state.)
|
||||||
|
Strict = 1, // 1 = strict (System shuts down as soon as one component is in error state.)
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
namespace InnovEnergy.Lib.Devices.Trumpf.TruConvertAc.Enums;
|
||||||
|
|
||||||
|
public enum DcStageConfiguration : UInt16
|
||||||
|
{
|
||||||
|
Off = 0, // DC module is off, power electronic circuit is deactivated, battery voltage can be measured.
|
||||||
|
Active = 1, // DC module is active and the power distribution according to parameters 4303 is active.
|
||||||
|
ActiveIndependent = 2, // DC module is active and operates independent from the AC module. The battery current set point from register 4500 is getting applied.
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
namespace InnovEnergy.Lib.Devices.Trumpf.TruConvertAc.Enums;
|
||||||
|
|
||||||
|
public enum PowerFactorConvention : UInt16
|
||||||
|
{
|
||||||
|
Producer = 0, // 0 = producer reference frame
|
||||||
|
Consumer = 1, // 1 = consumer reference frame
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
namespace InnovEnergy.Lib.Devices.Trumpf.TruConvertAc.Enums;
|
||||||
|
|
||||||
|
public enum PreChargeDcLinkConfig : UInt16
|
||||||
|
{
|
||||||
|
External = 0, // device waits for external precharge of DC link
|
||||||
|
Internal = 1, // device precharges external DC link to necessary start-up voltage
|
||||||
|
InternalWithDc = 2, // behaviour similar to 1 with additional support of DC submodules (necessary for island operation)
|
||||||
|
InternalWithWait = 3 // device precharges external DC link to necessary start-up voltage and waits until PrechargeDcLinkConfig gets set back to 1 or 2
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
namespace InnovEnergy.Lib.Devices.Trumpf.TruConvertAc.Enums;
|
||||||
|
|
||||||
|
public enum SubSlavesErrorPolicy : UInt16
|
||||||
|
{
|
||||||
|
Strict = 0, // (AC-DC module switches to error state if at least one submodules is in error state
|
||||||
|
Relaxed = 1, // (AC-DC module switches to error state if all submodules are in error state.)
|
||||||
|
Off = 2, // (If possible AC-DC module continues operation even if all submodules are in error state.
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
namespace InnovEnergy.Lib.Devices.Trumpf.TruConvertAc.Enums;
|
||||||
|
|
||||||
|
public enum SymmetricAcOperationMode : UInt16
|
||||||
|
{
|
||||||
|
//Configuration AC set values for phases L1 - L3
|
||||||
|
Asymmetric = 0,
|
||||||
|
Symmetric = 1,
|
||||||
|
}
|
|
@ -1,8 +1,6 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<Import Project="../../../InnovEnergy.Lib.props" />
|
<Import Project="../../../InnovEnergy.Lib.props" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="../../../Protocols/Modbus/Modbus.csproj" />
|
<ProjectReference Include="../../../Protocols/Modbus/Modbus.csproj" />
|
||||||
<ProjectReference Include="../../../StatusApi/StatusApi.csproj" />
|
<ProjectReference Include="../../../StatusApi/StatusApi.csproj" />
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
using InnovEnergy.Lib.Devices.Trumpf.TruConvert;
|
using InnovEnergy.Lib.Devices.Trumpf.TruConvert;
|
||||||
|
using InnovEnergy.Lib.Devices.Trumpf.TruConvertAc.Enums;
|
||||||
|
|
||||||
namespace InnovEnergy.Lib.Devices.Trumpf.TruConvertAc;
|
namespace InnovEnergy.Lib.Devices.Trumpf.TruConvertAc;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using InnovEnergy.Lib.Devices.Trumpf.TruConvert;
|
using InnovEnergy.Lib.Devices.Trumpf.TruConvert;
|
||||||
|
using InnovEnergy.Lib.Devices.Trumpf.TruConvertAc.Enums;
|
||||||
using InnovEnergy.Lib.Protocols.Modbus.Clients;
|
using InnovEnergy.Lib.Protocols.Modbus.Clients;
|
||||||
using InnovEnergy.Lib.Protocols.Modbus.Connections;
|
using InnovEnergy.Lib.Protocols.Modbus.Connections;
|
||||||
using InnovEnergy.Lib.Units.Composite;
|
using InnovEnergy.Lib.Units.Composite;
|
||||||
|
@ -139,22 +140,22 @@ public class TruConvertAcDevice
|
||||||
var acSetValues = ModbusTcpClient.ReadInputRegisters(4196, 1);
|
var acSetValues = ModbusTcpClient.ReadInputRegisters(4196, 1);
|
||||||
|
|
||||||
var warnings = Enumerable
|
var warnings = Enumerable
|
||||||
.Range(2404, 20)
|
.Range(2404, 20)
|
||||||
.Select(n => acWarningValues.GetUInt16((UInt16)n).ConvertTo<WarningMessage>())
|
.Select(n => acWarningValues.GetUInt16((UInt16)n).ConvertTo<WarningMessage>())
|
||||||
.ToArray();
|
.ToArray();
|
||||||
|
|
||||||
var alarms = Enumerable
|
var alarms = Enumerable
|
||||||
.Range(2811, 20)
|
.Range(2811, 20)
|
||||||
.Select(n => acAlarmValues.GetUInt16((UInt16)n).ConvertTo<AlarmMessage>())
|
.Select(n => acAlarmValues.GetUInt16((UInt16)n).ConvertTo<AlarmMessage>())
|
||||||
.Where(m => m != AlarmMessage.NoAlarm)
|
.Where(m => m != AlarmMessage.NoAlarm)
|
||||||
.ToArray();
|
.ToArray();
|
||||||
|
|
||||||
|
|
||||||
var dcPower = acActualMeasurement.GetInt16(5141) * 1m + acActualMeasurement.GetInt16(5142) * 1m + acActualMeasurement.GetInt16(5143) * 1m;
|
var dcPower = acActualMeasurement.GetInt16(5141) * 1m + acActualMeasurement.GetInt16(5142) * 1m + acActualMeasurement.GetInt16(5143) * 1m;
|
||||||
var dcVoltage = acActualMeasurement8.GetUInt16(5214) + acActualMeasurement8.GetUInt16(5213);
|
var dcVoltage = acActualMeasurement8.GetUInt16(5214) + acActualMeasurement8.GetUInt16(5213);
|
||||||
var dcCurrent = dcVoltage != 0m
|
var dcCurrent = dcVoltage != 0m
|
||||||
? dcPower / dcVoltage
|
? dcPower / dcVoltage
|
||||||
: 0m;
|
: 0m;
|
||||||
|
|
||||||
|
|
||||||
// //acActualMeasurement
|
// //acActualMeasurement
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
using InnovEnergy.Lib.Devices.Trumpf.TruConvert;
|
using InnovEnergy.Lib.Devices.Trumpf.TruConvert;
|
||||||
|
using InnovEnergy.Lib.Devices.Trumpf.TruConvertAc.Enums;
|
||||||
using InnovEnergy.Lib.StatusApi;
|
using InnovEnergy.Lib.StatusApi;
|
||||||
using InnovEnergy.Lib.Units;
|
using InnovEnergy.Lib.Units;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue