RTD-RA kylmaskin
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
DEVICETYPE RTDRA NAMED "RTD-RA kylmaskin" TYPEID 15223 IS
PARAMETER
Id : "Adress";
V6 : "Setpoint" ["°C"];
V7 : "Mode" [""]; % 0..4 (0:Auto, 1:Heat, 2:Fan, 3:Cool, 4:Dry)
V8 : "OnOff" [""]; % 0:Off 1:On
V9 : "Global update" [""];
PUBLIC
V1 : "Is Fault" [""];
V2 : "Fault Code" [""];
V3 : "ReturnAirAverage" ["°C"]DEC2;
V4 : "Filter alarm" [""];
V5 : "RC Op Mode" [""]; % 0: idle/fan 1:Heating 2:Cooling 3:heat and cool
PRIVATE
count4;
count6;
tmp;
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM Read4 NAMED "Read 4" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(04); % Modbus kommando för att läsa register
DATA[2] <- RWORD(
IF(count4>4) THEN count4 := 0; ENDIF;
IF (count4=0) THEN tmp := 21;
ELSIF (count4=1) THEN tmp := 22;
ELSIF (count4=2) THEN tmp := 23;
ELSIF (count4=3) THEN tmp := 24;
ELSIF (count4=4) THEN tmp := 10051;
ENDIF;
DATA:= tmp;
);
DATA[4] := RWORD(01);
ANSWER SIZE 7
DATA[0] = BYTE(Id);
DATA[1] = BYTE(04);
DATA[3] -> RWORD(
IF (count4=0) THEN V1 := DATA;
ELSIF (count4=1) THEN V2 := DATA;
ELSIF (count4=2) THEN V3 := DATA/100;
ELSIF (count4=3) THEN V4 := DATA;
ELSIF (count4=4) THEN V5 := DATA;
ENDIF;
count4 := count4+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 := 1;
ELSIF (count6=1) THEN DATA := 3;
ELSIF (count6=2) THEN DATA := 5;
ELSIF (count6=3) THEN DATA := 10;
ENDIF;
); % Register adress
DATA[4] <- RWORD(
IF (count6=0) THEN DATA := V6;
ELSIF (count6=1) THEN DATA := V7;
ELSIF (count6=2) THEN DATA := V8;
ELSIF (count6=3) THEN DATA := V9;
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 RTDRA NAMED "RTD-RA kylmaskin" TYPEID 15223 IS
PARAMETER
Id : "Adress";
V6 : "Setpoint" ["°C"];
V7 : "Mode" [""]; % 0..4 (0:Auto, 1:Heat, 2:Fan, 3:Cool, 4:Dry)
V8 : "OnOff" [""]; % 0:Off 1:On
V9 : "Global update" [""];
PUBLIC
V1 : "Is Fault" [""];
V2 : "Fault Code" [""];
V3 : "ReturnAirAverage" ["°C"]DEC2;
V4 : "Filter alarm" [""];
V5 : "RC Op Mode" [""]; % 0: idle/fan 1:Heating 2:Cooling 3:heat and cool
PRIVATE
count4;
count6;
tmp;
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM Read4 NAMED "Read 4" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(04); % Modbus kommando för att läsa register
DATA[2] <- RWORD(
IF(count4>4) THEN count4 := 0; ENDIF;
IF (count4=0) THEN tmp := 21;
ELSIF (count4=1) THEN tmp := 22;
ELSIF (count4=2) THEN tmp := 23;
ELSIF (count4=3) THEN tmp := 24;
ELSIF (count4=4) THEN tmp := 10051;
ENDIF;
DATA:= tmp;
);
DATA[4] := RWORD(01);
ANSWER SIZE 7
DATA[0] = BYTE(Id);
DATA[1] = BYTE(04);
DATA[3] -> RWORD(
IF (count4=0) THEN V1 := DATA;
ELSIF (count4=1) THEN V2 := DATA;
ELSIF (count4=2) THEN V3 := DATA/100;
ELSIF (count4=3) THEN V4 := DATA;
ELSIF (count4=4) THEN V5 := DATA;
ENDIF;
count4 := count4+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 := 1;
ELSIF (count6=1) THEN DATA := 3;
ELSIF (count6=2) THEN DATA := 5;
ELSIF (count6=3) THEN DATA := 10;
ENDIF;
); % Register adress
DATA[4] <- RWORD(
IF (count6=0) THEN DATA := V6;
ELSIF (count6=1) THEN DATA := V7;
ELSIF (count6=2) THEN DATA := V8;
ELSIF (count6=3) THEN DATA := V9;
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.