Menerga (avfuktare)
Detaljer
- Typ
- Drivrutin
- Upplaggd av
- Ove Jansson, Abelko Innovation
- Version
- 1
- Uppdaterad
- 2013-08-27
- Skapad
- 2013-08-27
- Kategori
- Modbus, Ventilation
- Visningar
- 2092
Beskrivning
Device definition for Menerga dehumidifier
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
DEVICETYPE Menerga NAMED "Menerga" TYPEID 21164
IS
% Device definition for Menerga dehumidifier
% ABELKO AB Luleå
% Modifierad 091007 PW: B-larm erhålls på bit 13 (8192=2000h)
% Registerläsning justerad utan larminläsning
% Teckenhantering för alla temperaturer
%
PARAMETER
Id : "Id";
bFukt : "Fuktnivå";
bTemp : "Tempnivå";
bb : "Start";
PUBLIC
fMv : "FL Fukt Mv" ["%r.F."];
tMv : "FL Temp Mv" ["°C"];
tPVV : "TL Temp PVV" ["°C"];
tUtr : "UL Temp aggr." ["°C"];
tExt : "UL Temp ext." ["°C"];
spjAU : "UL Spjäll" ["%"];
spjFO : "AL Spjäll" ["%"];
spjULv : "RL Spjäll uppv." ["%"];
spjULf : "RL Spjäll avfukt" ["%"];
spjBP : "REKU Spjäll Bypass" ["%"];
fAggr : "FL Fukt aggr.1" ["%r.F."];
tAggr : "FL Temp aggr.1" ["°C"];
PVVVentil : "PVV Ventil" ["%"];
lfTL : "TL Luftflöde" ["m3/h"];
lfFL : "FL Luftflöde" ["m3/h"];
ALarm : "A Larm";
BLarm : "B Larm";
fl : "fl";
PRIVATE
Tmp;
i;
j;
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM Read NAMED "Read" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(04); % Modbus command "04h" read multiple input registers
DATA[2] <- RWORD(
i:=i+1;
IF (i<1) OR (i>15) THEN
i:=1;
ENDIF;
DATA:=i;); % start register
DATA[4] := RWORD(1); % number of registers to read
ANSWER SIZE 7
DATA[0] = BYTE(Id);
DATA[1] = HEX(04);
DATA[3]->RWORD(
IF (i=1) THEN
fMv := DATA/10;
ELSIF (i=2) THEN
IF (DATA>32767) THEN
tMv := (DATA-65536)/10;
ELSE
tMv := DATA/10;
ENDIF;
ELSIF (i=3) THEN
IF (DATA>32767) THEN
tPVV := (DATA-65536)/10;
ELSE
tPVV := DATA/10;
ENDIF;
ELSIF (i=4) THEN
IF (DATA>32767) THEN
tUtr := (DATA-65536)/10;
ELSE
tUtr := DATA/10;
ENDIF;
ELSIF (i=5) THEN
IF (DATA>32767) THEN
tExt := (DATA-65536)/10;
ELSE
tExt := DATA/10;
ENDIF;
ELSIF (i=6) THEN
spjAU :=DATA/10;
ELSIF (i=7) THEN
spjFO :=DATA/10;
ELSIF (i=8) THEN
spjULv :=DATA/10;
ELSIF (i=9) THEN
spjULf :=DATA/10;
ELSIF (i=10) THEN
spjBP :=DATA/10;
ELSIF (i=11) THEN
fAggr :=DATA/10;
ELSIF (i=12) THEN
IF (DATA>32767) THEN
tAggr := (DATA-65536)/10;
ELSE
tAggr := DATA/10;
ENDIF;
ELSIF (i=13) THEN
PVVVentil :=DATA/10;
ELSIF (i=14) THEN
lfTL :=DATA/10;
ELSIF (i=15) THEN
lfFL :=DATA/10;
ENDIF;
);
TIMEOUT 300
END;
TELEGRAM ReadAlarms NAMED "ReadAlarms" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(02); % Modbus command "01h" read multiple inputcoils
DATA[2] := RWORD(300); % start addres
DATA[4] := RWORD(16); % number of coils to read
ANSWER SIZE 7
DATA[0] = BYTE(Id);
DATA[3]->WORD(IF (DATA & 4096) THEN ALarm:=1; ELSE ALarm:=0;ENDIF;
IF (DATA & 8192) THEN BLarm:=1; ELSE BLarm:=0;ENDIF;
);
TIMEOUT 300
END;
TELEGRAM WriteSettings NAMED "Write Settings" IS
QUESTION
DATA[0] := BYTE(Id);
DATA[1] := HEX(10); % write multiple registers
DATA[2] := HEX(01);
DATA[3] <- BYTE(IF (j>2) THEN j:=1;ENDIF;IF (j=0) THEN DATA:=88; ELSE DATA:=243+j; ENDIF;);
DATA[4] := HEX(00);
DATA[5] := HEX(01); % number of registers
DATA[6] := HEX(02); % byte count
DATA[7] <- RWORD(
IF (j=1) THEN DATA:= bFukt*10;
ELSIF (j=2) THEN DATA:= bTemp*10;
ENDIF;
j:=j+1;
);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = HEX(10);
TIMEOUT 300
END;
TELEGRAM WriteFlags NAMED "WriteFlags" IS
QUESTION
DATA[0] := BYTE(Id);
DATA[1] := HEX(05); % writesingle coil
DATA[2] := RWORD(600); % region
DATA[4] <- RWORD(IF (bb>0) THEN DATA:=65535; ELSE DATA:=0; ENDIF;);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
TIMEOUT 300
END;
END;
DEVICETYPE Menerga2 NAMED "Menerga2" TYPEID 21165
IS
% Device definition for Menerga dehumidifier
%
% ABELKO AB Luleå
%
PARAMETER
Id : "Id";
PUBLIC
fMv : "FL Fukt Mv" ["%r.F."];
tMv : "FL Temp Mv" ["°C"];
tPVV : "TL Temp PVV" ["°C"];
tUtr : "UL Temp aggr." ["°C"];
tExt : "UL Temp ext." ["°C"];
spjAU : "UL Spjäll" ["%"];
spjFO : "AL Spjäll" ["%"];
spjULv : "RL Spjäll uppv." ["%"];
spjULf : "RL Spjäll avfukt" ["%"];
spjBP : "REKU Spjäll Bypass" ["%"];
fAggr : "FL Fukt aggr.1" ["%r.F."];
tAggr : "FL Temp aggr.1" ["°C"];
PVVVentil : "PVV Ventil" ["%"];
lfTL : "TL Luftflöde" ["m3/h"];
lfFL : "FL Luftflöde" ["m3/h"];
ALarm : "A Larm";
BLarm : "B Larm";
PRIVATE
Tmp;
i;
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM Read NAMED "Read" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(04); % Modbus command "04h" read multiple inputregisters
DATA[2] <- RWORD(
i:=i+1;
IF (i<31) OR (i>45) THEN
i:=31;
ENDIF;
DATA:=i;
); % start register
DATA[4] := RWORD(1); % number of registers to read
ANSWER SIZE 7
DATA[0] = BYTE(Id);
DATA[1] = HEX(04);
DATA[3]->RWORD(
IF (i=31) THEN
fMv := DATA/10;
ELSIF (i=32) THEN
IF (DATA>32767) THEN
tMv := (DATA-65536)/10;
ELSE
tMv := DATA/10;
ENDIF;
ELSIF (i=33) THEN
IF (DATA>32767) THEN
tPVV := (DATA-65536)/10;
ELSE
tPVV := DATA/10;
ENDIF;
ELSIF (i=34) THEN
IF (DATA>32767) THEN
tUtr := (DATA-65536)/10;
ELSE
tUtr := DATA/10;
ENDIF;
ELSIF (i=35) THEN
IF (DATA>32767) THEN
tExt := (DATA-65536)/10;
ELSE
tExt := DATA/10;
ENDIF;
ELSIF (i=36) THEN
spjAU :=DATA/10;
ELSIF (i=37) THEN
spjFO :=DATA/10;
ELSIF (i=38) THEN
spjULv :=DATA/10;
ELSIF (i=39) THEN
spjULf :=DATA/10;
ELSIF (i=40) THEN
spjBP :=DATA/10;
ELSIF (i=41) THEN
fAggr :=DATA/10;
ELSIF (i=42) THEN
IF (DATA>32767) THEN
tAggr := (DATA-65536)/10;
ELSE
tAggr := DATA/10;
ENDIF;
ELSIF (i=43) THEN
PVVVentil :=DATA/10;
ELSIF (i=44) THEN
lfTL :=DATA/10;
ELSIF (i=45) THEN
lfFL :=DATA/10;
ENDIF;
);
TIMEOUT 300
END;
TELEGRAM ReadAlarms NAMED "ReadAlarms" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(02); % Modbus command "01h" read multiple inputcoils
DATA[2] := RWORD(330); % start addres
DATA[4] := RWORD(16); % number of coils to read
ANSWER SIZE 7
DATA[0] = BYTE(Id);
DATA[3]->WORD(IF (DATA & 4096) THEN ALarm:=1; ELSE ALarm:=0;ENDIF;
IF (DATA & 8192) THEN BLarm:=1; ELSE BLarm:=0;ENDIF;
);
TIMEOUT 300
END;
END;
IS
% Device definition for Menerga dehumidifier
% ABELKO AB Luleå
% Modifierad 091007 PW: B-larm erhålls på bit 13 (8192=2000h)
% Registerläsning justerad utan larminläsning
% Teckenhantering för alla temperaturer
%
PARAMETER
Id : "Id";
bFukt : "Fuktnivå";
bTemp : "Tempnivå";
bb : "Start";
PUBLIC
fMv : "FL Fukt Mv" ["%r.F."];
tMv : "FL Temp Mv" ["°C"];
tPVV : "TL Temp PVV" ["°C"];
tUtr : "UL Temp aggr." ["°C"];
tExt : "UL Temp ext." ["°C"];
spjAU : "UL Spjäll" ["%"];
spjFO : "AL Spjäll" ["%"];
spjULv : "RL Spjäll uppv." ["%"];
spjULf : "RL Spjäll avfukt" ["%"];
spjBP : "REKU Spjäll Bypass" ["%"];
fAggr : "FL Fukt aggr.1" ["%r.F."];
tAggr : "FL Temp aggr.1" ["°C"];
PVVVentil : "PVV Ventil" ["%"];
lfTL : "TL Luftflöde" ["m3/h"];
lfFL : "FL Luftflöde" ["m3/h"];
ALarm : "A Larm";
BLarm : "B Larm";
fl : "fl";
PRIVATE
Tmp;
i;
j;
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM Read NAMED "Read" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(04); % Modbus command "04h" read multiple input registers
DATA[2] <- RWORD(
i:=i+1;
IF (i<1) OR (i>15) THEN
i:=1;
ENDIF;
DATA:=i;); % start register
DATA[4] := RWORD(1); % number of registers to read
ANSWER SIZE 7
DATA[0] = BYTE(Id);
DATA[1] = HEX(04);
DATA[3]->RWORD(
IF (i=1) THEN
fMv := DATA/10;
ELSIF (i=2) THEN
IF (DATA>32767) THEN
tMv := (DATA-65536)/10;
ELSE
tMv := DATA/10;
ENDIF;
ELSIF (i=3) THEN
IF (DATA>32767) THEN
tPVV := (DATA-65536)/10;
ELSE
tPVV := DATA/10;
ENDIF;
ELSIF (i=4) THEN
IF (DATA>32767) THEN
tUtr := (DATA-65536)/10;
ELSE
tUtr := DATA/10;
ENDIF;
ELSIF (i=5) THEN
IF (DATA>32767) THEN
tExt := (DATA-65536)/10;
ELSE
tExt := DATA/10;
ENDIF;
ELSIF (i=6) THEN
spjAU :=DATA/10;
ELSIF (i=7) THEN
spjFO :=DATA/10;
ELSIF (i=8) THEN
spjULv :=DATA/10;
ELSIF (i=9) THEN
spjULf :=DATA/10;
ELSIF (i=10) THEN
spjBP :=DATA/10;
ELSIF (i=11) THEN
fAggr :=DATA/10;
ELSIF (i=12) THEN
IF (DATA>32767) THEN
tAggr := (DATA-65536)/10;
ELSE
tAggr := DATA/10;
ENDIF;
ELSIF (i=13) THEN
PVVVentil :=DATA/10;
ELSIF (i=14) THEN
lfTL :=DATA/10;
ELSIF (i=15) THEN
lfFL :=DATA/10;
ENDIF;
);
TIMEOUT 300
END;
TELEGRAM ReadAlarms NAMED "ReadAlarms" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(02); % Modbus command "01h" read multiple inputcoils
DATA[2] := RWORD(300); % start addres
DATA[4] := RWORD(16); % number of coils to read
ANSWER SIZE 7
DATA[0] = BYTE(Id);
DATA[3]->WORD(IF (DATA & 4096) THEN ALarm:=1; ELSE ALarm:=0;ENDIF;
IF (DATA & 8192) THEN BLarm:=1; ELSE BLarm:=0;ENDIF;
);
TIMEOUT 300
END;
TELEGRAM WriteSettings NAMED "Write Settings" IS
QUESTION
DATA[0] := BYTE(Id);
DATA[1] := HEX(10); % write multiple registers
DATA[2] := HEX(01);
DATA[3] <- BYTE(IF (j>2) THEN j:=1;ENDIF;IF (j=0) THEN DATA:=88; ELSE DATA:=243+j; ENDIF;);
DATA[4] := HEX(00);
DATA[5] := HEX(01); % number of registers
DATA[6] := HEX(02); % byte count
DATA[7] <- RWORD(
IF (j=1) THEN DATA:= bFukt*10;
ELSIF (j=2) THEN DATA:= bTemp*10;
ENDIF;
j:=j+1;
);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = HEX(10);
TIMEOUT 300
END;
TELEGRAM WriteFlags NAMED "WriteFlags" IS
QUESTION
DATA[0] := BYTE(Id);
DATA[1] := HEX(05); % writesingle coil
DATA[2] := RWORD(600); % region
DATA[4] <- RWORD(IF (bb>0) THEN DATA:=65535; ELSE DATA:=0; ENDIF;);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
TIMEOUT 300
END;
END;
DEVICETYPE Menerga2 NAMED "Menerga2" TYPEID 21165
IS
% Device definition for Menerga dehumidifier
%
% ABELKO AB Luleå
%
PARAMETER
Id : "Id";
PUBLIC
fMv : "FL Fukt Mv" ["%r.F."];
tMv : "FL Temp Mv" ["°C"];
tPVV : "TL Temp PVV" ["°C"];
tUtr : "UL Temp aggr." ["°C"];
tExt : "UL Temp ext." ["°C"];
spjAU : "UL Spjäll" ["%"];
spjFO : "AL Spjäll" ["%"];
spjULv : "RL Spjäll uppv." ["%"];
spjULf : "RL Spjäll avfukt" ["%"];
spjBP : "REKU Spjäll Bypass" ["%"];
fAggr : "FL Fukt aggr.1" ["%r.F."];
tAggr : "FL Temp aggr.1" ["°C"];
PVVVentil : "PVV Ventil" ["%"];
lfTL : "TL Luftflöde" ["m3/h"];
lfFL : "FL Luftflöde" ["m3/h"];
ALarm : "A Larm";
BLarm : "B Larm";
PRIVATE
Tmp;
i;
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM Read NAMED "Read" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(04); % Modbus command "04h" read multiple inputregisters
DATA[2] <- RWORD(
i:=i+1;
IF (i<31) OR (i>45) THEN
i:=31;
ENDIF;
DATA:=i;
); % start register
DATA[4] := RWORD(1); % number of registers to read
ANSWER SIZE 7
DATA[0] = BYTE(Id);
DATA[1] = HEX(04);
DATA[3]->RWORD(
IF (i=31) THEN
fMv := DATA/10;
ELSIF (i=32) THEN
IF (DATA>32767) THEN
tMv := (DATA-65536)/10;
ELSE
tMv := DATA/10;
ENDIF;
ELSIF (i=33) THEN
IF (DATA>32767) THEN
tPVV := (DATA-65536)/10;
ELSE
tPVV := DATA/10;
ENDIF;
ELSIF (i=34) THEN
IF (DATA>32767) THEN
tUtr := (DATA-65536)/10;
ELSE
tUtr := DATA/10;
ENDIF;
ELSIF (i=35) THEN
IF (DATA>32767) THEN
tExt := (DATA-65536)/10;
ELSE
tExt := DATA/10;
ENDIF;
ELSIF (i=36) THEN
spjAU :=DATA/10;
ELSIF (i=37) THEN
spjFO :=DATA/10;
ELSIF (i=38) THEN
spjULv :=DATA/10;
ELSIF (i=39) THEN
spjULf :=DATA/10;
ELSIF (i=40) THEN
spjBP :=DATA/10;
ELSIF (i=41) THEN
fAggr :=DATA/10;
ELSIF (i=42) THEN
IF (DATA>32767) THEN
tAggr := (DATA-65536)/10;
ELSE
tAggr := DATA/10;
ENDIF;
ELSIF (i=43) THEN
PVVVentil :=DATA/10;
ELSIF (i=44) THEN
lfTL :=DATA/10;
ELSIF (i=45) THEN
lfFL :=DATA/10;
ENDIF;
);
TIMEOUT 300
END;
TELEGRAM ReadAlarms NAMED "ReadAlarms" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(02); % Modbus command "01h" read multiple inputcoils
DATA[2] := RWORD(330); % start addres
DATA[4] := RWORD(16); % number of coils to read
ANSWER SIZE 7
DATA[0] = BYTE(Id);
DATA[3]->WORD(IF (DATA & 4096) THEN ALarm:=1; ELSE ALarm:=0;ENDIF;
IF (DATA & 8192) THEN BLarm:=1; ELSE BLarm:=0;ENDIF;
);
TIMEOUT 300
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.