using System.Diagnostics.CodeAnalysis; using InnovEnergy.Lib.Protocols.Modbus.Reflection.Attributes; using InnovEnergy.Lib.Units; using InnovEnergy.Lib.Units.Power; namespace InnovEnergy.Lib.Devices.Kaco92L3; [AddressOffset(-1)] public partial class KacoRecord { /****************************** Holding registers – SunSpec Model 64201 ****************************/ // Model 64201 header [HoldingRegister(41061)] private UInt16 _model64201Id; // 0xA065 (DID = 64201) [HoldingRegister(41062)] private UInt16 _model64201Length; // 0xA066 (L = 52) // Version info [HoldingRegister(41063)] private UInt16 _version; // 0xA067 [HoldingRegister(41064)] private UInt16 _versionMinor; // 0xA068 // State control [HoldingRegister(41065, writable: true)] private UInt16 _requestedState; // 0xA069 – RequestedState (enum16, RW) [HoldingRegister(41066)] private UInt16 _currentState; // 0xA06A – CurrentState (enum16, R) [HoldingRegister(41067, writable: true)] private UInt16 _controlMode; // 0xA06B – ControlMode (enum16, RW) [HoldingRegister(41068)] private UInt16 _reserved7; // 0xA06C – Reserved // Watchdog / setpoints //Enable Watchdog countdown. Register must be filled with the desired watchdog timeout in seconds. 0 means watchdog is disabled. It is recommended to re-write the register at least 10 seconds before the timeout is activated. [HoldingRegister(41069, writable: true)] private UInt16 _watchdog; // 0xA06D – Watchdog (uint16, RW, seconds) 0 to 600 [HoldingRegister (41070, writable: true)] private Int16 _wSetPct; // 0xA06E – WSetPct (int16, RW, %WMax) unscaled: -100 to 100. Set power output to specified level. [HoldingRegister (41071, writable: true)] private Int16 _varWMaxSetPct; // 0xA06F – VarWMaxSetPct (int16, RW, %SMax) unscaled: -100 to 100 // Reserved padding [HoldingRegister(41072)] private UInt16 _reserved11; // 0xA070 [HoldingRegister(41073)] private UInt16 _reserved12; // 0xA071 [HoldingRegister(41074)] private UInt16 _reserved13; // 0xA072 [HoldingRegister(41075)] private UInt16 _reserved14; // 0xA073 [HoldingRegister(41076)] private UInt16 _reserved15; // 0xA074 [HoldingRegister(41077)] private UInt16 _reserved16; // 0xA075 // Status / error [HoldingRegister(41078)] private UInt16 _stVnd; // 0xA076 – StVnd (enum16, R) PrologState [HoldingRegister(41079)] private UInt16 _stPu; // 0xA077 – StPu (enum16, R) Power Unit State (DSP) [HoldingRegister(41080)] private UInt16 _stPcu; // 0xA078 – StPcu (enum16, R) pcu state [HoldingRegister(41081)] private UInt16 _errPcu; // 0xA079 – ErrPcu (enum16, R) pcu error // Active power ramp parameters [HoldingRegister(41082, writable: true)] private UInt16 _wParamRmpTms; // 0xA07A – WParamRmpTms (uint16, RW, s) [HoldingRegister(41083, writable: true)] private UInt16 _wParamRmpDecTmn; // 0xA07B – WParamRmpDecTmn (uint16, RW, %ref/min) [HoldingRegister(41084, writable: true)] private UInt16 _wParamRmpIncTmn; // 0xA07C – WParamRmpIncTmn (uint16, RW, %ref/min) [HoldingRegister(41085)] private UInt16 _reserved24; // 0xA07D – Reserved [HoldingRegister(41086)] private UInt16 _reserved25; // 0xA07E – Reserved [HoldingRegister(41087, writable: true)] private UInt16 _wParamEna; // 0xA07F – WParam_Ena (enum16, RW) WSet_Ena control 0 or 1 // Reactive power ramp parameters [HoldingRegister(41088, writable: true)] private UInt16 _varParamRmpTms; // 0xA080 – VarParamRmpTms (uint16, RW, s) [HoldingRegister(41089, writable: true)] private UInt16 _varParamRmpDecTmn; // 0xA081 – VarParamRmpDecTmn (uint16, RW, %ref/min) [HoldingRegister(41090, writable: true)] private UInt16 _varParamRmpIncTmn; // 0xA082 – VarParamRmpIncTmn (uint16, RW, %ref/min) [HoldingRegister(41091)] private UInt16 _reserved30; // 0xA083 – Reserved [HoldingRegister(41092)] private UInt16 _reserved31; // 0xA084 – Reserved [HoldingRegister(41093, writable: true)] private UInt16 _varParamEna; // 0xA085 – VarParam_Ena (enum16, RW) Enumerated valued. Percent limit VAr enable/disable control. // Measurements (read-only) [HoldingRegister(41094)] private UInt16 _phaseVoltageAN; // 0xA086 – PhVphA (uint16, R, V, V_SF) [HoldingRegister(41095)] private UInt16 _phaseVoltageBN; // 0xA087 – PhVphB (uint16, R, V, V_SF) [HoldingRegister(41096)] private UInt16 _phaseVoltageCN; // 0xA088 – PhVphC (uint16, R, V, V_SF) [HoldingRegister (41097)] private Int16 _activePowerW; // 0xA089 – W (int16, R, W, W_SF) [HoldingRegister (41098)] private Int16 _reactivePowerVar; // 0xA08A – VAR (int16, R, var, Var_SF) [HoldingRegister (41099)] private Int16 _lineFrequencyHz; // 0xA08B – Hz (int16, R, Hz, Hz_SF) // Scale factors (SunSpec sunsf) // Scale factor for active power percent. [HoldingRegister(41107)] private Int16 _wSetPctSf; // 0xA0F3 – WSetPct_SF // Scale factor for reactive power percent. [HoldingRegister(41108)] private Int16 _varSetPctSf; // 0xA0F4 – VarSetPct_SF // Scale factor for PT1 (ramp time). [HoldingRegister(41109)] private Int16 _rmpTmsSf; // 0xA0F5 – RmpTms_SF // Scale factor for increment and decrement ramps. [HoldingRegister(41110)] private Int16 _rmpIncDecSf; // 0xA0F6 – RmpIncDec_SF // Header [HoldingRegister(41115)] private UInt16 _battCharId; // ID = 64202 [HoldingRegister(41116)] private UInt16 _battCharLength; // L = 6 + (RBCount * 8) // Fixed block [HoldingRegister(41117)] private UInt16 _battCharVersion; // Version (uint16, R) [HoldingRegister(41118)] private UInt16 _battCharVerMinor; // VerMinor (uint16, R) [HoldingRegister(41119)] private UInt16 _battCharRsrvd1; // Rsrvd_1 (pad) [HoldingRegister(41120)] private UInt16 _battCharRsrvd2; // Rsrvd_2 (pad) [HoldingRegister (41121)] private Int16 _battCharVSf; // V_SF (sunsf, R) [HoldingRegister (41122)] private Int16 _battCharASf; // A_SF (sunsf, R) // Repeating block #0 (you said there is only one block) [HoldingRegister(41123, writable: true)] private UInt16 _disMinVRaw; // DisMinV (uint16, V, V_SF, RW) min. discharge voltage [HoldingRegister(41124, writable: true)] private UInt16 _disMaxARaw; // DisMaxA (uint16, A, A_SF, RW)max. discharge current [HoldingRegister(41125, writable: true)] private UInt16 _disCutoffARaw; // DisCutoffA (uint16, A, A_SF, RW)Disconnect if discharge current lower than DisCutoffA [HoldingRegister(41126, writable: true)] private UInt16 _chaMaxVRaw; // ChaMaxV (uint16, V, V_SF, RW)max. charge voltage [HoldingRegister(41127, writable: true)] private UInt16 _chaMaxARaw; // ChaMaxA (uint16, A, A_SF, RW)max. charge current [HoldingRegister(41128, writable: true)] private UInt16 _chaCutoffARaw; // ChaCutoffA (uint16, A, A_SF, RW)Disconnect if charge current lower than ChaCuttoffA [HoldingRegister(41129)] private UInt16 _battCharPad; // Pad (pad, R) [HoldingRegister(41130, writable: true)] private UInt16 _enLimitRaw; // EnLimit (uint16, RW)new battery limits are activated when EnLimit is 1 }