Some bugfixes
- Config for max string power is now correctly calculated - Adjusted timing for string and inverter timeout
This commit is contained in:
@@ -245,11 +245,11 @@ VAR_GLOBAL PERSISTENT
|
||||
|
||||
// Maximum allowed charging power (Watt) per String
|
||||
// 24.000 W -> 2.000 W per Unit
|
||||
diMaxStringChargingPower : DINT := -48_000;
|
||||
diMaxStringChargingPower : DINT := -36_000;
|
||||
|
||||
// Maximum allowed discharging power (Watt) per String
|
||||
// 24.000 W -> 2.000 W per Unit
|
||||
diMaxStringDischargePower : DINT := 48_000;
|
||||
diMaxStringDischargePower : DINT := 36_000;
|
||||
|
||||
// Inverter ip address for string 1
|
||||
sInverterIpString1 : STRING := '192.168.42.10';
|
||||
@@ -257,7 +257,7 @@ VAR_GLOBAL PERSISTENT
|
||||
// Inverter ip address for string 2
|
||||
sInverterIpString2 : STRING := '192.168.42.20';
|
||||
|
||||
timInverterStartupTimeout : TIME := T#2m;
|
||||
timInverterStartupTimeout : TIME := T#3M;
|
||||
|
||||
// Absolute shutdown discharge power (Watt)
|
||||
// 12.000 W -> 1.000 W per unit
|
||||
@@ -280,7 +280,7 @@ VAR_GLOBAL PERSISTENT
|
||||
timUnitBalancingStartupTime : TIME := T#3M;
|
||||
|
||||
// All modules in string not ready timeout
|
||||
timStringReadyTimeout : TIME := T#3M;
|
||||
timStringReadyTimeout : TIME := T#6M;
|
||||
|
||||
// Timeout for isolation error
|
||||
timIsoErrorTimeout : TIME := T#20S;
|
||||
|
||||
@@ -2665,7 +2665,7 @@
|
||||
<Type n="String">System.String</Type>
|
||||
<Type n="UInt32">System.UInt32</Type>
|
||||
</TypeList>
|
||||
</XmlArchive>
|
||||
</XmlArchive>
|
||||
</PlcProjectOptions>
|
||||
</ProjectExtensions>
|
||||
</Project>
|
||||
30
PLC/PLC.tmc
30
PLC/PLC.tmc
File diff suppressed because one or more lines are too long
@@ -19,6 +19,10 @@ VAR
|
||||
{attribute 'OPC.UA.DA' := '0'}
|
||||
_afbStrings : ARRAY[0..1] OF FB_String[('String 1'), ('String 2')];
|
||||
|
||||
// Calculate max and min power depending on number of active strings
|
||||
_rMinPower : REAL;
|
||||
_rMaxPower : REAL;
|
||||
|
||||
// Battery shutdown due to error
|
||||
_xErrorShutdown : BOOL := FALSE;
|
||||
|
||||
@@ -659,6 +663,12 @@ FOR _ui := 0 TO (GVL_CONFIG.uiNumberOfStrings-1) DO
|
||||
END_IF
|
||||
END_FOR
|
||||
|
||||
// ===============================
|
||||
// Calculate max and min power depending on number of active strings
|
||||
// ===============================
|
||||
_rMinPower := _uiNumberOfActiveStrings * DINT_TO_REAL(GVL_CONFIG.diMaxStringChargingPower);
|
||||
_rMaxPower := _uiNumberOfActiveStrings * DINT_TO_REAL(GVL_CONFIG.diMaxStringDischargePower);
|
||||
|
||||
// ===============================
|
||||
// Calculate sum power for string balancing
|
||||
// ===============================
|
||||
@@ -1048,8 +1058,8 @@ _fbTowerLight(
|
||||
END_IF
|
||||
|
||||
5: // Check if power command is within limits
|
||||
IF _rAutoPowerRequest <= DINT_TO_REAL(GVL_CONFIG.diMaxStringDischargePower)
|
||||
AND _rAutoPowerRequest >= DINT_TO_REAL(GVL_CONFIG.diMaxStringChargingPower) THEN
|
||||
IF _rAutoPowerRequest <= _rMaxPower
|
||||
AND _rAutoPowerRequest >= _rMinPower THEN
|
||||
_xEnableString := TRUE;
|
||||
_xStartBalancing := FALSE;
|
||||
_iState := 10;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TargetSystemConfig Crc="2395715113" Version="1.5">
|
||||
<TargetSystemConfig Crc="2694010443" Version="1.5">
|
||||
<TargetSystemType>HSafetyPLC</TargetSystemType>
|
||||
<TargetSystemSubType>EL2912</TargetSystemSubType>
|
||||
<IsExternalDevice>false</IsExternalDevice>
|
||||
@@ -19,7 +19,4 @@
|
||||
<TakeOverSafetyAliasDeviceNamesInProcessImage>true</TakeOverSafetyAliasDeviceNamesInProcessImage>
|
||||
<TakeOverStandardAliasDeviceNamesInProcessImage>true</TakeOverStandardAliasDeviceNamesInProcessImage>
|
||||
<BackupRestore Needed="0" Activated="false" RestoreUserAdministration="false" />
|
||||
<Customizing>
|
||||
<Group Id="87605930-f4c2-4c12-816d-f0103cb2103d" Value="2" />
|
||||
</Customizing>
|
||||
</TargetSystemConfig>
|
||||
@@ -263,7 +263,7 @@
|
||||
</System>
|
||||
<Plc>
|
||||
<Project GUID="{9AE64910-5EB2-4866-93FD-EFE059C38C36}" Name="PLC" PrjFilePath="PLC\PLC.plcproj" TmcFilePath="PLC\PLC.tmc" ReloadTmc="true" AmsPort="851" FileArchiveSettings="#x000e" CopyTmcToTarget="true" CopyTpyToTarget="false" SymbolicMapping="true">
|
||||
<Instance Id="#x08502000" TcSmClass="TComPlcObjDef" KeepUnrestoredLinks="2" TmcHash="{50AF3F57-0138-6597-C54A-9056797B90F0}" TmcPath="PLC\PLC.tmc">
|
||||
<Instance Id="#x08502000" TcSmClass="TComPlcObjDef" KeepUnrestoredLinks="2" TmcHash="{E2BBA81A-0070-8077-2E9B-D9E795CC6B2F}" TmcPath="PLC\PLC.tmc">
|
||||
<Name>PLC Instance</Name>
|
||||
<CLSID ClassFactory="TcPlc30">{08500001-0000-0000-F000-000000000064}</CLSID>
|
||||
<Vars VarGrpType="2" AreaNo="1">
|
||||
|
||||
Reference in New Issue
Block a user