Added Kaco inverter implementation

- Added Kaco inverter implementation
- Small refactoring
- Added release inverter power signal for simultaneous start of the
  inverters
This commit is contained in:
Matthias Heisig
2025-08-11 23:26:40 +09:00
parent 6f97c1aa6b
commit 9c6e28b83d
20 changed files with 1426 additions and 1665 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,145 @@
<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4026.12">
<DUT Name="ST_SunspecInverterThreePhase" Id="{f9acf95c-14fe-4c1e-9c73-dff4af6d43b5}">
<Declaration><![CDATA[// Sunspec register 40.070 - 40.120 (Size 52)
TYPE ST_SunspecInverterThreePhase :
STRUCT
// Model value
uiID : UINT;
// Model length
uiL : UINT;
// AC current. Sum of active phases
iA : INT;
// AC current. Phase A
iAphA : INT;
// AC current. Phase B
iAphB : INT;
// AC current. Phase C
iAphC : INT;
// AC current scaling factor
iASF : INT;
// Phase voltage AB
uiPPVphAB : UINT;
// Phase voltage BC
uiPPVphBC : UINT;
// Phase voltage CA
uiPPVphCA : UINT;
// Phase voltage AN
uiPhVphA : UINT;
// Phase voltage BN
uiPhVphB : UINT;
// Phase voltage CN
uiPhVphC : UINT;
// Phase voltage scaling factor
iVSF : INT;
// AC Power
iW : INT;
// AC power scaling factor
iWSF : INT;
// Line frequency
uiHz : UINT;
// Line frequency scaling factor
iHzSF : INT;
// AC apparent power
iVA : INT;
// AC apparent power scaling factor
iVASF : INT;
// AC reactive power
iVAr : INT;
// AC reactive power scaling factor
iVArSF : INT;
// AC power factor
iPF : INT;
// AC power factor scaling factor
iPFSF : INT;
// AC Energy
udiWH : UDINT;
// AC Energy scaling factor
iWHSF : INT;
// DC current
uiDCA : UINT;
// DC current scaling factor
iDCASF : INT;
// DC voltage
uiDCV : UINT;
// DC voltage scaling factor
iDCVSF : INT;
// DC power
iDCW : INT;
// DC power scaling factor
iDCWSF : INT;
// Cabinet temperature
iTmpCab : INT;
// Heat sink temperature
iTmpSnk : INT;
// Transformer temperature
iTmpTrns : INT;
// Other temperature
iTmpOt : INT;
// Temperature scaling factor
iTmpSF : INT;
// Operating state
wSt : WORD;
// Vendor specific operating state
wStVnd : WORD;
// Bitmask value. Event fields.
dwEvt1 : DWORD;
// Reserved for future use
dwEvt2 : DWORD;
// Vendor defined events 1
dwEvtVnd1 : DWORD;
// Vendor defined events 2
dwEvtVnd2 : DWORD;
// Vendor defined events 3
dwEvtVnd3 : DWORD;
// Vendor defined events 4
dwEvtVnd4 : DWORD;
END_STRUCT
END_TYPE
]]></Declaration>
</DUT>
</TcPlcObject>

View File

@@ -0,0 +1,95 @@
<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4026.12">
<DUT Name="ST_SunspecNameplateRatings" Id="{d43d4b8b-dd50-4ed8-ac51-53563f3eb7b3}">
<Declaration><![CDATA[// Sunspec register 40.122 - 40.149 (Size 28)
TYPE ST_SunspecNameplateRatings :
STRUCT
// Model value
uiID : UINT;
// Model length
uiL : UINT;
// Type of DER device
wDERTyp : WORD;
// Continuous power output capability of the inverter
uiWRtg : UINT;
// Continuous power output capability of the inverter scaling factor
uiWRtgSF : INT;
// Continuous volt-ampere output capability of the inverter
uiVARtg : UINT;
// Continuous volt-ampere output capability of the inverter scaling factor
uiVARtgSF : INT;
// Continuous VAR capability of the inverter in quadrant 1
iVArRtgQ1 : INT;
// Continuous VAR capability of the inverter in quadrant 2
iVArRtgQ2 : INT;
// Continuous VAR capability of the inverter in quadrant 3
iVArRtgQ3 : INT;
// Continuous VAR capability of the inverter in quadrant 4
iVArRtgQ4 : INT;
// Continuous VAR capability of the inverter in quadrant 1-4 scaling factor
iVArRtgSF : INT;
// Maximum RMS AC current level capability of the inverter
uiARtg : UINT;
// Maximum RMS AC current level capability of the inverter scaling factor
uiARtgSF : INT;
// Minimum power factor capability of the inverter in quadrant 1
iPFRtgQ1 : INT;
// Minimum power factor capability of the inverter in quadrant 2
iPFRtgQ2 : INT;
// Minimum power factor capability of the inverter in quadrant 3
iPFRtgQ3 : INT;
// Minimum power factor capability of the inverter in quadrant 4
iPFRtgQ4 : INT;
// Minimum power factor capability of the inverter in quadrant 1-4 scaling factor
iPFRtgSF : INT;
// Nominal energy rating of storage device
uiWHRtg : UINT;
// Nominal energy rating of storage device scaling factor
uiWHRtgSF : INT;
// The usable capacity of the battery
uiAhrRtg : UINT;
// The usable capacity of the battery scaling factor
uiAhrRtgSF : INT;
// Maximum rate of energy transfer into the storage device
uiMaxChaRte : UINT;
// Maximum rate of energy transfer into the storage device scaling factor
uiMaxChaRteSF : INT;
// Maximum rate of energy transfer out of the storage device
uiMaxDisChaRte : UINT;
// Maximum rate of energy transfer out of the storage device scaling factor
uiMaxDisChaRteSF : INT;
// Padding register
wPad : WORD;
END_STRUCT
END_TYPE
]]></Declaration>
</DUT>
</TcPlcObject>

View File

@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4026.12">
<DUT Name="ST_SUNSPEC_CURRENT_VALUES" Id="{429ce2f6-f580-460c-8eb4-3ddb289effd4}">
<Declaration><![CDATA[TYPE ST_SUNSPEC_CURRENT_VALUES :
STRUCT
// Current DC current (A)
{attribute 'OPC.UA.DA' := '1'}
{attribute 'OPC.UA.DA.Access' := '1'}
rActDCCurrent : REAL;
// Current DC voltage (V)
{attribute 'OPC.UA.DA' := '1'}
{attribute 'OPC.UA.DA.Access' := '1'}
rActDCVoltage : REAL;
// Current DC power (W)
{attribute 'OPC.UA.DA' := '1'}
{attribute 'OPC.UA.DA.Access' := '1'}
rActDCPower : REAL;
// Current AC current. Sum of active phases (A)
{attribute 'OPC.UA.DA' := '1'}
{attribute 'OPC.UA.DA.Access' := '1'}
rActACCurrent : REAL;
// Current AC current. Phase A (A)
{attribute 'OPC.UA.DA' := '1'}
{attribute 'OPC.UA.DA.Access' := '1'}
rActtACPhaseACurrent : REAL;
// Current AC current. Phase B (A)
{attribute 'OPC.UA.DA' := '1'}
{attribute 'OPC.UA.DA.Access' := '1'}
rActtACPhaseBCurrent : REAL;
// Current AC current. Phase C (A)
{attribute 'OPC.UA.DA' := '1'}
{attribute 'OPC.UA.DA.Access' := '1'}
rActtACPhaseCCurrent : REAL;
// Current AC power (W)
{attribute 'OPC.UA.DA' := '1'}
{attribute 'OPC.UA.DA.Access' := '1'}
rActACPower : REAL;
// Current AC frequency (Hz)
{attribute 'OPC.UA.DA' := '1'}
{attribute 'OPC.UA.DA.Access' := '1'}
rActACFreq : REAL;
// Current AC apparent power (VA)
{attribute 'OPC.UA.DA' := '1'}
{attribute 'OPC.UA.DA.Access' := '1'}
rActApparentPower : REAL;
// Current AC reactive power (VAr)
{attribute 'OPC.UA.DA' := '1'}
{attribute 'OPC.UA.DA.Access' := '1'}
rActReactivePower : REAL;
// Current AC power factor
{attribute 'OPC.UA.DA' := '1'}
{attribute 'OPC.UA.DA.Access' := '1'}
rActPowerFactor : REAL;
// Current inverter status
{attribute 'OPC.UA.DA' := '1'}
{attribute 'OPC.UA.DA.Access' := '1'}
uiStatus : UINT;
END_STRUCT
END_TYPE
]]></Declaration>
</DUT>
</TcPlcObject>

View File

@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4026.12">
<DUT Name="U_SUNSPEC_ERROR" Id="{4000836c-9d7f-470c-9b50-f6d22b3eac05}">
<Declaration><![CDATA[TYPE U_SUNSPEC_ERROR :
UNION
xGroundFault : BOOL;
xDCOverVoltage : BOOL;
xACDisconnected : BOOL;
xDCDisconnected : BOOL;
xGridDisconnected : BOOL;
xCabinetOpen : BOOL;
xManualShutdown : BOOL;
xOverTemp : BOOL;
xOverFrequency : BOOL;
xUnderFrequency : BOOL;
xACOverVoltage : BOOL;
xACUnderVoltage : BOOL;
xBlownStringFuse : BOOL;
xUnderTemp : BOOL;
xMemoryLoss : BOOL;
xHWTestFailure : BOOL;
xOtherAlarm : BOOL;
xOtherWarning : BOOL;
END_UNION
END_TYPE
]]></Declaration>
</DUT>
</TcPlcObject>