Mitsubishi värmepump med Procon A1M Modbus modul del 3
Detaljer
- Typ
- Drivrutin
- Upplaggd av
- Ove Jansson, Abelko Innovation
- Version
- 2
- Uppdaterad
- 2016-09-06
- Skapad
- 2016-09-06
- Kategori
- Kyla, Modbus, Värme, Ventilation
- Visningar
- 2715
Beskrivning
Detta skript är skapat för IMSE UltraBase30/IPX3
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
DEVICETYPE ProconA1Mp3 NAMED "ProconA1Mp3" TYPEID 13031 IS
PARAMETER
Id : "Adress";
PUBLIC
V1 : "External Heater ON/OFF" [""]; % 0 = Stop, 1 = Run
V2 : "Water Pump 4 ON/OFF" [""];
V3 : "Water Pump 5 ON/OFF" [""];
V4 : "Water Pump 6 ON/OFF" [""];
V5 : "Water Pump 7 ON/OFF" [""];
V6 : "Water Pump 8 ON/OFF" [""];
V7 : "Water Pump 9 ON/OFF" [""];
V8 : "Water Pump 10 ON/OFF" [""];
V9 : "Water Pump 11 ON/OFF" [""];
V10 : "Water Pump 12 ON/OFF" [""];
V11 : "Water Pump 13 ON/OFF" [""];
V12 : "Water Pump 14 ON/OFF" [""];
V13 : "Water Pump 15 ON/OFF" [""];
V14 : "Water Pump 16 ON/OFF" [""];
V15 : "Drain Pan Heater ON/OFF" [""];
V16 : "Evaporating Temperature " ["ºC"]DEC2;
V17 : "Condensing Temperature" ["ºC"]DEC2;
V18 : "Electric Energy 1" ["kWh"]DEC2;
V19 : "Electric Energy 2" ["kWh"]DEC2;
V20 : "Electric Energy 3" ["kWh"]DEC2;
V21 : "Electric Energy 4" ["kWh"]DEC2;
V22 : "Electric Energy 5" ["kWh"]DEC2;
V23 : "Electric Energy 6" ["kWh"]DEC2;
V24 : "Electric Energy 7" ["kWh"]DEC2;
V25 : "Electric Energy 8" ["kWh"]DEC2;
V26 : "Electric Energy 9" ["kWh"]DEC2;
V27 : "Electric Energy 10" ["kWh"]DEC2;
V28 : "Electric Energy 11" ["kWh"]DEC2;
V29 : "Electric Energy 12" ["kWh"]DEC2;
V30 : "Electric Energy 13" ["kWh"]DEC2;
V31 : "Electric Energy 14" ["kWh"]DEC2;
V32 : "Electric Energy 15" ["kWh"]DEC2;
V33 : "Electric Energy 16" ["kWh"]DEC2;
V34 : "Brine Inlet Temperature" ["ºC"]DEC2;
V35 : "Brine Outlet Temperature 1 " ["ºC"]DEC2;
V36 : "Brine Outlet Temperature 2" ["ºC"]DEC2;
V37 : "Condensing Temperature 2 " ["ºC"]DEC2;
V38 : "Water Outlet Temperature 2 " ["ºC"]DEC2;
V39 : "Evaporating Temperature 2 " ["ºC"]DEC2;
V40 : "Water Pump 1 – PWM Duty" ["%"];
V41 : "Water Pump 1 – PWM Duty Feedback" ["%"];
V42 : "3-Way Valve 1" [""]; % 0 = OFF (stop) 1 = ON (run)
PRIVATE
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(215); % Start address
DATA[4] := RWORD(50); % Antal register att läsa
ANSWER SIZE 105 % (Antal register * 2) + 5
DATA[0] = BYTE(Id);
DATA[1] = BYTE(03);
DATA[2] = BYTE(100); % Antal Bytes
DATA[3] -> RWORD(V1 := DATA;);
DATA[5] -> RWORD(V2 := DATA;);
DATA[7] -> RWORD(V3 := DATA;);
DATA[9] -> RWORD(V4 := DATA;);
DATA[11] -> RWORD(V5 := DATA;);
DATA[13] -> RWORD(V6 := DATA;);
DATA[15] -> RWORD(V7 := DATA;);
DATA[17] -> RWORD(V8 := DATA;);
DATA[19] -> RWORD(V9 := DATA;);
DATA[21] -> RWORD(V10 := DATA;);
DATA[23] -> RWORD(V11 := DATA;);
DATA[25] -> RWORD(V12 := DATA;);
DATA[27] -> RWORD(V13 := DATA;);
DATA[29] -> RWORD(V14 := DATA;);
DATA[31] -> RWORD(V15 := DATA;);
DATA[33] -> RWORD(IF (DATA>=32768) THEN V16:=(DATA-65536)/100; ELSE V16:=DATA/100; ENDIF;);
DATA[37] -> RWORD(IF (DATA>=32768) THEN V17:=(DATA-65536)/100; ELSE V17:=DATA/100; ENDIF;);
DATA[41] -> RWORD(V18 := DATA/100;);
DATA[43] -> RWORD(V19 := DATA/100;);
DATA[45] -> RWORD(V20 := DATA/100;);
DATA[47] -> RWORD(V21 := DATA/100;);
DATA[49] -> RWORD(V22 := DATA/100;);
DATA[51] -> RWORD(V23 := DATA/100;);
DATA[53] -> RWORD(V24 := DATA/100;);
DATA[55] -> RWORD(V25 := DATA/100;);
DATA[57] -> RWORD(V26 := DATA/100;);
DATA[59] -> RWORD(V27 := DATA/100;);
DATA[61] -> RWORD(V28 := DATA/100;);
DATA[63] -> RWORD(V29 := DATA/100;);
DATA[65] -> RWORD(V30 := DATA/100;);
DATA[67] -> RWORD(V31 := DATA/100;);
DATA[69] -> RWORD(V32 := DATA/100;);
DATA[71] -> RWORD(V33 := DATA/100;);
DATA[73] -> RWORD(IF (DATA>=32768) THEN V34:=(DATA-65536)/100; ELSE V34:=DATA/100; ENDIF;);
DATA[77] -> RWORD(IF (DATA>=32768) THEN V35:=(DATA-65536)/100; ELSE V35:=DATA/100; ENDIF;);
DATA[81] -> RWORD(IF (DATA>=32768) THEN V36:=(DATA-65536)/100; ELSE V36:=DATA/100; ENDIF;);
DATA[85] -> RWORD(IF (DATA>=32768) THEN V37:=(DATA-65536)/100; ELSE V37:=DATA/100; ENDIF;);
DATA[89] -> RWORD(IF (DATA>=32768) THEN V38:=(DATA-65536)/100; ELSE V38:=DATA/100; ENDIF;);
DATA[93] -> RWORD(IF (DATA>=32768) THEN V39:=(DATA-65536)/100; ELSE V39:=DATA/100; ENDIF;);
DATA[97] -> RWORD(V40 := DATA;);
DATA[99] -> RWORD(V41 := DATA;);
DATA[101] -> RWORD(V42 := DATA;);
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
DEVICETYPE ProconA1Mp3 NAMED "ProconA1Mp3" TYPEID 13031 IS
PARAMETER
Id : "Adress";
PUBLIC
V1 : "External Heater ON/OFF" [""]; % 0 = Stop, 1 = Run
V2 : "Water Pump 4 ON/OFF" [""];
V3 : "Water Pump 5 ON/OFF" [""];
V4 : "Water Pump 6 ON/OFF" [""];
V5 : "Water Pump 7 ON/OFF" [""];
V6 : "Water Pump 8 ON/OFF" [""];
V7 : "Water Pump 9 ON/OFF" [""];
V8 : "Water Pump 10 ON/OFF" [""];
V9 : "Water Pump 11 ON/OFF" [""];
V10 : "Water Pump 12 ON/OFF" [""];
V11 : "Water Pump 13 ON/OFF" [""];
V12 : "Water Pump 14 ON/OFF" [""];
V13 : "Water Pump 15 ON/OFF" [""];
V14 : "Water Pump 16 ON/OFF" [""];
V15 : "Drain Pan Heater ON/OFF" [""];
V16 : "Evaporating Temperature " ["ºC"]DEC2;
V17 : "Condensing Temperature" ["ºC"]DEC2;
V18 : "Electric Energy 1" ["kWh"]DEC2;
V19 : "Electric Energy 2" ["kWh"]DEC2;
V20 : "Electric Energy 3" ["kWh"]DEC2;
V21 : "Electric Energy 4" ["kWh"]DEC2;
V22 : "Electric Energy 5" ["kWh"]DEC2;
V23 : "Electric Energy 6" ["kWh"]DEC2;
V24 : "Electric Energy 7" ["kWh"]DEC2;
V25 : "Electric Energy 8" ["kWh"]DEC2;
V26 : "Electric Energy 9" ["kWh"]DEC2;
V27 : "Electric Energy 10" ["kWh"]DEC2;
V28 : "Electric Energy 11" ["kWh"]DEC2;
V29 : "Electric Energy 12" ["kWh"]DEC2;
V30 : "Electric Energy 13" ["kWh"]DEC2;
V31 : "Electric Energy 14" ["kWh"]DEC2;
V32 : "Electric Energy 15" ["kWh"]DEC2;
V33 : "Electric Energy 16" ["kWh"]DEC2;
V34 : "Brine Inlet Temperature" ["ºC"]DEC2;
V35 : "Brine Outlet Temperature 1 " ["ºC"]DEC2;
V36 : "Brine Outlet Temperature 2" ["ºC"]DEC2;
V37 : "Condensing Temperature 2 " ["ºC"]DEC2;
V38 : "Water Outlet Temperature 2 " ["ºC"]DEC2;
V39 : "Evaporating Temperature 2 " ["ºC"]DEC2;
V40 : "Water Pump 1 – PWM Duty" ["%"];
V41 : "Water Pump 1 – PWM Duty Feedback" ["%"];
V42 : "3-Way Valve 1" [""]; % 0 = OFF (stop) 1 = ON (run)
PRIVATE
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(215); % Start address
DATA[4] := RWORD(50); % Antal register att läsa
ANSWER SIZE 105 % (Antal register * 2) + 5
DATA[0] = BYTE(Id);
DATA[1] = BYTE(03);
DATA[2] = BYTE(100); % Antal Bytes
DATA[3] -> RWORD(V1 := DATA;);
DATA[5] -> RWORD(V2 := DATA;);
DATA[7] -> RWORD(V3 := DATA;);
DATA[9] -> RWORD(V4 := DATA;);
DATA[11] -> RWORD(V5 := DATA;);
DATA[13] -> RWORD(V6 := DATA;);
DATA[15] -> RWORD(V7 := DATA;);
DATA[17] -> RWORD(V8 := DATA;);
DATA[19] -> RWORD(V9 := DATA;);
DATA[21] -> RWORD(V10 := DATA;);
DATA[23] -> RWORD(V11 := DATA;);
DATA[25] -> RWORD(V12 := DATA;);
DATA[27] -> RWORD(V13 := DATA;);
DATA[29] -> RWORD(V14 := DATA;);
DATA[31] -> RWORD(V15 := DATA;);
DATA[33] -> RWORD(IF (DATA>=32768) THEN V16:=(DATA-65536)/100; ELSE V16:=DATA/100; ENDIF;);
DATA[37] -> RWORD(IF (DATA>=32768) THEN V17:=(DATA-65536)/100; ELSE V17:=DATA/100; ENDIF;);
DATA[41] -> RWORD(V18 := DATA/100;);
DATA[43] -> RWORD(V19 := DATA/100;);
DATA[45] -> RWORD(V20 := DATA/100;);
DATA[47] -> RWORD(V21 := DATA/100;);
DATA[49] -> RWORD(V22 := DATA/100;);
DATA[51] -> RWORD(V23 := DATA/100;);
DATA[53] -> RWORD(V24 := DATA/100;);
DATA[55] -> RWORD(V25 := DATA/100;);
DATA[57] -> RWORD(V26 := DATA/100;);
DATA[59] -> RWORD(V27 := DATA/100;);
DATA[61] -> RWORD(V28 := DATA/100;);
DATA[63] -> RWORD(V29 := DATA/100;);
DATA[65] -> RWORD(V30 := DATA/100;);
DATA[67] -> RWORD(V31 := DATA/100;);
DATA[69] -> RWORD(V32 := DATA/100;);
DATA[71] -> RWORD(V33 := DATA/100;);
DATA[73] -> RWORD(IF (DATA>=32768) THEN V34:=(DATA-65536)/100; ELSE V34:=DATA/100; ENDIF;);
DATA[77] -> RWORD(IF (DATA>=32768) THEN V35:=(DATA-65536)/100; ELSE V35:=DATA/100; ENDIF;);
DATA[81] -> RWORD(IF (DATA>=32768) THEN V36:=(DATA-65536)/100; ELSE V36:=DATA/100; ENDIF;);
DATA[85] -> RWORD(IF (DATA>=32768) THEN V37:=(DATA-65536)/100; ELSE V37:=DATA/100; ENDIF;);
DATA[89] -> RWORD(IF (DATA>=32768) THEN V38:=(DATA-65536)/100; ELSE V38:=DATA/100; ENDIF;);
DATA[93] -> RWORD(IF (DATA>=32768) THEN V39:=(DATA-65536)/100; ELSE V39:=DATA/100; ENDIF;);
DATA[97] -> RWORD(V40 := DATA;);
DATA[99] -> RWORD(V41 := DATA;);
DATA[101] -> RWORD(V42 := DATA;);
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.