IV Climatrix AHU 3.14 part 3
Detaljer
- Typ
- Drivrutin
- Upplaggd av
- Ove Jansson, Abelko Innovation
- Version
- 1
- Uppdaterad
- 2016-03-23
- Skapad
- 2016-03-23
- Kategori
- Modbus, Ventilation
- Visningar
- 1899
Beskrivning
del 1: Status och larm med ack
del 2: Mer status
del 3: Börvärden, läsa och skriva
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 IVClimatrix3 NAMED "IV Climatrix AHU 3_14_3" TYPEID 14531 IS
PARAMETER
Id : "Adress";
V8 : "BMS control/overide time switch" [""]; % 0-4 auto, off, stage 1-3
V9 : "BMS control/overide time switch program (steps/temperature)" [""]; % 0-7 auto, off, eco st1, comf st1, eco st2, comf st2, eco st3, comf st3
V10 : "BMS control/overide time switch program Aux output" [""]; % 0-2 auto, off, on
V11 : "Comfort temperature SP" ["°C"]DEC1;
V12 : "Economy temperature SP" ["°C"]DEC1;
V13 : "Humidity SP relative" ["%rH"];
V14 : "Dehumidity SP relative" ["%rH"];
PUBLIC
V1 : "BMS control/overide time switch (steps)" [""]; % 0-4 auto, off, stage 1-3
V2 : "BMS control/overide time switch program (steps/temperature)" [""]; % 0-7 auto, off, eco st1, comf st1, eco st2, comf st2, eco st3, comf st3
V3 : "BMS control/overide time switch program Aux output" [""]; % 0-2 auto, off, on
V4 : "Comfort temperature SP" ["°C"]DEC1;
V5 : "Economy temperature SP" ["°C"]DEC1;
V6 : "Humidity SP relative" ["%rH"];
V7 : "Dehumidity SP relative" ["%rH"];
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 := 4;
ELSIF (count3=1) THEN tmp := 5;
ELSIF (count3=2) THEN tmp := 6;
ELSIF (count3=3) THEN tmp := 19;
ELSIF (count3=4) THEN tmp := 23;
ELSIF (count3=5) THEN tmp := 40;
ELSIF (count3=6) THEN tmp := 41;
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 IF (DATA>=32768) THEN V4:=(DATA-65536)/10; ELSE V4:=DATA/10; ENDIF;
ELSIF (count3=4) THEN IF (DATA>=32768) THEN V5:=(DATA-65536)/10; ELSE V5:=DATA/10; ENDIF;
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>6) THEN count6 := 0; ENDIF;
IF (count6=0) THEN DATA := 4;
ELSIF (count6=1) THEN DATA := 5;
ELSIF (count6=2) THEN DATA := 6;
ELSIF (count6=3) THEN DATA := 19;
ELSIF (count6=4) THEN DATA := 23;
ELSIF (count6=5) THEN DATA := 40;
ELSIF (count6=6) THEN DATA := 41;
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 IF (V11<0) THEN DATA := ROUND((V11*-10)+32768); ELSE DATA := ROUND(V11*10); ENDIF;
ELSIF (count6=4) THEN IF (V12<0) THEN DATA := ROUND((V12*-10)+32768); ELSE DATA := ROUND(V12*10); ENDIF;
ELSIF (count6=5) THEN DATA := V13;
ELSIF (count6=6) THEN DATA := V14;
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 IVClimatrix3 NAMED "IV Climatrix AHU 3_14_3" TYPEID 14531 IS
PARAMETER
Id : "Adress";
V8 : "BMS control/overide time switch" [""]; % 0-4 auto, off, stage 1-3
V9 : "BMS control/overide time switch program (steps/temperature)" [""]; % 0-7 auto, off, eco st1, comf st1, eco st2, comf st2, eco st3, comf st3
V10 : "BMS control/overide time switch program Aux output" [""]; % 0-2 auto, off, on
V11 : "Comfort temperature SP" ["°C"]DEC1;
V12 : "Economy temperature SP" ["°C"]DEC1;
V13 : "Humidity SP relative" ["%rH"];
V14 : "Dehumidity SP relative" ["%rH"];
PUBLIC
V1 : "BMS control/overide time switch (steps)" [""]; % 0-4 auto, off, stage 1-3
V2 : "BMS control/overide time switch program (steps/temperature)" [""]; % 0-7 auto, off, eco st1, comf st1, eco st2, comf st2, eco st3, comf st3
V3 : "BMS control/overide time switch program Aux output" [""]; % 0-2 auto, off, on
V4 : "Comfort temperature SP" ["°C"]DEC1;
V5 : "Economy temperature SP" ["°C"]DEC1;
V6 : "Humidity SP relative" ["%rH"];
V7 : "Dehumidity SP relative" ["%rH"];
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 := 4;
ELSIF (count3=1) THEN tmp := 5;
ELSIF (count3=2) THEN tmp := 6;
ELSIF (count3=3) THEN tmp := 19;
ELSIF (count3=4) THEN tmp := 23;
ELSIF (count3=5) THEN tmp := 40;
ELSIF (count3=6) THEN tmp := 41;
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 IF (DATA>=32768) THEN V4:=(DATA-65536)/10; ELSE V4:=DATA/10; ENDIF;
ELSIF (count3=4) THEN IF (DATA>=32768) THEN V5:=(DATA-65536)/10; ELSE V5:=DATA/10; ENDIF;
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>6) THEN count6 := 0; ENDIF;
IF (count6=0) THEN DATA := 4;
ELSIF (count6=1) THEN DATA := 5;
ELSIF (count6=2) THEN DATA := 6;
ELSIF (count6=3) THEN DATA := 19;
ELSIF (count6=4) THEN DATA := 23;
ELSIF (count6=5) THEN DATA := 40;
ELSIF (count6=6) THEN DATA := 41;
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 IF (V11<0) THEN DATA := ROUND((V11*-10)+32768); ELSE DATA := ROUND(V11*10); ENDIF;
ELSIF (count6=4) THEN IF (V12<0) THEN DATA := ROUND((V12*-10)+32768); ELSE DATA := ROUND(V12*10); ENDIF;
ELSIF (count6=5) THEN DATA := V13;
ELSIF (count6=6) THEN DATA := V14;
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.