Added cabinet temperature and modbus registers
added cabinet temperature to each module, scs and bms cabinet, added corresponding config, hmi interface, hardware & links. Added corresponding warning bits to modbus registers
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4026.12">
|
||||
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4026.8">
|
||||
<DUT Name="ST_DWORD_UNIT_WARNING_BITMAP" Id="{fe3a1ecb-072b-4492-b355-17d925e9fa12}">
|
||||
<Declaration><![CDATA[TYPE ST_DWORD_UNIT_WARNING_BITMAP :
|
||||
STRUCT
|
||||
|
||||
@@ -1,11 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4026.12">
|
||||
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4026.8">
|
||||
<DUT Name="ST_WORD_BMS_WARNING_BITMAP" Id="{6dfd9c4b-4e74-434e-9f65-01d443c224d5}">
|
||||
<Declaration><![CDATA[TYPE ST_WORD_BMS_WARNING_BITMAP :
|
||||
STRUCT
|
||||
bNotAllInAuto : BIT;
|
||||
bSafetyIntlkString1 : BIT;
|
||||
bSafetyIntlkString2 : BIT;
|
||||
bTCabinetBMSHigh : BIT;
|
||||
bTCabinetSCSString1High : BIT;
|
||||
bTCabinetSCSString2High : BIT;
|
||||
bTCabinetString1Module1High : BIT;
|
||||
bTCabinetString1Module2High : BIT;
|
||||
bTCabinetString1Module3High : BIT;
|
||||
bTCabinetString2Module1High : BIT;
|
||||
bTCabinetString2Module2High : BIT;
|
||||
bTCabinetString2Module3High : BIT;
|
||||
END_STRUCT
|
||||
END_TYPE
|
||||
]]></Declaration>
|
||||
|
||||
@@ -8,6 +8,9 @@ STRUCT
|
||||
stHMIInterfaceUnit3 : ST_UNIT_HMI_INTERFACE;
|
||||
stHMIInterfaceUnit4 : ST_UNIT_HMI_INTERFACE;
|
||||
|
||||
// Temperature sensor control cabinet
|
||||
stTempCabinet : ST_HMI_ANALOG_VALUE;
|
||||
|
||||
// Current voltage for HMI
|
||||
// ==============================
|
||||
rVoltage : REAL;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4026.12">
|
||||
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4026.8">
|
||||
<DUT Name="ST_STRING_HMI_INTERFACE" Id="{b74e184a-a1d0-4499-8ac0-7e2226af9a4f}">
|
||||
<Declaration><![CDATA[TYPE ST_STRING_HMI_INTERFACE :
|
||||
STRUCT
|
||||
@@ -7,6 +7,9 @@ STRUCT
|
||||
stHMIInterfaceModule2 : ST_MODULE_HMI_INTERFACE;
|
||||
stHMIInterfaceModule3 : ST_MODULE_HMI_INTERFACE;
|
||||
|
||||
// Temperature sensor SCS control cabinet
|
||||
stTempCabinetSCS : ST_HMI_ANALOG_VALUE;
|
||||
|
||||
// Current voltage for HMI
|
||||
// ==============================
|
||||
rVoltage : REAL;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4026.12">
|
||||
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4026.8">
|
||||
<GVL Name="GVL_CONFIG" Id="{0773bf51-0237-454d-a970-cfd896054edb}">
|
||||
<Declaration><![CDATA[{attribute 'qualified_only'}
|
||||
VAR_GLOBAL CONSTANT
|
||||
@@ -183,6 +183,26 @@ VAR_GLOBAL PERSISTENT
|
||||
stEWLSCSCurrent : ST_ANALOG_EW_LEVELS;
|
||||
stEWDSCSCurrent : ST_ANALOG_EW_DELAYS;
|
||||
|
||||
// ===========================
|
||||
// Control cabinet temperature sensor config
|
||||
// ===========================
|
||||
// Temperature sensor control cabinets
|
||||
stConfigCabinetTemp : ST_ANALOG_IO_CONFIG := (iAIMax := 32767, iAIMin := -32768, rPVMax := 3276.7, rPVMin := -3276.8, sUnit := '°C');
|
||||
stEWLCabinetTemp : ST_ANALOG_EW_LEVELS := (rErrorMin := -20, rWarningMin := -15, rWarningMax := 40, rErrorMax := 80);
|
||||
stEWDCabinetTemp : ST_ANALOG_EW_DELAYS :=
|
||||
(
|
||||
timHardwareSignalLevelOn := T#0S,
|
||||
timHardwareSignalLevelOff := T#5S,
|
||||
timErrorLowOn := T#1S,
|
||||
timErrorLowOff := T#5S,
|
||||
timWarningLowOn := T#1S,
|
||||
timWarningLowOff := T#5S,
|
||||
timWarningHighOn := T#1S,
|
||||
timWarningHighOff := T#5S,
|
||||
timErrorHighOn := T#1S,
|
||||
timErrorHighOff := T#5S
|
||||
);
|
||||
|
||||
|
||||
// ===========================
|
||||
// General settings
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4026.12">
|
||||
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4026.8">
|
||||
<GVL Name="GVL_SCADA" Id="{8186ff04-764f-4b24-8a6b-d0a44d528e6f}">
|
||||
<Declaration><![CDATA[{attribute 'qualified_only'}
|
||||
VAR_GLOBAL
|
||||
// Array for string HMI
|
||||
stHMIInterface : ARRAY [0..1] OF ST_STRING_HMI_INTERFACE;
|
||||
|
||||
// Temperature sensor BMS control cabinet
|
||||
stTempCabinetBMS : ST_HMI_ANALOG_VALUE;
|
||||
|
||||
// Acknowledge alarm button
|
||||
stAckAlarmsButton : ST_HMI_CONTROL_BUTTON := (xRelease := TRUE);
|
||||
|
||||
|
||||
501
PLC/PLC.tmc
501
PLC/PLC.tmc
File diff suppressed because one or more lines are too long
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4026.12">
|
||||
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4026.8">
|
||||
<POU Name="FB_Module" Id="{87be924f-018d-4c09-997b-f0c0054414cc}" SpecialFunc="None">
|
||||
<Declaration><![CDATA[FUNCTION_BLOCK FB_Module
|
||||
VAR_INPUT
|
||||
@@ -86,6 +86,9 @@ VAR_OUTPUT
|
||||
// One unit has a warning
|
||||
xWarning : BOOL;
|
||||
|
||||
// Temperature control cabinet above 40 °C
|
||||
xTempCabinetWarning : BOOL;
|
||||
|
||||
// All modules in automatic mode
|
||||
xAllUnitsInAutomatic : BOOL;
|
||||
|
||||
@@ -104,6 +107,9 @@ VAR
|
||||
_fbUnit3 : FB_Unit(CONCAT(Name, ' - Unit 3'));
|
||||
_fbUnit4 : FB_Unit(CONCAT(Name, ' - Unit 4'));
|
||||
|
||||
// Temperature sensor cabinet
|
||||
_fbTempSensorCabinet : FB_AnalogInput(CONCAT(Name, ' - T1_Cabinet'));
|
||||
|
||||
// Flag for unit balance checking
|
||||
_xBalanceOk : BOOL;
|
||||
|
||||
@@ -143,6 +149,8 @@ END_VAR
|
||||
_fbUnit2.Name := CONCAT(Name, ' - Unit 2');
|
||||
_fbUnit3.Name := CONCAT(Name, ' - Unit 3');
|
||||
_fbUnit4.Name := CONCAT(Name, ' - Unit 4');
|
||||
|
||||
_fbTempSensorCabinet.Name := CONCAT(Name, ' - T1_Cabinet');
|
||||
END_IF
|
||||
|
||||
// Reset error and warning flag
|
||||
@@ -384,6 +392,33 @@ IF NOT _fbUnit4.xAllComponentsInAuto THEN
|
||||
END_IF
|
||||
|
||||
|
||||
// ===============================
|
||||
// Temperature sensor control cabinet
|
||||
// ===============================
|
||||
_fbTempSensorCabinet(
|
||||
stScalingConfig:= GVL_CONFIG.stConfigCabinetTemp,
|
||||
stEWConfig:= GVL_CONFIG.stEWLCabinetTemp,
|
||||
stEWDelayConfig:= GVL_CONFIG.stEWDCabinetTemp,
|
||||
xReleaseErrors:= xReleaseErrors,
|
||||
xReleaseLimitErrors:= xReleaseLimitErrors,
|
||||
xReleaseHardwareErrors:= xReleaseErrors,
|
||||
xConfirmAlarms:= xConfirmAlarms,
|
||||
stHMIInterface=> refstHMIInterface.stTempCabinet);
|
||||
|
||||
// Set warning output for modbus register bits
|
||||
IF _fbTempSensorCabinet.xWarningHigh THEN
|
||||
xTempCabinetWarning := TRUE;
|
||||
END_IF
|
||||
|
||||
IF _fbTempSensorCabinet.xError THEN
|
||||
xError := TRUE;
|
||||
END_IF
|
||||
|
||||
IF _fbTempSensorCabinet.xWarning THEN
|
||||
xWarning := TRUE;
|
||||
END_IF
|
||||
|
||||
|
||||
// ===============================
|
||||
// Units ready check
|
||||
// ===============================
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4026.12">
|
||||
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4026.8">
|
||||
<POU Name="FB_String" Id="{46501225-f446-4674-bfed-3be64273e576}" SpecialFunc="None">
|
||||
<Declaration><![CDATA[FUNCTION_BLOCK FB_String
|
||||
VAR_INPUT
|
||||
@@ -100,6 +100,15 @@ VAR_OUTPUT
|
||||
xError : BOOL;
|
||||
xWarning : BOOL;
|
||||
|
||||
// Temperature control cabinet module 1 above 40 °C
|
||||
xTempCabinetModule1Warning : BOOL;
|
||||
|
||||
// Temperature control cabinet module 2 above 40 °C
|
||||
xTempCabinetModule2Warning : BOOL;
|
||||
|
||||
// Temperature control cabinet module 3 above 40 °C
|
||||
xTempCabinetModule3Warning : BOOL;
|
||||
|
||||
eStatus : E_COMPONENT_STATUS;
|
||||
|
||||
// Inverter status data
|
||||
@@ -275,7 +284,8 @@ _fbModule1(
|
||||
xReleaseManualMode := xReleaseManualMode,
|
||||
xConfirmAlarms:= xConfirmAlarms,
|
||||
xAllToManualMode := xAllToManualMode,
|
||||
rBalancingTargetVoltage := rSmallestSegmentVoltage);
|
||||
rBalancingTargetVoltage := rSmallestSegmentVoltage,
|
||||
xTempCabinetWarning => xTempCabinetModule1Warning);
|
||||
|
||||
|
||||
// ===============================
|
||||
@@ -296,7 +306,8 @@ _fbModule2(
|
||||
xReleaseManualMode := xReleaseManualMode,
|
||||
xConfirmAlarms:= xConfirmAlarms,
|
||||
xAllToManualMode := xAllToManualMode,
|
||||
rBalancingTargetVoltage := rSmallestSegmentVoltage);
|
||||
rBalancingTargetVoltage := rSmallestSegmentVoltage,
|
||||
xTempCabinetWarning => xTempCabinetModule2Warning);
|
||||
|
||||
|
||||
// ===============================
|
||||
@@ -317,7 +328,8 @@ _fbModule3(
|
||||
xReleaseManualMode := xReleaseManualMode,
|
||||
xConfirmAlarms:= xConfirmAlarms,
|
||||
xAllToManualMode := xAllToManualMode,
|
||||
rBalancingTargetVoltage := rSmallestSegmentVoltage);
|
||||
rBalancingTargetVoltage := rSmallestSegmentVoltage,
|
||||
xTempCabinetWarning => xTempCabinetModule3Warning);
|
||||
|
||||
|
||||
// ===============================
|
||||
@@ -966,7 +978,6 @@ END_IF
|
||||
_xIsoError := ((NOT xIsoErrorL1) OR (NOT xIsoErrorL2)) AND (NOT _fbInverter.xActive) AND (xDCCBOpen);
|
||||
_fbTONIsoError(IN := _xIsoError, PT := GVL_CONFIG.timIsoErrorTimeout);
|
||||
|
||||
// _fbInverter
|
||||
IF _fbTONIsoError.Q AND (NOT _fbIsolationAlarm.bRaised) AND xReleaseErrors THEN
|
||||
_fbIsolationAlarm.Raise(0);
|
||||
END_IF
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4026.12">
|
||||
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4026.8">
|
||||
<POU Name="FB_Unit" Id="{e9bb815b-eb46-4920-800d-910484e58b22}" SpecialFunc="None">
|
||||
<Declaration><![CDATA[FUNCTION_BLOCK FB_Unit
|
||||
VAR_INPUT
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4026.12">
|
||||
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4026.8">
|
||||
<POU Name="MAIN" Id="{bbd7302c-91ce-4697-9f4b-743f57ca5819}" SpecialFunc="None">
|
||||
<Declaration><![CDATA[PROGRAM MAIN
|
||||
VAR
|
||||
@@ -149,6 +149,15 @@ VAR
|
||||
_rDeltaUm : REAL;
|
||||
_arPowerString : ARRAY[0..(GVL_CONFIG.uiNumberOfStrings-1)] OF REAL;
|
||||
|
||||
// Temperature sensor SCS String 1
|
||||
_fbTempCabinetSCSString1 : FB_AnalogInput('String 1 - SCS - T1_Cabinet');
|
||||
|
||||
// Temperature sensor SCS String 1
|
||||
_fbTempCabinetSCSString2 : FB_AnalogInput('String 2 - SCS - T1_Cabinet');
|
||||
|
||||
// Temperature sensor BMS cabinet
|
||||
_fbTempCabinetBMS : FB_AnalogInput('BMS - T1_Cabinet');
|
||||
|
||||
_ui : UINT := 0;
|
||||
_xStringsReady : BOOL;
|
||||
_xStringsErrorActive : BOOL;
|
||||
@@ -328,6 +337,28 @@ END_IF
|
||||
// Dely release of errors during PLC startup phase
|
||||
_tonStartupDelay(IN := TRUE);
|
||||
|
||||
// ===============================
|
||||
// Temperature sensor control cabinet BMS
|
||||
// ===============================
|
||||
_fbTempCabinetBMS(
|
||||
stScalingConfig:= GVL_CONFIG.stConfigCabinetTemp,
|
||||
stEWConfig:= GVL_CONFIG.stEWLCabinetTemp,
|
||||
stEWDelayConfig:= GVL_CONFIG.stEWDCabinetTemp,
|
||||
xReleaseErrors:= _xReleaseErrors,
|
||||
xReleaseLimitErrors:= _xReleaseLimitsErrors,
|
||||
xReleaseHardwareErrors:= _xReleaseErrors,
|
||||
xConfirmAlarms:= _xConfirmAlarms,
|
||||
stHMIInterface=> GVL_SCADA.stTempCabinetBMS);
|
||||
|
||||
// Set modbus error register bit
|
||||
IF _fbTempCabinetBMS.xWarningHigh THEN
|
||||
GVL_MODBUS.stBMSErrorReg.wBMSWarningActive.stBitmap.bTCabinetBMSHigh := TRUE;
|
||||
END_IF
|
||||
|
||||
IF _fbTempCabinetBMS.xError THEN
|
||||
_xErrorActive := TRUE;
|
||||
END_IF
|
||||
|
||||
// Call string 1
|
||||
_afbStrings[0](
|
||||
xEnable := _xEnableString AND GVL_CONFIG.axStringEnabled[0],
|
||||
@@ -351,11 +382,33 @@ IF _afbStrings[0].xError THEN
|
||||
_xErrorActive := TRUE;
|
||||
END_IF
|
||||
|
||||
// ===============================
|
||||
// Temperature sensor control cabinet SCS string 1
|
||||
// ===============================
|
||||
_fbTempCabinetSCSString1(
|
||||
stScalingConfig:= GVL_CONFIG.stConfigCabinetTemp,
|
||||
stEWConfig:= GVL_CONFIG.stEWLCabinetTemp,
|
||||
stEWDelayConfig:= GVL_CONFIG.stEWDCabinetTemp,
|
||||
xReleaseErrors:= _xReleaseErrors,
|
||||
xReleaseLimitErrors:= _xReleaseLimitsErrors,
|
||||
xReleaseHardwareErrors:= _xReleaseErrors,
|
||||
xConfirmAlarms:= _xConfirmAlarms,
|
||||
stHMIInterface=> GVL_SCADA.stHMIInterface[0].stTempCabinetSCS);
|
||||
|
||||
IF _fbTempCabinetSCSString1.xError THEN
|
||||
_xErrorActive := TRUE;
|
||||
END_IF
|
||||
|
||||
|
||||
// Handle string 1 modbus error and warning
|
||||
GVL_MODBUS.stBMSErrorReg.wStringErrorActive.0 := _afbStrings[0].xError;
|
||||
GVL_MODBUS.stBMSErrorReg.wStringWarningActive.0 := _afbStrings[0].xWarning;
|
||||
GVL_MODBUS.stBMSErrorReg.wBMSErrorActive.stBitmap.bDCSwitchS1 := (NOT _afbStrings[0].xRepairSwitchOk);
|
||||
GVL_MODBUS.stBMSErrorReg.wBMSWarningActive.stBitmap.bSafetyIntlkString1 := (NOT _afbStrings[0].xSafetyIntlksOk);
|
||||
GVL_MODBUS.stBMSErrorReg.wBMSWarningActive.stBitmap.bTCabinetString1Module1High := _afbStrings[0].xTempCabinetModule1Warning;
|
||||
GVL_MODBUS.stBMSErrorReg.wBMSWarningActive.stBitmap.bTCabinetString1Module2High := _afbStrings[0].xTempCabinetModule2Warning;
|
||||
GVL_MODBUS.stBMSErrorReg.wBMSWarningActive.stBitmap.bTCabinetString1Module3High := _afbStrings[0].xTempCabinetModule3Warning;
|
||||
GVL_MODBUS.stBMSErrorReg.wBMSWarningActive.stBitmap.bTCabinetSCSString1High := _fbTempCabinetSCSString1.xWarningHigh;
|
||||
|
||||
|
||||
// Call string 2
|
||||
@@ -381,11 +434,32 @@ IF _afbStrings[1].xError THEN
|
||||
_xErrorActive := TRUE;
|
||||
END_IF
|
||||
|
||||
// ===============================
|
||||
// Temperature sensor control cabinet SCS string 2
|
||||
// ===============================
|
||||
_fbTempCabinetSCSString2(
|
||||
stScalingConfig:= GVL_CONFIG.stConfigCabinetTemp,
|
||||
stEWConfig:= GVL_CONFIG.stEWLCabinetTemp,
|
||||
stEWDelayConfig:= GVL_CONFIG.stEWDCabinetTemp,
|
||||
xReleaseErrors:= _xReleaseErrors,
|
||||
xReleaseLimitErrors:= _xReleaseLimitsErrors,
|
||||
xReleaseHardwareErrors:= _xReleaseErrors,
|
||||
xConfirmAlarms:= _xConfirmAlarms,
|
||||
stHMIInterface=> GVL_SCADA.stHMIInterface[1].stTempCabinetSCS);
|
||||
|
||||
IF _fbTempCabinetSCSString2.xError THEN
|
||||
_xErrorActive := TRUE;
|
||||
END_IF
|
||||
|
||||
// Handle string 1 modbus error and warning
|
||||
GVL_MODBUS.stBMSErrorReg.wStringErrorActive.1 := _afbStrings[1].xError;
|
||||
GVL_MODBUS.stBMSErrorReg.wStringWarningActive.1 := _afbStrings[1].xWarning;
|
||||
GVL_MODBUS.stBMSErrorReg.wBMSErrorActive.stBitmap.bDCSwitchS2 := (NOT _afbStrings[1].xRepairSwitchOk);
|
||||
GVL_MODBUS.stBMSErrorReg.wBMSWarningActive.stBitmap.bSafetyIntlkString2 := (NOT _afbStrings[1].xSafetyIntlksOk);
|
||||
GVL_MODBUS.stBMSErrorReg.wBMSWarningActive.stBitmap.bTCabinetString2Module1High := _afbStrings[1].xTempCabinetModule1Warning;
|
||||
GVL_MODBUS.stBMSErrorReg.wBMSWarningActive.stBitmap.bTCabinetString2Module2High := _afbStrings[1].xTempCabinetModule2Warning;
|
||||
GVL_MODBUS.stBMSErrorReg.wBMSWarningActive.stBitmap.bTCabinetString2Module3High := _afbStrings[1].xTempCabinetModule3Warning;
|
||||
GVL_MODBUS.stBMSErrorReg.wBMSWarningActive.stBitmap.bTCabinetSCSString2High := _fbTempCabinetSCSString2.xWarningHigh;
|
||||
|
||||
// Copy general error to modbus error register
|
||||
GVL_MODBUS.stBMSErrorReg.wBMSErrorActive.stBitmap.bError := _xErrorActive;
|
||||
|
||||
Reference in New Issue
Block a user