Kamstrup multical 603
Detaljer
- Typ
- Drivrutin
- Upplaggd av
- Marcus Willander, Abelko Innovation
- Version
- 1
- Uppdaterad
- 2020-09-03
- Skapad
- 2020-09-03
- Kategori
- Energioptimering, M-bus, Mätare, Värme
- Visningar
- 4774
Beskrivning
Skript för Kamstrup Multical 603. Detta går att använda i en WMPro
Bruksanvisning
.
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 Kamstrup NAMED "Kamstrup 603" TYPEID 16358
IS
% --- Device created 20:16:00 2020-09-02
PARAMETER
Id :"Address"INT;
PUBLIC
IDNr : "ID number"INT;
rec1 : "Energy"["MWh"]DEC2;
rec3 : "Volume"["m³"]DEC2;
rec4 : "Flow Temperature"["°C"]DEC2;
rec5 : "Return Temperature"["°C"]DEC2;
rec6 : "Temperature Difference"["°K"]DEC2;
rec7 : "Power"["kW"]DEC2;
rec8 : "Volume Flow"["m³/h"]DEC2;
rec13 : "Fabrication No"[""]INT;
PRIVATE
Exp;
tmp;
BAUDRATE 2400;
PARITY EVEN;
CHECKSUM SUM8 SKIP 4;
POSTBYTES 1;
TELEGRAM Init NAMED "Init" IS
QUESTION
DATA[0] := HEX(10);
DATA[1] := HEX(40);
DATA[2] := BYTE(Id);
DATA[3] <- BYTE(DATA :=Id+64;);
DATA[4] := HEX(16);
ANSWER SIZE 1
DATA[0] = HEX(E5);
TIMEOUT 5000
END;
TELEGRAM Read NAMED "Read" IS
QUESTION
DATA[0] := HEX(10);
DATA[1] := HEX(5B);
DATA[2] := BYTE(Id);
DATA[3] <- BYTE(DATA :=Id+91;);
DATA[4] := HEX(16);
ANSWER SIZE 97
DATA[0] = HEX(68);
DATA[1] = HEX(5B);
DATA[2] = HEX(5B);
DATA[3] = HEX(68);
DATA[4] = HEX(08);
DATA[5] = BYTE(Id);
DATA[6] = HEX(72);
DATA[7] -> BYTE(IDNr := (DATA & HEX(F)) + 10*(DATA & HEX(F0))/16;);
DATA[8] -> BYTE(IDNr := IDNr + 100*(DATA & HEX(F)) + 1000*(DATA & HEX(F0))/16;);
DATA[9] -> BYTE(IDNr := IDNr + 10000*(DATA & HEX(F)) + 100000*(DATA & HEX(F0))/16;);
DATA[10] -> BYTE(IDNr := IDNr + 1000000*(DATA & HEX(F)) + 10000000*(DATA & HEX(F0))/16;);
DATA[14] = HEX(04);
% 32 bit integer
DATA[21] -> WORD(tmp:=DATA;);
DATA[23] -> WORD(tmp:=tmp + 65536*DATA; IF (tmp>2147483647) THEN rec1:=tmp-4294967296; ELSE rec1:=tmp; ENDIF;);
DATA[20] -> BYTE(Exp := (DATA & 7) - 3; rec1 := rec1*10^Exp; rec1 := rec1/1000000;);
% 32 bit integer
DATA[35] -> WORD(tmp:=DATA;);
DATA[37] -> WORD(tmp:=tmp + 65536*DATA; IF (tmp>2147483647) THEN rec3:=tmp-4294967296; ELSE rec3:=tmp; ENDIF;);
DATA[34] -> BYTE(Exp := (DATA & 7) - 6; rec3 := rec3*10^Exp;);
% 16 bit integer
DATA[41] -> WORD(tmp:=DATA; IF (tmp>32767) THEN rec4:=tmp-65536; ELSE rec4:=tmp; ENDIF;);
DATA[40] -> BYTE(Exp := (DATA & 3) - 3; rec4 := rec4*10^Exp;);
% 16 bit integer
DATA[45] -> WORD(tmp:=DATA; IF (tmp>32767) THEN rec5:=tmp-65536; ELSE rec5:=tmp; ENDIF;);
DATA[44] -> BYTE(Exp := (DATA & 3) - 3; rec5 := rec5*10^Exp;);
% 16 bit integer
DATA[49] -> WORD(tmp:=DATA; IF (tmp>32767) THEN rec6:=tmp-65536; ELSE rec6:=tmp; ENDIF;);
DATA[48] -> BYTE(Exp := (DATA & 3) - 3; rec6 := rec6*10^Exp;);
% 32 bit integer
DATA[53] -> WORD(tmp:=DATA;);
DATA[55] -> WORD(tmp:=tmp + 65536*DATA; IF (tmp>2147483647) THEN rec7:=tmp-4294967296; ELSE rec7:=tmp; ENDIF;);
DATA[52] -> BYTE(Exp := (DATA & 7) - 3; rec7 := rec7*10^Exp; rec7 := rec7/1000;);
% 32 bit integer
DATA[59] -> WORD(tmp:=DATA;);
DATA[61] -> WORD(tmp:=tmp + 65536*DATA; IF (tmp>2147483647) THEN rec8:=tmp-4294967296; ELSE rec8:=tmp; ENDIF;);
DATA[58] -> BYTE(Exp := (DATA & 7) - 6; rec8 := rec8*10^Exp;);
% 32 bit integer
DATA[91] -> WORD(tmp:=DATA;);
DATA[93] -> WORD(tmp:=tmp + 65536*DATA; IF (tmp>2147483647) THEN rec13:=tmp-4294967296; ELSE rec13:=tmp; ENDIF;);
TIMEOUT 5000
END;
END;
IS
% --- Device created 20:16:00 2020-09-02
PARAMETER
Id :"Address"INT;
PUBLIC
IDNr : "ID number"INT;
rec1 : "Energy"["MWh"]DEC2;
rec3 : "Volume"["m³"]DEC2;
rec4 : "Flow Temperature"["°C"]DEC2;
rec5 : "Return Temperature"["°C"]DEC2;
rec6 : "Temperature Difference"["°K"]DEC2;
rec7 : "Power"["kW"]DEC2;
rec8 : "Volume Flow"["m³/h"]DEC2;
rec13 : "Fabrication No"[""]INT;
PRIVATE
Exp;
tmp;
BAUDRATE 2400;
PARITY EVEN;
CHECKSUM SUM8 SKIP 4;
POSTBYTES 1;
TELEGRAM Init NAMED "Init" IS
QUESTION
DATA[0] := HEX(10);
DATA[1] := HEX(40);
DATA[2] := BYTE(Id);
DATA[3] <- BYTE(DATA :=Id+64;);
DATA[4] := HEX(16);
ANSWER SIZE 1
DATA[0] = HEX(E5);
TIMEOUT 5000
END;
TELEGRAM Read NAMED "Read" IS
QUESTION
DATA[0] := HEX(10);
DATA[1] := HEX(5B);
DATA[2] := BYTE(Id);
DATA[3] <- BYTE(DATA :=Id+91;);
DATA[4] := HEX(16);
ANSWER SIZE 97
DATA[0] = HEX(68);
DATA[1] = HEX(5B);
DATA[2] = HEX(5B);
DATA[3] = HEX(68);
DATA[4] = HEX(08);
DATA[5] = BYTE(Id);
DATA[6] = HEX(72);
DATA[7] -> BYTE(IDNr := (DATA & HEX(F)) + 10*(DATA & HEX(F0))/16;);
DATA[8] -> BYTE(IDNr := IDNr + 100*(DATA & HEX(F)) + 1000*(DATA & HEX(F0))/16;);
DATA[9] -> BYTE(IDNr := IDNr + 10000*(DATA & HEX(F)) + 100000*(DATA & HEX(F0))/16;);
DATA[10] -> BYTE(IDNr := IDNr + 1000000*(DATA & HEX(F)) + 10000000*(DATA & HEX(F0))/16;);
DATA[14] = HEX(04);
% 32 bit integer
DATA[21] -> WORD(tmp:=DATA;);
DATA[23] -> WORD(tmp:=tmp + 65536*DATA; IF (tmp>2147483647) THEN rec1:=tmp-4294967296; ELSE rec1:=tmp; ENDIF;);
DATA[20] -> BYTE(Exp := (DATA & 7) - 3; rec1 := rec1*10^Exp; rec1 := rec1/1000000;);
% 32 bit integer
DATA[35] -> WORD(tmp:=DATA;);
DATA[37] -> WORD(tmp:=tmp + 65536*DATA; IF (tmp>2147483647) THEN rec3:=tmp-4294967296; ELSE rec3:=tmp; ENDIF;);
DATA[34] -> BYTE(Exp := (DATA & 7) - 6; rec3 := rec3*10^Exp;);
% 16 bit integer
DATA[41] -> WORD(tmp:=DATA; IF (tmp>32767) THEN rec4:=tmp-65536; ELSE rec4:=tmp; ENDIF;);
DATA[40] -> BYTE(Exp := (DATA & 3) - 3; rec4 := rec4*10^Exp;);
% 16 bit integer
DATA[45] -> WORD(tmp:=DATA; IF (tmp>32767) THEN rec5:=tmp-65536; ELSE rec5:=tmp; ENDIF;);
DATA[44] -> BYTE(Exp := (DATA & 3) - 3; rec5 := rec5*10^Exp;);
% 16 bit integer
DATA[49] -> WORD(tmp:=DATA; IF (tmp>32767) THEN rec6:=tmp-65536; ELSE rec6:=tmp; ENDIF;);
DATA[48] -> BYTE(Exp := (DATA & 3) - 3; rec6 := rec6*10^Exp;);
% 32 bit integer
DATA[53] -> WORD(tmp:=DATA;);
DATA[55] -> WORD(tmp:=tmp + 65536*DATA; IF (tmp>2147483647) THEN rec7:=tmp-4294967296; ELSE rec7:=tmp; ENDIF;);
DATA[52] -> BYTE(Exp := (DATA & 7) - 3; rec7 := rec7*10^Exp; rec7 := rec7/1000;);
% 32 bit integer
DATA[59] -> WORD(tmp:=DATA;);
DATA[61] -> WORD(tmp:=tmp + 65536*DATA; IF (tmp>2147483647) THEN rec8:=tmp-4294967296; ELSE rec8:=tmp; ENDIF;);
DATA[58] -> BYTE(Exp := (DATA & 7) - 6; rec8 := rec8*10^Exp;);
% 32 bit integer
DATA[91] -> WORD(tmp:=DATA;);
DATA[93] -> WORD(tmp:=tmp + 65536*DATA; IF (tmp>2147483647) THEN rec13:=tmp-4294967296; ELSE rec13:=tmp; ENDIF;);
TIMEOUT 5000
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.