Komfovent C3
Detaljer
- Typ
- Drivrutin
- Upplaggd av
- Ove Jansson, Abelko Innovation
- Version
- 2
- Uppdaterad
- 2015-08-14
- Skapad
- 2013-08-28
- Kategori
- Modbus, Ventilation
- Visningar
- 2221
Beskrivning
Drivrutin
Bruksanvisning
Hur man installerar typdefinitionerna och driftsätter modulerna finns beskrivet i användarmanualen, kapitel 18.7.
Juridisk information
Alla skript tillhandahålls i befintligt skick och all användning sker på eget ansvar. Felaktig använding kan leda till skadad eller förstörd utrustning.
Skript kod
%
% Komfovent C3
%
% Device settings:
% Baudrate: 19200
% Data bits: 8
% Parity: None
% Stop bits: 1
%
DEVICETYPE KomfoventC3 NAMED "Komfonvent C3" TYPEID 10767 IS
PARAMETER
Id : "Adress";
PUBLIC
V1 : "OutdoorAirTemp" ["°C"]DEC2; % 129x2
V2 : "RoomAirTemp" ["°C"]DEC2; % 131x2
V3 : "SupplyAirTemp" ["°C"]DEC2; % 133x2
V4 : "AntiFreezeTemp" ["°C"]DEC2; % 137x2
V5 : "ReturnWaterTemp" ["°C"]DEC2; % 139x2
V6 : "SupplyPressure" ["Pa"]INT; % 141x2
V7 : "ExhaustPressure" ["Pa"]INT; % 143x2
V8 : "SupplFanCtrlOut" ["V"]DEC2; % 145x2
V9 : "ExhaFanCtrlOut" ["V"]DEC2; % 147x2
V10 : "SupplyAirFlow" ["m3/h"]DEC3; % 149x2
V11 : "ExhaustAirFlow" ["m3/h"]DEC3; % 151x2
V12 : "RotorCtrlOutput" ["V"]DEC2; % 153x2
V13 : "WaterHeaterCtrl" ["V"]DEC2; % 155x2
%V14 : "ElectHeaterCtrl" ["V"DEC2]; % doesn't exist
V15 : "ElectHeatPower" ["%"]DEC2; % 157x2
V16 : "WaterCoolerCtrl" ["V"]DEC2; % 159x2
V17 : "ElectCoolPower" ["%"]DEC2; % 161x2
V18 : "AHUOpStatus" [""]INT; % 163x1 0=OFF, 1=ON
V19 : "AirQualityInput" ["V"]DEC2; % 164x2
V20 : "SuppPressureInp" ["V"]DEC2; % 166x2
PRIVATE
Sign;
Exponent;
Mantissa;
Tmp;
Count;
Res;
BAUDRATE 19200;
CHECKSUM MODBUS SWAPPED;
TELEGRAM Input NAMED "Komfo input" IS
QUESTION
DATA[0] := BYTE(Id);
DATA[1] := HEX(03);
DATA[2] <- RWORD(
IF Count>17 THEN Count := 0; ENDIF;
IF Count=0 THEN Tmp:=128;
ELSIF Count=1 THEN Tmp:=130;
ELSIF Count=2 THEN Tmp:=132;
ELSIF Count=3 THEN Tmp:=136;
ELSIF Count=4 THEN Tmp:=138;
ELSIF Count=5 THEN Tmp:=140;
ELSIF Count=6 THEN Tmp:=142;
ELSIF Count=7 THEN Tmp:=144;
ELSIF Count=8 THEN Tmp:=146;
ELSIF Count=9 THEN Tmp:=148;
ELSIF Count=10 THEN Tmp:=150;
ELSIF Count=11 THEN Tmp:=152;
ELSIF Count=12 THEN Tmp:=154;
ELSIF Count=13 THEN Tmp:=156;
ELSIF Count=14 THEN Tmp:=158;
ELSIF Count=15 THEN Tmp:=160;
ELSIF Count=16 THEN Tmp:=163;
ELSIF Count=17 THEN Tmp:=165;
ENDIF;
DATA:=Tmp;
); % modbus start register
DATA[4] := RWORD(2); % read number of registers
ANSWER SIZE 9
DATA[0] = BYTE(Id);
DATA[1] = HEX(03);
DATA[2] = BYTE(4);
DATA[3] -> BYTE(Mantissa := 1;
IF (DATA&128) THEN Sign := -1; ELSE Sign := 1; ENDIF;
Exponent := ((DATA&127)*2)-127 ;
);
DATA[4] -> BYTE(
IF DATA&128 THEN Exponent := Exponent+1; ENDIF;
IF DATA&64 THEN Mantissa := Mantissa+(2^-1); ENDIF;
IF DATA&32 THEN Mantissa := Mantissa+(2^-2); ENDIF;
IF DATA&16 THEN Mantissa := Mantissa+(2^-3); ENDIF;
IF DATA&8 THEN Mantissa := Mantissa+(2^-4); ENDIF;
IF DATA&4 THEN Mantissa := Mantissa+(2^-5); ENDIF;
IF DATA&2 THEN Mantissa := Mantissa+(2^-6); ENDIF;
IF DATA&1 THEN Mantissa := Mantissa+(2^-7); ENDIF;
);
DATA[5] -> BYTE(
IF DATA&128 THEN Mantissa := Mantissa+(2^-8); ENDIF;
IF DATA&64 THEN Mantissa := Mantissa+(2^-9); ENDIF;
IF DATA&32 THEN Mantissa := Mantissa+(2^-10); ENDIF;
IF DATA&16 THEN Mantissa := Mantissa+(2^-11); ENDIF;
IF DATA&8 THEN Mantissa := Mantissa+(2^-12); ENDIF;
IF DATA&4 THEN Mantissa := Mantissa+(2^-13); ENDIF;
IF DATA&2 THEN Mantissa := Mantissa+(2^-14); ENDIF;
IF DATA&1 THEN Mantissa := Mantissa+(2^-15); ENDIF;
);
DATA[6] -> BYTE(
IF DATA&128 THEN Mantissa := Mantissa+(2^-16); ENDIF;
IF DATA&64 THEN Mantissa := Mantissa+(2^-17); ENDIF;
IF DATA&32 THEN Mantissa := Mantissa+(2^-18); ENDIF;
IF DATA&16 THEN Mantissa := Mantissa+(2^-19); ENDIF;
IF DATA&8 THEN Mantissa := Mantissa+(2^-20); ENDIF;
IF DATA&4 THEN Mantissa := Mantissa+(2^-21); ENDIF;
IF DATA&2 THEN Mantissa := Mantissa+(2^-22); ENDIF;
IF DATA&1 THEN Mantissa := Mantissa+(2^-23); ENDIF;
Res := Sign * Mantissa * (2^Exponent);
IF Count=0 THEN V1:=Res;
ELSIF Count=1 THEN V2:=Res;
ELSIF Count=2 THEN V3:=Res;
ELSIF Count=3 THEN V4:=Res;
ELSIF Count=4 THEN V5:=Res;
ELSIF Count=5 THEN V6:=Res;
ELSIF Count=6 THEN V7:=Res;
ELSIF Count=7 THEN V8:=Res;
ELSIF Count=8 THEN V9:=Res;
ELSIF Count=9 THEN V10:=Res;
ELSIF Count=10 THEN V11:=Res;
ELSIF Count=11 THEN V12:=Res;
ELSIF Count=12 THEN V13:=Res;
ELSIF Count=13 THEN V15:=Res;
ELSIF Count=14 THEN V16:=Res;
ELSIF Count=15 THEN V17:=Res;
ELSIF Count=16 THEN V19:=Res;
ELSIF Count=17 THEN V20:=Res;
ENDIF;
Count := Count +1;
);
TIMEOUT 2000
END;
TELEGRAM Status NAMED "Komfo status" IS
QUESTION
DATA[0] := BYTE(Id);
DATA[1] := HEX(03);
DATA[2] := RWORD(162); % modbus start register
DATA[4] := RWORD(1); % read number of registers
ANSWER SIZE 7
DATA[0] = BYTE(Id);
DATA[1] = HEX(03);
DATA[2] = BYTE(2);
DATA[3] -> RWORD(V18:=DATA;);
TIMEOUT 2000
END;
END;
% Komfovent C3
%
% Device settings:
% Baudrate: 19200
% Data bits: 8
% Parity: None
% Stop bits: 1
%
DEVICETYPE KomfoventC3 NAMED "Komfonvent C3" TYPEID 10767 IS
PARAMETER
Id : "Adress";
PUBLIC
V1 : "OutdoorAirTemp" ["°C"]DEC2; % 129x2
V2 : "RoomAirTemp" ["°C"]DEC2; % 131x2
V3 : "SupplyAirTemp" ["°C"]DEC2; % 133x2
V4 : "AntiFreezeTemp" ["°C"]DEC2; % 137x2
V5 : "ReturnWaterTemp" ["°C"]DEC2; % 139x2
V6 : "SupplyPressure" ["Pa"]INT; % 141x2
V7 : "ExhaustPressure" ["Pa"]INT; % 143x2
V8 : "SupplFanCtrlOut" ["V"]DEC2; % 145x2
V9 : "ExhaFanCtrlOut" ["V"]DEC2; % 147x2
V10 : "SupplyAirFlow" ["m3/h"]DEC3; % 149x2
V11 : "ExhaustAirFlow" ["m3/h"]DEC3; % 151x2
V12 : "RotorCtrlOutput" ["V"]DEC2; % 153x2
V13 : "WaterHeaterCtrl" ["V"]DEC2; % 155x2
%V14 : "ElectHeaterCtrl" ["V"DEC2]; % doesn't exist
V15 : "ElectHeatPower" ["%"]DEC2; % 157x2
V16 : "WaterCoolerCtrl" ["V"]DEC2; % 159x2
V17 : "ElectCoolPower" ["%"]DEC2; % 161x2
V18 : "AHUOpStatus" [""]INT; % 163x1 0=OFF, 1=ON
V19 : "AirQualityInput" ["V"]DEC2; % 164x2
V20 : "SuppPressureInp" ["V"]DEC2; % 166x2
PRIVATE
Sign;
Exponent;
Mantissa;
Tmp;
Count;
Res;
BAUDRATE 19200;
CHECKSUM MODBUS SWAPPED;
TELEGRAM Input NAMED "Komfo input" IS
QUESTION
DATA[0] := BYTE(Id);
DATA[1] := HEX(03);
DATA[2] <- RWORD(
IF Count>17 THEN Count := 0; ENDIF;
IF Count=0 THEN Tmp:=128;
ELSIF Count=1 THEN Tmp:=130;
ELSIF Count=2 THEN Tmp:=132;
ELSIF Count=3 THEN Tmp:=136;
ELSIF Count=4 THEN Tmp:=138;
ELSIF Count=5 THEN Tmp:=140;
ELSIF Count=6 THEN Tmp:=142;
ELSIF Count=7 THEN Tmp:=144;
ELSIF Count=8 THEN Tmp:=146;
ELSIF Count=9 THEN Tmp:=148;
ELSIF Count=10 THEN Tmp:=150;
ELSIF Count=11 THEN Tmp:=152;
ELSIF Count=12 THEN Tmp:=154;
ELSIF Count=13 THEN Tmp:=156;
ELSIF Count=14 THEN Tmp:=158;
ELSIF Count=15 THEN Tmp:=160;
ELSIF Count=16 THEN Tmp:=163;
ELSIF Count=17 THEN Tmp:=165;
ENDIF;
DATA:=Tmp;
); % modbus start register
DATA[4] := RWORD(2); % read number of registers
ANSWER SIZE 9
DATA[0] = BYTE(Id);
DATA[1] = HEX(03);
DATA[2] = BYTE(4);
DATA[3] -> BYTE(Mantissa := 1;
IF (DATA&128) THEN Sign := -1; ELSE Sign := 1; ENDIF;
Exponent := ((DATA&127)*2)-127 ;
);
DATA[4] -> BYTE(
IF DATA&128 THEN Exponent := Exponent+1; ENDIF;
IF DATA&64 THEN Mantissa := Mantissa+(2^-1); ENDIF;
IF DATA&32 THEN Mantissa := Mantissa+(2^-2); ENDIF;
IF DATA&16 THEN Mantissa := Mantissa+(2^-3); ENDIF;
IF DATA&8 THEN Mantissa := Mantissa+(2^-4); ENDIF;
IF DATA&4 THEN Mantissa := Mantissa+(2^-5); ENDIF;
IF DATA&2 THEN Mantissa := Mantissa+(2^-6); ENDIF;
IF DATA&1 THEN Mantissa := Mantissa+(2^-7); ENDIF;
);
DATA[5] -> BYTE(
IF DATA&128 THEN Mantissa := Mantissa+(2^-8); ENDIF;
IF DATA&64 THEN Mantissa := Mantissa+(2^-9); ENDIF;
IF DATA&32 THEN Mantissa := Mantissa+(2^-10); ENDIF;
IF DATA&16 THEN Mantissa := Mantissa+(2^-11); ENDIF;
IF DATA&8 THEN Mantissa := Mantissa+(2^-12); ENDIF;
IF DATA&4 THEN Mantissa := Mantissa+(2^-13); ENDIF;
IF DATA&2 THEN Mantissa := Mantissa+(2^-14); ENDIF;
IF DATA&1 THEN Mantissa := Mantissa+(2^-15); ENDIF;
);
DATA[6] -> BYTE(
IF DATA&128 THEN Mantissa := Mantissa+(2^-16); ENDIF;
IF DATA&64 THEN Mantissa := Mantissa+(2^-17); ENDIF;
IF DATA&32 THEN Mantissa := Mantissa+(2^-18); ENDIF;
IF DATA&16 THEN Mantissa := Mantissa+(2^-19); ENDIF;
IF DATA&8 THEN Mantissa := Mantissa+(2^-20); ENDIF;
IF DATA&4 THEN Mantissa := Mantissa+(2^-21); ENDIF;
IF DATA&2 THEN Mantissa := Mantissa+(2^-22); ENDIF;
IF DATA&1 THEN Mantissa := Mantissa+(2^-23); ENDIF;
Res := Sign * Mantissa * (2^Exponent);
IF Count=0 THEN V1:=Res;
ELSIF Count=1 THEN V2:=Res;
ELSIF Count=2 THEN V3:=Res;
ELSIF Count=3 THEN V4:=Res;
ELSIF Count=4 THEN V5:=Res;
ELSIF Count=5 THEN V6:=Res;
ELSIF Count=6 THEN V7:=Res;
ELSIF Count=7 THEN V8:=Res;
ELSIF Count=8 THEN V9:=Res;
ELSIF Count=9 THEN V10:=Res;
ELSIF Count=10 THEN V11:=Res;
ELSIF Count=11 THEN V12:=Res;
ELSIF Count=12 THEN V13:=Res;
ELSIF Count=13 THEN V15:=Res;
ELSIF Count=14 THEN V16:=Res;
ELSIF Count=15 THEN V17:=Res;
ELSIF Count=16 THEN V19:=Res;
ELSIF Count=17 THEN V20:=Res;
ENDIF;
Count := Count +1;
);
TIMEOUT 2000
END;
TELEGRAM Status NAMED "Komfo status" IS
QUESTION
DATA[0] := BYTE(Id);
DATA[1] := HEX(03);
DATA[2] := RWORD(162); % modbus start register
DATA[4] := RWORD(1); % read number of registers
ANSWER SIZE 7
DATA[0] = BYTE(Id);
DATA[1] = HEX(03);
DATA[2] = BYTE(2);
DATA[3] -> RWORD(V18:=DATA;);
TIMEOUT 2000
END;
END;
Användarnas noteringar
Du måste vara inloggad för att göra en notering. Bli medlem eller logga in. Vi använder en moderator som godkänner noteringarna innan de visas.