IntesisBox ME-AC-MBS-1 Modbus interface for Mitsubishi Electric air conditioners
Detaljer
- Typ
- Drivrutin
- Upplaggd av
- Ove Jansson, Abelko Innovation
- Version
- 1
- Uppdaterad
- 2013-05-13
- Skapad
- 2013-05-13
- Kategori
- Kyla, Modbus, Ventilation
- Visningar
- 3193
Beskrivning
Drivrutin till Mitsubishis elektriska ACs
Bruksanvisning
Följ instruktionerna i användarmanualen för IntesisBox. Detta skript är baserad på rev 8 i användarmanualen.
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 IntesisBox NAMED "IntesisBox" TYPEID 10563 IS
PARAMETER
Id : "Adress";
V8 : "wACunit On/Off" [""]; % 0=off,1=on
V9 : "wACunit Mode" [""]; % 0=auto,1=heat,2=dry,3=fan,4=cool
V10 : "wACFanSpeed" [""]; % 0=auto,1=low,2=mid-1,3=mid-2,4=high
V11 : "wACTempSP" ["°C"];
PUBLIC
V1 : "ACunit On/Off" [""]; % 0=off,1=on
V2 : "ACunit Mode" [""]; % 0=auto,1=heat,2=dry,3=fan,4=cool
V3 : "ACFanSpeed" [""]; % 0=auto,1=low,2=mid-1,3=mid-2,4=high
V4 : "ACTempSP" ["°C"];
V5 : "ACAmbTemp" ["°C"];
V6 : "ACAlarmStatus" [""]; % 0=no alarm,1=alarm condition
V7 : "Error code" [""]; % See manual
PRIVATE
count3;
count6;
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
DATA[2] <- RWORD(
IF(count3>6) THEN count3 := 0; ENDIF;
IF (count3=0) THEN tmp := 0;
ELSIF (count3=1) THEN tmp := 1;
ELSIF (count3=2) THEN tmp := 2;
ELSIF (count3=3) THEN tmp := 4;
ELSIF (count3=4) THEN tmp := 5;
ELSIF (count3=5) THEN tmp := 10;
ELSIF (count3=6) THEN tmp := 11;
ENDIF;
DATA:= tmp;
);
DATA[4] := RWORD(01);
ANSWER SIZE 7
DATA[0] = BYTE(Id);
DATA[1] = BYTE(03);
DATA[3] -> RWORD(
IF (count3=0) THEN V1 := DATA;
ELSIF (count3=1) THEN V2 := DATA;
ELSIF (count3=2) THEN V3 := DATA;
ELSIF (count3=3) THEN V4 := DATA;
ELSIF (count3=4) THEN V5 := DATA;
ELSIF (count3=5) THEN V6 := DATA;
ELSIF (count3=6) THEN V7 := DATA;
ENDIF;
count3 := count3+1;
);
TIMEOUT 300
END;
TELEGRAM WriteRegister NAMED "Write Register" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(06); % Modbus kommando för att skriva ett register
DATA[2] <- RWORD(
IF(count6>3) THEN count6 := 0; ENDIF;
IF (count6=0) THEN DATA := 0;
ELSIF (count6=1) THEN DATA := 1;
ELSIF (count6=2) THEN DATA := 2;
ELSIF (count6=3) THEN DATA := 4;
ENDIF;
); % Register adress
DATA[4] <- RWORD(
IF (count6=0) THEN DATA := V8;
ELSIF (count6=1) THEN DATA := V9;
ELSIF (count6=2) THEN DATA := V10;
ELSIF (count6=3) THEN DATA := V11;
ENDIF;
count6 := count6+1;
);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = BYTE(06);
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 IntesisBox NAMED "IntesisBox" TYPEID 10563 IS
PARAMETER
Id : "Adress";
V8 : "wACunit On/Off" [""]; % 0=off,1=on
V9 : "wACunit Mode" [""]; % 0=auto,1=heat,2=dry,3=fan,4=cool
V10 : "wACFanSpeed" [""]; % 0=auto,1=low,2=mid-1,3=mid-2,4=high
V11 : "wACTempSP" ["°C"];
PUBLIC
V1 : "ACunit On/Off" [""]; % 0=off,1=on
V2 : "ACunit Mode" [""]; % 0=auto,1=heat,2=dry,3=fan,4=cool
V3 : "ACFanSpeed" [""]; % 0=auto,1=low,2=mid-1,3=mid-2,4=high
V4 : "ACTempSP" ["°C"];
V5 : "ACAmbTemp" ["°C"];
V6 : "ACAlarmStatus" [""]; % 0=no alarm,1=alarm condition
V7 : "Error code" [""]; % See manual
PRIVATE
count3;
count6;
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
DATA[2] <- RWORD(
IF(count3>6) THEN count3 := 0; ENDIF;
IF (count3=0) THEN tmp := 0;
ELSIF (count3=1) THEN tmp := 1;
ELSIF (count3=2) THEN tmp := 2;
ELSIF (count3=3) THEN tmp := 4;
ELSIF (count3=4) THEN tmp := 5;
ELSIF (count3=5) THEN tmp := 10;
ELSIF (count3=6) THEN tmp := 11;
ENDIF;
DATA:= tmp;
);
DATA[4] := RWORD(01);
ANSWER SIZE 7
DATA[0] = BYTE(Id);
DATA[1] = BYTE(03);
DATA[3] -> RWORD(
IF (count3=0) THEN V1 := DATA;
ELSIF (count3=1) THEN V2 := DATA;
ELSIF (count3=2) THEN V3 := DATA;
ELSIF (count3=3) THEN V4 := DATA;
ELSIF (count3=4) THEN V5 := DATA;
ELSIF (count3=5) THEN V6 := DATA;
ELSIF (count3=6) THEN V7 := DATA;
ENDIF;
count3 := count3+1;
);
TIMEOUT 300
END;
TELEGRAM WriteRegister NAMED "Write Register" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(06); % Modbus kommando för att skriva ett register
DATA[2] <- RWORD(
IF(count6>3) THEN count6 := 0; ENDIF;
IF (count6=0) THEN DATA := 0;
ELSIF (count6=1) THEN DATA := 1;
ELSIF (count6=2) THEN DATA := 2;
ELSIF (count6=3) THEN DATA := 4;
ENDIF;
); % Register adress
DATA[4] <- RWORD(
IF (count6=0) THEN DATA := V8;
ELSIF (count6=1) THEN DATA := V9;
ELSIF (count6=2) THEN DATA := V10;
ELSIF (count6=3) THEN DATA := V11;
ENDIF;
count6 := count6+1;
);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = BYTE(06);
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.