IME Conto CE4DMID31 Elenergimätare
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
% Skapad med Modbus Creator
% - OBS! Användaren ansvarar själv för att samma TYPID inte används flera gånger i samma apparat.
% TYPID 10000-19999 är för användardefinierade enheter
% Gjort för kommunikation på 9600 8N1 Modbus RTU enligt PR123 (CE4DMID31)
DEVICETYPE CE4DMID31 NAMED "CE4DMID31" TYPEID 14196 IS
PARAMETER
Id : "Adress";
PUBLIC
V1 : "P1 voltage" ["mV"]INT;
V2 : "P2 voltage" ["mV"]INT;
V3 : "P3 voltage" ["mV"]INT;
V4 : "P1 current" ["mA"]INT;
V5 : "P2 current" ["mA"]INT;
V6 : "P3 current" ["mA"]INT;
V7 : "3P active power" ["W"]DEC2;
V8 : "3P reactive power" ["W"]DEC2;
V9 : "3P apparent power" ["W"]DEC2;
V10 : "Total power" ["kWh"]DEC2;
V11 : "Total reactive power" ["kWh"]DEC2;
V12 : "Average power" ["W"]DEC2;
V13 : "P1 active power" ["W"]DEC2;
V14 : "P2 active power" ["W"]DEC2;
V15 : "P3 active power" ["W"]DEC2;
V16 : "P1 reactive power" ["W"]DEC2;
V17 : "P2 reactive power" ["W"]DEC2;
V18 : "P3 reactive power" ["W"]DEC2;
PRIVATE
Tmp;
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM Read3 NAMED "Read 3" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(03); % Modbus kommando för att läsa register kod 03
DATA[2] := RWORD(4096); % Start address
DATA[4] := RWORD(66); % Antal register att läsa
ANSWER SIZE 137 % (Antal register * 2) + 5
DATA[0] = BYTE(Id);
DATA[1] = BYTE(03);
DATA[2] = BYTE(132); % Antal Bytes
DATA[3] -> RWORD(Tmp:=DATA*65536;);
DATA[5] -> RWORD(V1:=Tmp+DATA;);
DATA[7] -> RWORD(Tmp:=DATA*65536;);
DATA[9] -> RWORD(V2:=Tmp+DATA;);
DATA[11] -> RWORD(Tmp:=DATA*65536;);
DATA[13] -> RWORD(V3:=Tmp+DATA;);
DATA[15] -> RWORD(Tmp:=DATA*65536;);
DATA[17] -> RWORD(V4:=Tmp+DATA;);
DATA[19] -> RWORD(Tmp:=DATA*65536;);
DATA[21] -> RWORD(V5:=Tmp+DATA;);
DATA[23] -> RWORD(Tmp:=DATA*65536;);
DATA[25] -> RWORD(V6:=Tmp+DATA;);
DATA[43] -> RWORD(Tmp:=DATA*65536;);
DATA[45] -> RWORD(V7:=Tmp+DATA;);
DATA[47] -> RWORD(Tmp:=DATA*65536;);
DATA[49] -> RWORD(V8:=Tmp+DATA;);
DATA[51] -> RWORD(Tmp:=DATA*65536;);
DATA[53] -> RWORD(V9:=Tmp+DATA;);
DATA[55] -> RWORD(IF DATA=1 THEN V7:=V7*-1; ENDIF;);
DATA[57] -> RWORD(IF DATA=1 THEN V8:=V8*-1; ENDIF;);
DATA[61] -> RWORD(Tmp:=DATA*65536;);
DATA[63] -> RWORD(V10:=Tmp+DATA;);
DATA[65] -> RWORD(Tmp:=DATA*65536;);
DATA[67] -> RWORD(V11:=Tmp+DATA;);
DATA[83] -> RWORD(Tmp:=DATA*65536;);
DATA[85] -> RWORD(V12:=Tmp+DATA;);
DATA[91] -> RWORD(Tmp:=DATA*65536;);
DATA[93] -> RWORD(V13:=Tmp+DATA;);
DATA[95] -> RWORD(Tmp:=DATA*65536;);
DATA[97] -> RWORD(V14:=Tmp+DATA;);
DATA[99] -> RWORD(Tmp:=DATA*65536;);
DATA[101] -> RWORD(V15:=Tmp+DATA;);
DATA[103] -> RWORD(IF DATA=1 THEN V13:=V13*-1; ENDIF;);
DATA[105] -> RWORD(IF DATA=1 THEN V14:=V14*-1; ENDIF;);
DATA[107] -> RWORD(IF DATA=1 THEN V15:=V15*-1; ENDIF;);
DATA[109] -> RWORD(Tmp:=DATA*65536;);
DATA[111] -> RWORD(V16:=Tmp+DATA;);
DATA[113] -> RWORD(Tmp:=DATA*65536;);
DATA[115] -> RWORD(V17:=Tmp+DATA;);
DATA[117] -> RWORD(Tmp:=DATA*65536;);
DATA[119] -> RWORD(V18:=Tmp+DATA;);
DATA[121] -> RWORD(IF DATA=1 THEN V16:=V16*-1; ENDIF;);
DATA[123] -> RWORD(IF DATA=1 THEN V17:=V17*-1; ENDIF;);
DATA[125] -> RWORD(IF DATA=1 THEN V18:=V18*-1; ENDIF;);
TIMEOUT 300
END;
END;
% - OBS! Användaren ansvarar själv för att samma TYPID inte används flera gånger i samma apparat.
% TYPID 10000-19999 är för användardefinierade enheter
% Gjort för kommunikation på 9600 8N1 Modbus RTU enligt PR123 (CE4DMID31)
DEVICETYPE CE4DMID31 NAMED "CE4DMID31" TYPEID 14196 IS
PARAMETER
Id : "Adress";
PUBLIC
V1 : "P1 voltage" ["mV"]INT;
V2 : "P2 voltage" ["mV"]INT;
V3 : "P3 voltage" ["mV"]INT;
V4 : "P1 current" ["mA"]INT;
V5 : "P2 current" ["mA"]INT;
V6 : "P3 current" ["mA"]INT;
V7 : "3P active power" ["W"]DEC2;
V8 : "3P reactive power" ["W"]DEC2;
V9 : "3P apparent power" ["W"]DEC2;
V10 : "Total power" ["kWh"]DEC2;
V11 : "Total reactive power" ["kWh"]DEC2;
V12 : "Average power" ["W"]DEC2;
V13 : "P1 active power" ["W"]DEC2;
V14 : "P2 active power" ["W"]DEC2;
V15 : "P3 active power" ["W"]DEC2;
V16 : "P1 reactive power" ["W"]DEC2;
V17 : "P2 reactive power" ["W"]DEC2;
V18 : "P3 reactive power" ["W"]DEC2;
PRIVATE
Tmp;
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM Read3 NAMED "Read 3" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(03); % Modbus kommando för att läsa register kod 03
DATA[2] := RWORD(4096); % Start address
DATA[4] := RWORD(66); % Antal register att läsa
ANSWER SIZE 137 % (Antal register * 2) + 5
DATA[0] = BYTE(Id);
DATA[1] = BYTE(03);
DATA[2] = BYTE(132); % Antal Bytes
DATA[3] -> RWORD(Tmp:=DATA*65536;);
DATA[5] -> RWORD(V1:=Tmp+DATA;);
DATA[7] -> RWORD(Tmp:=DATA*65536;);
DATA[9] -> RWORD(V2:=Tmp+DATA;);
DATA[11] -> RWORD(Tmp:=DATA*65536;);
DATA[13] -> RWORD(V3:=Tmp+DATA;);
DATA[15] -> RWORD(Tmp:=DATA*65536;);
DATA[17] -> RWORD(V4:=Tmp+DATA;);
DATA[19] -> RWORD(Tmp:=DATA*65536;);
DATA[21] -> RWORD(V5:=Tmp+DATA;);
DATA[23] -> RWORD(Tmp:=DATA*65536;);
DATA[25] -> RWORD(V6:=Tmp+DATA;);
DATA[43] -> RWORD(Tmp:=DATA*65536;);
DATA[45] -> RWORD(V7:=Tmp+DATA;);
DATA[47] -> RWORD(Tmp:=DATA*65536;);
DATA[49] -> RWORD(V8:=Tmp+DATA;);
DATA[51] -> RWORD(Tmp:=DATA*65536;);
DATA[53] -> RWORD(V9:=Tmp+DATA;);
DATA[55] -> RWORD(IF DATA=1 THEN V7:=V7*-1; ENDIF;);
DATA[57] -> RWORD(IF DATA=1 THEN V8:=V8*-1; ENDIF;);
DATA[61] -> RWORD(Tmp:=DATA*65536;);
DATA[63] -> RWORD(V10:=Tmp+DATA;);
DATA[65] -> RWORD(Tmp:=DATA*65536;);
DATA[67] -> RWORD(V11:=Tmp+DATA;);
DATA[83] -> RWORD(Tmp:=DATA*65536;);
DATA[85] -> RWORD(V12:=Tmp+DATA;);
DATA[91] -> RWORD(Tmp:=DATA*65536;);
DATA[93] -> RWORD(V13:=Tmp+DATA;);
DATA[95] -> RWORD(Tmp:=DATA*65536;);
DATA[97] -> RWORD(V14:=Tmp+DATA;);
DATA[99] -> RWORD(Tmp:=DATA*65536;);
DATA[101] -> RWORD(V15:=Tmp+DATA;);
DATA[103] -> RWORD(IF DATA=1 THEN V13:=V13*-1; ENDIF;);
DATA[105] -> RWORD(IF DATA=1 THEN V14:=V14*-1; ENDIF;);
DATA[107] -> RWORD(IF DATA=1 THEN V15:=V15*-1; ENDIF;);
DATA[109] -> RWORD(Tmp:=DATA*65536;);
DATA[111] -> RWORD(V16:=Tmp+DATA;);
DATA[113] -> RWORD(Tmp:=DATA*65536;);
DATA[115] -> RWORD(V17:=Tmp+DATA;);
DATA[117] -> RWORD(Tmp:=DATA*65536;);
DATA[119] -> RWORD(V18:=Tmp+DATA;);
DATA[121] -> RWORD(IF DATA=1 THEN V16:=V16*-1; ENDIF;);
DATA[123] -> RWORD(IF DATA=1 THEN V17:=V17*-1; ENDIF;);
DATA[125] -> RWORD(IF DATA=1 THEN V18:=V18*-1; 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.