Elvaco CMa20 trådad utomhusgivare
Detaljer
- Typ
- Drivrutin
- Upplaggd av
- Marcus Willander, Abelko Innovation
- Version
- 1
- Uppdaterad
- 2017-02-28
- Skapad
- 2017-02-28
- Kategori
- Allmän automation, Energioptimering, M-bus, Mätare
- Visningar
- 2810
Beskrivning
Elvacos CMa20, trådade varianten.
3 temp och 3 relativ luftfuktighet. Fungerar både i WMP och Ultra.
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 CMa20 NAMED "Elvaco CMa20" TYPEID 312312
IS
PARAMETER
Id :"Address"INT;
PUBLIC
IDNr : "ID number"INT;
rec2 : "RH Now"["%"]DEC2;
rec3 : "RH Min"["%"]DEC2;
rec4 : "RH Max"["%"]DEC2;
rec5 : "Temperature Now"["°C"]DEC2;
rec6 : "Temperature Min"["°C"]DEC2;
rec7 : "Temperature Max"["°C"]DEC2;
PRIVATE
Exp;
tmp;
BAUDRATE 2400;
PARITY EVEN;
CHRGAPTIMEOUT 10;
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 83
DATA[0] = HEX(68);
DATA[1] = HEX(4D);
DATA[2] = HEX(4D);
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(1B);
% 16 bit integer
DATA[27] -> WORD(tmp:=DATA; IF (tmp>32767) THEN rec2:=(tmp-65536)/100; ELSE rec2:=tmp/100; ENDIF;);
% 16 bit integer
DATA[33] -> WORD(tmp:=DATA; IF (tmp>32767) THEN rec3:=(tmp-65536)/100; ELSE rec3:=tmp/100; ENDIF;);
% 16 bit integer
DATA[39] -> WORD(tmp:=DATA; IF (tmp>32767) THEN rec4:=(tmp-65536)/100; ELSE rec4:=tmp/100; ENDIF;);
% 16 bit integer
DATA[43] -> WORD(tmp:=DATA; IF (tmp>32767) THEN rec5:=tmp-65536; ELSE rec5:=tmp; ENDIF;);
DATA[42] -> BYTE(Exp := (DATA & 3) - 3; rec5 := rec5*10^Exp;);
% 16 bit integer
DATA[47] -> WORD(tmp:=DATA; IF (tmp>32767) THEN rec6:=tmp-65536; ELSE rec6:=tmp; ENDIF;);
DATA[46] -> BYTE(Exp := (DATA & 3) - 3; rec6 := rec6*10^Exp;);
% 16 bit integer
DATA[51] -> WORD(tmp:=DATA; IF (tmp>32767) THEN rec7:=tmp-65536; ELSE rec7:=tmp; ENDIF;);
DATA[50] -> BYTE(Exp := (DATA & 3) - 3; rec7 := rec7*10^Exp;);
% 8 digit BCD
TIMEOUT 5000
END;
END;
IS
PARAMETER
Id :"Address"INT;
PUBLIC
IDNr : "ID number"INT;
rec2 : "RH Now"["%"]DEC2;
rec3 : "RH Min"["%"]DEC2;
rec4 : "RH Max"["%"]DEC2;
rec5 : "Temperature Now"["°C"]DEC2;
rec6 : "Temperature Min"["°C"]DEC2;
rec7 : "Temperature Max"["°C"]DEC2;
PRIVATE
Exp;
tmp;
BAUDRATE 2400;
PARITY EVEN;
CHRGAPTIMEOUT 10;
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 83
DATA[0] = HEX(68);
DATA[1] = HEX(4D);
DATA[2] = HEX(4D);
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(1B);
% 16 bit integer
DATA[27] -> WORD(tmp:=DATA; IF (tmp>32767) THEN rec2:=(tmp-65536)/100; ELSE rec2:=tmp/100; ENDIF;);
% 16 bit integer
DATA[33] -> WORD(tmp:=DATA; IF (tmp>32767) THEN rec3:=(tmp-65536)/100; ELSE rec3:=tmp/100; ENDIF;);
% 16 bit integer
DATA[39] -> WORD(tmp:=DATA; IF (tmp>32767) THEN rec4:=(tmp-65536)/100; ELSE rec4:=tmp/100; ENDIF;);
% 16 bit integer
DATA[43] -> WORD(tmp:=DATA; IF (tmp>32767) THEN rec5:=tmp-65536; ELSE rec5:=tmp; ENDIF;);
DATA[42] -> BYTE(Exp := (DATA & 3) - 3; rec5 := rec5*10^Exp;);
% 16 bit integer
DATA[47] -> WORD(tmp:=DATA; IF (tmp>32767) THEN rec6:=tmp-65536; ELSE rec6:=tmp; ENDIF;);
DATA[46] -> BYTE(Exp := (DATA & 3) - 3; rec6 := rec6*10^Exp;);
% 16 bit integer
DATA[51] -> WORD(tmp:=DATA; IF (tmp>32767) THEN rec7:=tmp-65536; ELSE rec7:=tmp; ENDIF;);
DATA[50] -> BYTE(Exp := (DATA & 3) - 3; rec7 := rec7*10^Exp;);
% 8 digit BCD
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.