using InnovEnergy.Lib.Protocols.Modbus.Reflection.Attributes; using InnovEnergy.Lib.StatusApi.DeviceTypes; using InnovEnergy.Lib.Units.Composite; // ReSharper disable InconsistentNaming namespace InnovEnergy.Lib.Devices.PLVario2Meter; using Float32 = Single; // If your project already defines Float32 as an alias/struct, keep that. // Otherwise, you can just use float. Here we use float for simplicity. public class PlVarioMeterRegisters : IAc3Meter { // ------------------------------------------------------------------------- // Timestamp (UINT32) -> 2 x UInt16 // Offset 0: Timestamp [s] // ------------------------------------------------------------------------- [HoldingRegister(1000, writable: false)] public UInt16 Timestamp_W0; // low word [HoldingRegister(1001, writable: false)] public UInt16 Timestamp_W1; // high word // ------------------------------------------------------------------------- // Voltages phase-neutral (FLOAT32) -> 2 x UInt16 each // Offsets 2,4,6 // ------------------------------------------------------------------------- [HoldingRegister(1002, writable: false)] public UInt16 VoltageU1_W0; [HoldingRegister(1003, writable: false)] public UInt16 VoltageU1_W1; [HoldingRegister(1004, writable: false)] public UInt16 VoltageU2_W0; [HoldingRegister(1005, writable: false)] public UInt16 VoltageU2_W1; [HoldingRegister(1006, writable: false)] public UInt16 VoltageU3_W0; [HoldingRegister(1007, writable: false)] public UInt16 VoltageU3_W1; // ------------------------------------------------------------------------- // Voltages line-line (FLOAT32) -> 2 x UInt16 each // Offsets 8,10,12 // ------------------------------------------------------------------------- [HoldingRegister(1008, writable: false)] public UInt16 VoltageUL1_W0; [HoldingRegister(1009, writable: false)] public UInt16 VoltageUL1_W1; [HoldingRegister(1010, writable: false)] public UInt16 VoltageUL2_W0; [HoldingRegister(1011, writable: false)] public UInt16 VoltageUL2_W1; [HoldingRegister(1012, writable: false)] public UInt16 VoltageUL3_W0; [HoldingRegister(1013, writable: false)] public UInt16 VoltageUL3_W1; // ------------------------------------------------------------------------- // Frequency (FLOAT32) -> 2 x UInt16 // Offset 14 // ------------------------------------------------------------------------- [HoldingRegister(1014, writable: false)] public UInt16 Frequency_W0; [HoldingRegister(1015, writable: false)] public UInt16 Frequency_W1; // ------------------------------------------------------------------------- // Currents (FLOAT32) -> 2 x UInt16 each // Offsets 16..24 // ------------------------------------------------------------------------- [HoldingRegister(1016, writable: false)] public UInt16 CurrentI1_W0; [HoldingRegister(1017, writable: false)] public UInt16 CurrentI1_W1; [HoldingRegister(1018, writable: false)] public UInt16 CurrentI2_W0; [HoldingRegister(1019, writable: false)] public UInt16 CurrentI2_W1; [HoldingRegister(1020, writable: false)] public UInt16 CurrentI3_W0; [HoldingRegister(1021, writable: false)] public UInt16 CurrentI3_W1; [HoldingRegister(1022, writable: false)] public UInt16 CurrentI4_W0; [HoldingRegister(1023, writable: false)] public UInt16 CurrentI4_W1; [HoldingRegister(1024, writable: false)] public UInt16 CurrentTotal_W0; [HoldingRegister(1025, writable: false)] public UInt16 CurrentTotal_W1; // ------------------------------------------------------------------------- // Active power P (FLOAT32, kW) -> 2 x UInt16 each // Offsets 26..34 // ------------------------------------------------------------------------- [HoldingRegister(1026, writable: false)] public UInt16 ActivePowerP1_W0; [HoldingRegister(1027, writable: false)] public UInt16 ActivePowerP1_W1; [HoldingRegister(1028, writable: false)] public UInt16 ActivePowerP2_W0; [HoldingRegister(1029, writable: false)] public UInt16 ActivePowerP2_W1; [HoldingRegister(1030, writable: false)] public UInt16 ActivePowerP3_W0; [HoldingRegister(1031, writable: false)] public UInt16 ActivePowerP3_W1; [HoldingRegister(1032, writable: false)] public UInt16 ActivePowerP4_W0; [HoldingRegister(1033, writable: false)] public UInt16 ActivePowerP4_W1; [HoldingRegister(1034, writable: false)] public UInt16 ActivePowerTotal_W0; [HoldingRegister(1035, writable: false)] public UInt16 ActivePowerTotal_W1; // ------------------------------------------------------------------------- // Reactive power Q (FLOAT32, kVAr) -> 2 x UInt16 each // Offsets 36..44 // ------------------------------------------------------------------------- [HoldingRegister(1036, writable: false)] public UInt16 ReactivePowerQ1_W0; [HoldingRegister(1037, writable: false)] public UInt16 ReactivePowerQ1_W1; [HoldingRegister(1038, writable: false)] public UInt16 ReactivePowerQ2_W0; [HoldingRegister(1039, writable: false)] public UInt16 ReactivePowerQ2_W1; [HoldingRegister(1040, writable: false)] public UInt16 ReactivePowerQ3_W0; [HoldingRegister(1041, writable: false)] public UInt16 ReactivePowerQ3_W1; [HoldingRegister(1042, writable: false)] public UInt16 ReactivePowerQ4_W0; [HoldingRegister(1043, writable: false)] public UInt16 ReactivePowerQ4_W1; [HoldingRegister(1044, writable: false)] public UInt16 ReactivePowerTotal_W0; [HoldingRegister(1045, writable: false)] public UInt16 ReactivePowerTotal_W1; // ------------------------------------------------------------------------- // Apparent power S (FLOAT32, kVA) -> 2 x UInt16 each // Offsets 46..54 // ------------------------------------------------------------------------- [HoldingRegister(1046, writable: false)] public UInt16 ApparentPowerS1_W0; [HoldingRegister(1047, writable: false)] public UInt16 ApparentPowerS1_W1; [HoldingRegister(1048, writable: false)] public UInt16 ApparentPowerS2_W0; [HoldingRegister(1049, writable: false)] public UInt16 ApparentPowerS2_W1; [HoldingRegister(1050, writable: false)] public UInt16 ApparentPowerS3_W0; [HoldingRegister(1051, writable: false)] public UInt16 ApparentPowerS3_W1; [HoldingRegister(1052, writable: false)] public UInt16 ApparentPowerS4_W0; [HoldingRegister(1053, writable: false)] public UInt16 ApparentPowerS4_W1; [HoldingRegister(1054, writable: false)] public UInt16 ApparentPowerTotal_W0; [HoldingRegister(1055, writable: false)] public UInt16 ApparentPowerTotal_W1; // ------------------------------------------------------------------------- // Power factor PF (FLOAT32) -> 2 x UInt16 each // Offsets 56..64 // ------------------------------------------------------------------------- [HoldingRegister(1056, writable: false)] public UInt16 PowerFactorPF1_W0; [HoldingRegister(1057, writable: false)] public UInt16 PowerFactorPF1_W1; [HoldingRegister(1058, writable: false)] public UInt16 PowerFactorPF2_W0; [HoldingRegister(1059, writable: false)] public UInt16 PowerFactorPF2_W1; [HoldingRegister(1060, writable: false)] public UInt16 PowerFactorPF3_W0; [HoldingRegister(1061, writable: false)] public UInt16 PowerFactorPF3_W1; [HoldingRegister(1062, writable: false)] public UInt16 PowerFactorPF4_W0; [HoldingRegister(1063, writable: false)] public UInt16 PowerFactorPF4_W1; [HoldingRegister(1064, writable: false)] public UInt16 PowerFactorTotal_W0; [HoldingRegister(1065, writable: false)] public UInt16 PowerFactorTotal_W1; // ------------------------------------------------------------------------- // Repeated totals (as shown in the table) at offsets 66..74 // ------------------------------------------------------------------------- [HoldingRegister(1066, writable: false)] public UInt16 CurrentTotalRepeat_W0; [HoldingRegister(1067, writable: false)] public UInt16 CurrentTotalRepeat_W1; [HoldingRegister(1068, writable: false)] public UInt16 ActivePowerTotalRepeat_W0; [HoldingRegister(1069, writable: false)] public UInt16 ActivePowerTotalRepeat_W1; [HoldingRegister(1070, writable: false)] public UInt16 ReactivePowerTotalRepeat_W0; [HoldingRegister(1071, writable: false)] public UInt16 ReactivePowerTotalRepeat_W1; [HoldingRegister(1072, writable: false)] public UInt16 ApparentPowerTotalRepeat_W0; [HoldingRegister(1073, writable: false)] public UInt16 ApparentPowerTotalRepeat_W1; [HoldingRegister(1074, writable: false)] public UInt16 PowerFactorTotalRepeat_W0; [HoldingRegister(1075, writable: false)] public UInt16 PowerFactorTotalRepeat_W1; public Ac3Bus Ac { get; } }