Actaris CF55
Detaljer
Beskrivning
.
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 CF55 NAMED "Actaris CF55" TYPEID 10746
IS
% --- Device created 12:54:07 2017-05-05
PARAMETER
Id :"Address"INT;
PUBLIC
IDNr : "MätarID"INT;
rec1 : "MEA41 i-verk"["kWh"];
rec2 : "MFA41 i-verk"["m³"]DEC2;
rec3 : "ME41 i-verk"["kW"]DEC4;
rec4 : "MF41 i-verk"["m³/h"]DEC2;
rec5 : "GT41 i-verk"["°C"]DEC2;
rec6 : "GT42 i-verk"["°C"]DEC2;
rec7 : "dT i-verk"["°K"]DEC2;
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 67
DATA[0] = HEX(68);
DATA[1] = HEX(3D);
DATA[2] = HEX(3D);
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)/1000;);
% 8 digit BCD
DATA[27] -> BYTE(rec2 := (DATA & HEX(F)) + 10*(DATA & HEX(F0))/16;);
DATA[28] -> BYTE(rec2 := rec2 + 100*(DATA & HEX(F)) + 1000*(DATA & HEX(F0))/16;);
DATA[29] -> BYTE(rec2 := rec2 + 10000*(DATA & HEX(F)) + 100000*(DATA & HEX(F0))/16;);
DATA[30] -> BYTE(rec2 := rec2 + 1000000*(DATA & HEX(F)); IF (DATA & HEX(F0) = HEX(F0)) THEN rec2 := 0-rec2; ELSE rec2:=rec2 + 10000000*(DATA & HEX(F0))/16; ENDIF;);
DATA[26] -> BYTE(Exp := (DATA & 7) - 6; rec2 := rec2*10^Exp;);
% 6 digit BCD
DATA[33] -> BYTE(rec3 := (DATA & HEX(F)) + 10*(DATA & HEX(F0))/16;);
DATA[34] -> BYTE(rec3 := rec3 + 100*(DATA & HEX(F)) + 1000*(DATA & HEX(F0))/16;);
DATA[35] -> BYTE(rec3 := rec3 + 10000*(DATA & HEX(F)); IF (DATA & HEX(F0) = HEX(F0)) THEN rec3 := 0-rec3; ELSE rec3:=rec3 + 100000*(DATA & HEX(F0))/16; ENDIF;);
DATA[32] -> BYTE(Exp := (DATA & 7) - 3; rec3 := (rec3*10^Exp)/1000;);
% 6 digit BCD
DATA[38] -> BYTE(rec4 := (DATA & HEX(F)) + 10*(DATA & HEX(F0))/16;);
DATA[39] -> BYTE(rec4 := rec4 + 100*(DATA & HEX(F)) + 1000*(DATA & HEX(F0))/16;);
DATA[40] -> BYTE(rec4 := rec4 + 10000*(DATA & HEX(F)); IF (DATA & HEX(F0) = HEX(F0)) THEN rec4 := 0-rec4; ELSE rec4:=rec4 + 100000*(DATA & HEX(F0))/16; ENDIF;);
DATA[37] -> BYTE(Exp := (DATA & 7) - 6; rec4 := rec4*10^Exp;);
% 4 digit BCD
DATA[43] -> BYTE(rec5 := (DATA & HEX(F)) + 10*(DATA & HEX(F0))/16;);
DATA[44] -> BYTE(rec5 := rec5 + 100*(DATA & HEX(F)); IF (DATA & HEX(F0) = HEX(F0)) THEN rec5 := 0-rec5; ELSE rec5:=rec5 + 1000*(DATA & HEX(F0))/16; ENDIF;);
DATA[42] -> BYTE(Exp := (DATA & 3) - 3; rec5 := rec5*10^Exp;);
% 4 digit BCD
DATA[47] -> BYTE(rec6 := (DATA & HEX(F)) + 10*(DATA & HEX(F0))/16;);
DATA[48] -> BYTE(rec6 := rec6 + 100*(DATA & HEX(F)); IF (DATA & HEX(F0) = HEX(F0)) THEN rec6 := 0-rec6; ELSE rec6:=rec6 + 1000*(DATA & HEX(F0))/16; ENDIF;);
DATA[46] -> BYTE(Exp := (DATA & 3) - 3; rec6 := rec6*10^Exp;);
% 6 digit BCD
DATA[51] -> BYTE(rec7 := (DATA & HEX(F)) + 10*(DATA & HEX(F0))/16;);
DATA[52] -> BYTE(rec7 := rec7 + 100*(DATA & HEX(F)) + 1000*(DATA & HEX(F0))/16;);
DATA[53] -> BYTE(rec7 := rec7 + 10000*(DATA & HEX(F)); IF (DATA & HEX(F0) = HEX(F0)) THEN rec7 := 0-rec7; ELSE rec7:=rec7 + 100000*(DATA & HEX(F0))/16; ENDIF;);
DATA[50] -> BYTE(Exp := (DATA & 3) - 3; rec7 := rec7*10^Exp;);
TIMEOUT 5000
END;
END;
IS
% --- Device created 12:54:07 2017-05-05
PARAMETER
Id :"Address"INT;
PUBLIC
IDNr : "MätarID"INT;
rec1 : "MEA41 i-verk"["kWh"];
rec2 : "MFA41 i-verk"["m³"]DEC2;
rec3 : "ME41 i-verk"["kW"]DEC4;
rec4 : "MF41 i-verk"["m³/h"]DEC2;
rec5 : "GT41 i-verk"["°C"]DEC2;
rec6 : "GT42 i-verk"["°C"]DEC2;
rec7 : "dT i-verk"["°K"]DEC2;
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 67
DATA[0] = HEX(68);
DATA[1] = HEX(3D);
DATA[2] = HEX(3D);
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)/1000;);
% 8 digit BCD
DATA[27] -> BYTE(rec2 := (DATA & HEX(F)) + 10*(DATA & HEX(F0))/16;);
DATA[28] -> BYTE(rec2 := rec2 + 100*(DATA & HEX(F)) + 1000*(DATA & HEX(F0))/16;);
DATA[29] -> BYTE(rec2 := rec2 + 10000*(DATA & HEX(F)) + 100000*(DATA & HEX(F0))/16;);
DATA[30] -> BYTE(rec2 := rec2 + 1000000*(DATA & HEX(F)); IF (DATA & HEX(F0) = HEX(F0)) THEN rec2 := 0-rec2; ELSE rec2:=rec2 + 10000000*(DATA & HEX(F0))/16; ENDIF;);
DATA[26] -> BYTE(Exp := (DATA & 7) - 6; rec2 := rec2*10^Exp;);
% 6 digit BCD
DATA[33] -> BYTE(rec3 := (DATA & HEX(F)) + 10*(DATA & HEX(F0))/16;);
DATA[34] -> BYTE(rec3 := rec3 + 100*(DATA & HEX(F)) + 1000*(DATA & HEX(F0))/16;);
DATA[35] -> BYTE(rec3 := rec3 + 10000*(DATA & HEX(F)); IF (DATA & HEX(F0) = HEX(F0)) THEN rec3 := 0-rec3; ELSE rec3:=rec3 + 100000*(DATA & HEX(F0))/16; ENDIF;);
DATA[32] -> BYTE(Exp := (DATA & 7) - 3; rec3 := (rec3*10^Exp)/1000;);
% 6 digit BCD
DATA[38] -> BYTE(rec4 := (DATA & HEX(F)) + 10*(DATA & HEX(F0))/16;);
DATA[39] -> BYTE(rec4 := rec4 + 100*(DATA & HEX(F)) + 1000*(DATA & HEX(F0))/16;);
DATA[40] -> BYTE(rec4 := rec4 + 10000*(DATA & HEX(F)); IF (DATA & HEX(F0) = HEX(F0)) THEN rec4 := 0-rec4; ELSE rec4:=rec4 + 100000*(DATA & HEX(F0))/16; ENDIF;);
DATA[37] -> BYTE(Exp := (DATA & 7) - 6; rec4 := rec4*10^Exp;);
% 4 digit BCD
DATA[43] -> BYTE(rec5 := (DATA & HEX(F)) + 10*(DATA & HEX(F0))/16;);
DATA[44] -> BYTE(rec5 := rec5 + 100*(DATA & HEX(F)); IF (DATA & HEX(F0) = HEX(F0)) THEN rec5 := 0-rec5; ELSE rec5:=rec5 + 1000*(DATA & HEX(F0))/16; ENDIF;);
DATA[42] -> BYTE(Exp := (DATA & 3) - 3; rec5 := rec5*10^Exp;);
% 4 digit BCD
DATA[47] -> BYTE(rec6 := (DATA & HEX(F)) + 10*(DATA & HEX(F0))/16;);
DATA[48] -> BYTE(rec6 := rec6 + 100*(DATA & HEX(F)); IF (DATA & HEX(F0) = HEX(F0)) THEN rec6 := 0-rec6; ELSE rec6:=rec6 + 1000*(DATA & HEX(F0))/16; ENDIF;);
DATA[46] -> BYTE(Exp := (DATA & 3) - 3; rec6 := rec6*10^Exp;);
% 6 digit BCD
DATA[51] -> BYTE(rec7 := (DATA & HEX(F)) + 10*(DATA & HEX(F0))/16;);
DATA[52] -> BYTE(rec7 := rec7 + 100*(DATA & HEX(F)) + 1000*(DATA & HEX(F0))/16;);
DATA[53] -> BYTE(rec7 := rec7 + 10000*(DATA & HEX(F)); IF (DATA & HEX(F0) = HEX(F0)) THEN rec7 := 0-rec7; ELSE rec7:=rec7 + 100000*(DATA & HEX(F0))/16; ENDIF;);
DATA[50] -> BYTE(Exp := (DATA & 3) - 3; rec7 := rec7*10^Exp;);
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.