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