diff --git a/csharp/Lib/Devices/Trumpf/TruConvertAc/AcEnums.cs b/csharp/Lib/Devices/Trumpf/TruConvertAc/AcEnums.cs deleted file mode 100644 index 52814684b..000000000 --- a/csharp/Lib/Devices/Trumpf/TruConvertAc/AcEnums.cs +++ /dev/null @@ -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 -} \ No newline at end of file diff --git a/csharp/Lib/Devices/Trumpf/TruConvertAc/Enums/AcDcDistributionMode.cs b/csharp/Lib/Devices/Trumpf/TruConvertAc/Enums/AcDcDistributionMode.cs new file mode 100644 index 000000000..80f6f625c --- /dev/null +++ b/csharp/Lib/Devices/Trumpf/TruConvertAc/Enums/AcDcDistributionMode.cs @@ -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 +} \ No newline at end of file diff --git a/csharp/Lib/Devices/Trumpf/TruConvertAc/Enums/AcDcGridType.cs b/csharp/Lib/Devices/Trumpf/TruConvertAc/Enums/AcDcGridType.cs new file mode 100644 index 000000000..cbb766adf --- /dev/null +++ b/csharp/Lib/Devices/Trumpf/TruConvertAc/Enums/AcDcGridType.cs @@ -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 +} \ No newline at end of file diff --git a/csharp/Lib/Devices/Trumpf/TruConvertAc/Enums/AcErrorPolicy.cs b/csharp/Lib/Devices/Trumpf/TruConvertAc/Enums/AcErrorPolicy.cs new file mode 100644 index 000000000..8dd96d128 --- /dev/null +++ b/csharp/Lib/Devices/Trumpf/TruConvertAc/Enums/AcErrorPolicy.cs @@ -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.) +} \ No newline at end of file diff --git a/csharp/Lib/Devices/Trumpf/TruConvertAc/Enums/DcStageConfiguration.cs b/csharp/Lib/Devices/Trumpf/TruConvertAc/Enums/DcStageConfiguration.cs new file mode 100644 index 000000000..32ee16596 --- /dev/null +++ b/csharp/Lib/Devices/Trumpf/TruConvertAc/Enums/DcStageConfiguration.cs @@ -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. +} \ No newline at end of file diff --git a/csharp/Lib/Devices/Trumpf/TruConvertAc/Enums/PowerFactorConvention.cs b/csharp/Lib/Devices/Trumpf/TruConvertAc/Enums/PowerFactorConvention.cs new file mode 100644 index 000000000..cfdaec558 --- /dev/null +++ b/csharp/Lib/Devices/Trumpf/TruConvertAc/Enums/PowerFactorConvention.cs @@ -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 +} \ No newline at end of file diff --git a/csharp/Lib/Devices/Trumpf/TruConvertAc/Enums/PreChargeDcLinkConfig.cs b/csharp/Lib/Devices/Trumpf/TruConvertAc/Enums/PreChargeDcLinkConfig.cs new file mode 100644 index 000000000..206c656fd --- /dev/null +++ b/csharp/Lib/Devices/Trumpf/TruConvertAc/Enums/PreChargeDcLinkConfig.cs @@ -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 +} \ No newline at end of file diff --git a/csharp/Lib/Devices/Trumpf/TruConvertAc/Enums/SubSlavesErrorPolicy.cs b/csharp/Lib/Devices/Trumpf/TruConvertAc/Enums/SubSlavesErrorPolicy.cs new file mode 100644 index 000000000..190072c0c --- /dev/null +++ b/csharp/Lib/Devices/Trumpf/TruConvertAc/Enums/SubSlavesErrorPolicy.cs @@ -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. +} \ No newline at end of file diff --git a/csharp/Lib/Devices/Trumpf/TruConvertAc/Enums/SymmetricAcOperationMode.cs b/csharp/Lib/Devices/Trumpf/TruConvertAc/Enums/SymmetricAcOperationMode.cs new file mode 100644 index 000000000..df9d01eca --- /dev/null +++ b/csharp/Lib/Devices/Trumpf/TruConvertAc/Enums/SymmetricAcOperationMode.cs @@ -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, +} \ No newline at end of file diff --git a/csharp/Lib/Devices/Trumpf/TruConvertAc/TruConvertAc.csproj b/csharp/Lib/Devices/Trumpf/TruConvertAc/TruConvertAc.csproj index 3a70b12a0..36322cc01 100644 --- a/csharp/Lib/Devices/Trumpf/TruConvertAc/TruConvertAc.csproj +++ b/csharp/Lib/Devices/Trumpf/TruConvertAc/TruConvertAc.csproj @@ -1,8 +1,6 @@ - - diff --git a/csharp/Lib/Devices/Trumpf/TruConvertAc/TruConvertAcControl.cs b/csharp/Lib/Devices/Trumpf/TruConvertAc/TruConvertAcControl.cs index 74fb87c3a..9844f5f5b 100644 --- a/csharp/Lib/Devices/Trumpf/TruConvertAc/TruConvertAcControl.cs +++ b/csharp/Lib/Devices/Trumpf/TruConvertAc/TruConvertAcControl.cs @@ -1,4 +1,5 @@ using InnovEnergy.Lib.Devices.Trumpf.TruConvert; +using InnovEnergy.Lib.Devices.Trumpf.TruConvertAc.Enums; namespace InnovEnergy.Lib.Devices.Trumpf.TruConvertAc; diff --git a/csharp/Lib/Devices/Trumpf/TruConvertAc/TruConvertAcDevice.cs b/csharp/Lib/Devices/Trumpf/TruConvertAc/TruConvertAcDevice.cs index 07b0dc71d..f964f0441 100644 --- a/csharp/Lib/Devices/Trumpf/TruConvertAc/TruConvertAcDevice.cs +++ b/csharp/Lib/Devices/Trumpf/TruConvertAc/TruConvertAcDevice.cs @@ -1,5 +1,6 @@ using System.Diagnostics.CodeAnalysis; using InnovEnergy.Lib.Devices.Trumpf.TruConvert; +using InnovEnergy.Lib.Devices.Trumpf.TruConvertAc.Enums; using InnovEnergy.Lib.Protocols.Modbus.Clients; using InnovEnergy.Lib.Protocols.Modbus.Connections; using InnovEnergy.Lib.Units.Composite; @@ -139,22 +140,22 @@ public class TruConvertAcDevice var acSetValues = ModbusTcpClient.ReadInputRegisters(4196, 1); var warnings = Enumerable - .Range(2404, 20) - .Select(n => acWarningValues.GetUInt16((UInt16)n).ConvertTo()) - .ToArray(); + .Range(2404, 20) + .Select(n => acWarningValues.GetUInt16((UInt16)n).ConvertTo()) + .ToArray(); var alarms = Enumerable - .Range(2811, 20) - .Select(n => acAlarmValues.GetUInt16((UInt16)n).ConvertTo()) - .Where(m => m != AlarmMessage.NoAlarm) - .ToArray(); + .Range(2811, 20) + .Select(n => acAlarmValues.GetUInt16((UInt16)n).ConvertTo()) + .Where(m => m != AlarmMessage.NoAlarm) + .ToArray(); var dcPower = acActualMeasurement.GetInt16(5141) * 1m + acActualMeasurement.GetInt16(5142) * 1m + acActualMeasurement.GetInt16(5143) * 1m; var dcVoltage = acActualMeasurement8.GetUInt16(5214) + acActualMeasurement8.GetUInt16(5213); var dcCurrent = dcVoltage != 0m - ? dcPower / dcVoltage - : 0m; + ? dcPower / dcVoltage + : 0m; // //acActualMeasurement diff --git a/csharp/Lib/Devices/Trumpf/TruConvertAc/TruConvertAcStatus.cs b/csharp/Lib/Devices/Trumpf/TruConvertAc/TruConvertAcStatus.cs index cb76c5b00..b605d9ecc 100644 --- a/csharp/Lib/Devices/Trumpf/TruConvertAc/TruConvertAcStatus.cs +++ b/csharp/Lib/Devices/Trumpf/TruConvertAc/TruConvertAcStatus.cs @@ -1,4 +1,5 @@ using InnovEnergy.Lib.Devices.Trumpf.TruConvert; +using InnovEnergy.Lib.Devices.Trumpf.TruConvertAc.Enums; using InnovEnergy.Lib.StatusApi; using InnovEnergy.Lib.Units;