You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

83 lines
4.5 KiB
Plaintext

<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.12">
<GVL Name="Set" Id="{89b3fe05-7a67-4500-b779-cf344427c189}">
<Declaration><![CDATA[{attribute 'qualified_only'}
VAR_GLOBAL CONSTANT PERSISTENT
//VAR_GLOBAL CONSTANT RETAIN
iNoAp : INT := 131; // Number of appartments in the Building
iNoZones : INT := 10; // Number of Zones in the Building
iNoApZoneMax : INT := 28; // Max number of apartments in one zone
iNoApFloorMax : INT := 18; // Max number of apartments in one floor
iNoOfFloors : INT := 8; // Number of floors in the building
// Max Duty Cycle by default, -40.0°C to 20°C, step 2°C
arHeatLevelDefault : ARRAY[0..30] OF INT := [0,3,4,7,10,13,16,23,28,32,34,40,43,45,48,52,66,68,75,82,90,90,90,90,90,90,90,90,90,90,100];
END_VAR
VAR_GLOBAL PERSISTENT
//VAR_GLOBAL RETAIN
iSetT : INT; // Set temperature x0.1°C 23.0°C
iSetMaxOper : INT; // Set Maximum Operation Temperarure
iSetMaxOperHyst : INT := 15; // Set Maximum Operational Temperature Hysteresys
fHMI_SetMaxOper : REAL := 15.0; // For HMI Set Maximum Operation Temperarure
fSetTMAU_N : REAL := 23.0; // Set temperature °C 23.0°C
fSetTMAU_S : REAL := 23.0; // Set temperature °C 23.0°C
// fSetTMAU_Man_N : REAL := 30.0; // Set PID output in Manual %
// fSetTMAU_Man_S : REAL := 30.0; // Set PID output in Manual %
bSetMAU_N_Manual : BOOL; // Set MAU N in Manual Mode
bSetMAU_S_Manual : BOOL; // Set MAU S in Manual Mode
iTmax : INT := 250; // Max set temperature x0.1°C 25.0°C
iTmin : INT := 180; // Min set temperature x0.1°C 18.0°C
bNM : BOOL := TRUE; // 0 Night mode OFF; 1 Night Mode ON
iOverTempSet : INT := 5; // x0.1°C Over Temperature Set Value. Trigger = PV + iOverTempSet
iChillFactorUsage : INT := 50; // Chill Factor Usage to apply. 0..100%
bHMI_AutoCalib_Enable : BOOL; // Activate Auto Calibration
//arApartInit : ARRAY [1..iNoAp] of AparZone; // Settup of Apartments number with link to Zone
arApartInit : ARRAY [1..iNoOfFloors,1..iNoApFloorMax] OF AparZone; // Settup of Apartments number with link to Zone
tPWMCycle : REAL; // in seconds //TIME := T#30S; // 600sec or 10min. 15min=900sec
// Correction % for individual Apartment adjustment per 1°C of changes, -40.0°C to 20°C, step 2°C
arHeatRoomAdj : ARRAY[0..30] OF INT := [0,0,1,1,2,2,2,2,2,2,2,2,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4];
PID_Noise_SUP : REAL := 2; // 0.2°C In PID controller, if ABS(SP-PV)<SUP then output value is 0
HeatEnabled : BOOL; // Enable/Disable Global Heating
arApInZone : ARRAY[1..iNoZones] OF ZoneProp; // Number of Apartments in the each Zone
// Max Duty Cycle per Zone, -40.0°C to 20°C, step 2°C
arHeatLevel : ARRAY[1..iNoZones] OF ARRAY[0..30] OF INT;
arApt_T_SP : ARRAY[1..iNoOfFloors,1..iNoApFloorMax] OF INT; // To Store temperature set point per each apartment.
fLowPassFilter_k : REAL := 0.9; // 0.999
// PID constatnts
// The control parameters are given in the form OF KP, TN AND TV, AND IF there are parameters KP, KI AND KD they can be converted using the following
// formula: TN = KP/KI und TV = KD/KP
// Kp = 15 Proportional gain (Range 19999, unit 0.1) 0.1 to 999.9
// Ti = 100 Integral time (Range 130000, unit 0.1s) 0.1 to 3000s
// Td = 2000 Derivative time (Range 010000, unit 0.1s) 0.1 to 1000s
// Ts = 10 Sampling time (Range 16000, Unit 0.01s) 0.01s to 60.0s
// ZONE PID CONTROL
//
fKp : REAL := 1.5; // 1.5 REAL proportional gain Kp (P)
fTn : REAL := 0.15; // TN = KP/KI = 1.5/10 = 0.15; 100.0 REAL integral gain Tn (I) [s]
fTv : REAL := 133.3; // TV = KD/KP = 200/1.5 = 133.3; 200.0 REAL derivative gain Tv (D-T1) [s]
fTd : REAL := 1200.0; // 1200.0 REAL derivative damping time Td (D-T1) [s]
// MAU PID constatnts
MAU_fKp : REAL := 0.15; // 15.0 REAL proportional gain Kp (P)
MAU_fTn : REAL := 1.0; // 100.0 REAL integral gain Tn (I) [s]
MAU_fTv : REAL := 0.2; // 200.0 REAL derivative gain Tv (D-T1) [s]
MAU_fTd : REAL := 1200.0; // 1200.0 REAL derivative damping time Td (D-T1) [s]
MAU_PID_Noise_SUP : REAL := 0.5; // 0.5°C In PID controller, if ABS(SP-PV)<SUP then output value is 0
MAU_N_0V : REAL := 10; // T set point at 0V analog output
MAU_N_10V : REAL := 35; // T set point at 10V analog output
MAU_S_0V : REAL := 10; // T set point at 0V analog output
MAU_S_10V : REAL := 35; // T set point at 10V analog output
END_VAR
// HMI Variables
VAR_GLOBAL PERSISTENT
fSetT_HMI : REAL := 21.5; //set point for HMI
bHMI_Overheat_Enabled : BOOL; // Overheat Mode is enabled (From HMI)
END_VAR]]></Declaration>
</GVL>
</TcPlcObject>