ABB SF4 Energimätare Kommunikations script
Detaljer
- Typ
- Drivrutin
- Upplaggd av
- Jens Marklund, Abelko Innovation
- Version
- 3
- Uppdaterad
- 2013-09-02
- Skapad
- 2013-08-26
- Kategori
- M-bus, Mätare, Övriga protokoll
- Visningar
- 3351
Beskrivning
Kommunikations script för ABB SF4 Energimätare
Bruksanvisning
Kommunikations script för ABB SF4 Energimätare
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 ABB_SF4 NAMED "ABB_SF4" TYPEID 1234
IS
% --- Device created 11:28:11 2013-08-21
PARAMETER
Id :"Address"INT;
PUBLIC
IDNr : "ID number"INT;
rec1 : "Energy"["kWh"]INT;
rec2 : "Volume"["m³"]DEC2;
rec3 : "Volume"["m³"]DEC2;
rec4 : "Flow Temperature"["°C"]DEC2;
rec5 : "Return Temperature"["°C"]DEC2;
rec6 : "Temperature Difference"["°K"]DEC2;
rec9 : "Volume Flow"["m³/h"]DEC2;
rec10 : "Power"["kW"]DEC2;
PRIVATE
Exp;
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+91;);
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 150
DATA[0] = HEX(68);
DATA[1] = HEX(90);
DATA[2] = HEX(90);
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);
DATA[21] -> WORD(rec1:=DATA;);
DATA[23] -> WORD(rec1:=(rec1 + 65536*DATA););
DATA[20] -> BYTE(Exp := DATA & 7 - 3; rec1 := (rec1*10^Exp)/1000;);
DATA[27] -> WORD(rec2:=DATA;);
DATA[29] -> WORD(rec2:=rec2 + 65536*DATA;);
DATA[26] -> BYTE(Exp := DATA & 7 - 6; rec2 := rec2*10^Exp;);
DATA[34] -> WORD(rec3:=DATA;);
DATA[36] -> WORD(rec3:=rec3 + 65536*DATA;);
DATA[33] -> BYTE(Exp := DATA & 7 - 6; rec3 := rec3*10^Exp;);
DATA[40] -> WORD(rec4:=DATA;);
DATA[39] -> BYTE(Exp := DATA & 3 - 3; rec4 := rec4*10^Exp;);
DATA[44] -> WORD(rec5:=DATA;);
DATA[43] -> BYTE(Exp := DATA & 3 - 3; rec5 := rec5*10^Exp;);
DATA[48] -> WORD(rec6:=DATA;);
DATA[47] -> BYTE(Exp := DATA & 3 - 3; rec6 := rec6*10^Exp;);
DATA[64] -> WORD(rec9:=DATA;);
DATA[66] -> WORD(rec9:=rec9 + 65536*DATA;);
DATA[63] -> BYTE(Exp := DATA & 7 - 6; rec9 := rec9*10^Exp;);
DATA[70] -> WORD(rec10:=DATA;);
DATA[72] -> WORD(rec10:=(rec10 + 65536*DATA););
DATA[69] -> BYTE(Exp := DATA & 7 - 3; rec10 := (rec10*10^Exp)/1000;);
TIMEOUT 5000
END;
END;
IS
% --- Device created 11:28:11 2013-08-21
PARAMETER
Id :"Address"INT;
PUBLIC
IDNr : "ID number"INT;
rec1 : "Energy"["kWh"]INT;
rec2 : "Volume"["m³"]DEC2;
rec3 : "Volume"["m³"]DEC2;
rec4 : "Flow Temperature"["°C"]DEC2;
rec5 : "Return Temperature"["°C"]DEC2;
rec6 : "Temperature Difference"["°K"]DEC2;
rec9 : "Volume Flow"["m³/h"]DEC2;
rec10 : "Power"["kW"]DEC2;
PRIVATE
Exp;
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+91;);
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 150
DATA[0] = HEX(68);
DATA[1] = HEX(90);
DATA[2] = HEX(90);
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);
DATA[21] -> WORD(rec1:=DATA;);
DATA[23] -> WORD(rec1:=(rec1 + 65536*DATA););
DATA[20] -> BYTE(Exp := DATA & 7 - 3; rec1 := (rec1*10^Exp)/1000;);
DATA[27] -> WORD(rec2:=DATA;);
DATA[29] -> WORD(rec2:=rec2 + 65536*DATA;);
DATA[26] -> BYTE(Exp := DATA & 7 - 6; rec2 := rec2*10^Exp;);
DATA[34] -> WORD(rec3:=DATA;);
DATA[36] -> WORD(rec3:=rec3 + 65536*DATA;);
DATA[33] -> BYTE(Exp := DATA & 7 - 6; rec3 := rec3*10^Exp;);
DATA[40] -> WORD(rec4:=DATA;);
DATA[39] -> BYTE(Exp := DATA & 3 - 3; rec4 := rec4*10^Exp;);
DATA[44] -> WORD(rec5:=DATA;);
DATA[43] -> BYTE(Exp := DATA & 3 - 3; rec5 := rec5*10^Exp;);
DATA[48] -> WORD(rec6:=DATA;);
DATA[47] -> BYTE(Exp := DATA & 3 - 3; rec6 := rec6*10^Exp;);
DATA[64] -> WORD(rec9:=DATA;);
DATA[66] -> WORD(rec9:=rec9 + 65536*DATA;);
DATA[63] -> BYTE(Exp := DATA & 7 - 6; rec9 := rec9*10^Exp;);
DATA[70] -> WORD(rec10:=DATA;);
DATA[72] -> WORD(rec10:=(rec10 + 65536*DATA););
DATA[69] -> BYTE(Exp := DATA & 7 - 3; rec10 := (rec10*10^Exp)/1000;);
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.