MTA iCHILL 121C med xCONNECT (modbus)
Detaljer
- Typ
- Drivrutin
- Upplaggd av
- Ove Jansson, Abelko Innovation
- Version
- 1
- Uppdaterad
- 2015-08-21
- Skapad
- 2015-08-21
- Kategori
- Kyla, Modbus, Ventilation
- Visningar
- 2567
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
DEVICETYPE i121c NAMED "MTA iCHILL 121C" TYPEID 10807 IS
PARAMETER
Id : "Adress";
PUBLIC
V1 : "On" [""]INT; %1281 bit 0, 1=on
V2 : "Real SP" ["°C"]; %1537
V3 : "Chiller SP" ["°C"]; % 1538
V4 : "Heat pump SP" ["°C"]; % 1539
V5 : "Alarm relay" [""]INT; % 2049 bit 11
V6 : "Compressor 1" [""]INT; % 2050 bit 8 relay
V7 : "Compressor 2" [""]INT; % 2050 bit 9 relay
V8 : "Delivery fan" [""]INT; % 2050 bit 10 relay
V9 : "Condensing fan" [""]INT; % 2050 bit 11 relay
V10 : "Anti-freeze" [""]INT; % 2050 bit 12 relay
V11 : "Pump" [""]INT; % 2050 bit 13 relay
V12 : "Solenoid valve" [""]INT; % 2050 bit 14 relay on the water side
V13 : "Funct. alarms" [""]; % 3332-3334 collective functional alarms
PRIVATE
count4;
tmp;
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM Read NAMED "Read" IS
QUESTION
DATA[0] := BYTE(Id);
DATA[1] := HEX(03);
DATA[2] <- RWORD(
IF(count4>5) THEN count4 := 0; ENDIF;
IF (count4=0) THEN tmp := 1281;
ELSIF (count4=1) THEN tmp := 1537;
ELSIF (count4=2) THEN tmp := 1538;
ELSIF (count4=3) THEN tmp := 1539;
ELSIF (count4=4) THEN tmp := 2049;
ELSIF (count4=5) THEN tmp := 2050;
ENDIF;
DATA:= tmp;
);
DATA[4] := RWORD(1);
ANSWER SIZE 7
DATA[0] = BYTE(Id);
DATA[1] = BYTE(03);
DATA[3] -> RWORD(
IF (count4=0) THEN IF DATA&1 THEN V1:=1; ELSE V1:=0; ENDIF;
ELSIF (count4=1) THEN V2:=DATA/10;
ELSIF (count4=2) THEN V3:=DATA/10;
ELSIF (count4=3) THEN V4:=DATA/10;
ELSIF (count4=4) THEN IF DATA&2048 THEN V5:=1; ELSE V5:=0; ENDIF;
ELSIF (count4=5) THEN
IF DATA&256 THEN V3:=1; ELSE V3:=0; ENDIF;
IF DATA&512 THEN V4:=1; ELSE V4:=0; ENDIF;
IF DATA&1024 THEN V5:=1; ELSE V5:=0; ENDIF;
IF DATA&2048 THEN V6:=1; ELSE V6:=0; ENDIF;
IF DATA&4096 THEN V7:=1; ELSE V7:=0; ENDIF;
IF DATA&8192 THEN V8:=1; ELSE V8:=0; ENDIF;
IF DATA&16384 THEN V9:=1; ELSE V9:=0; ENDIF;
IF DATA&32768 THEN V10:=1; ELSE V10:=0; ENDIF;
IF DATA&65536 THEN V11:=1; ELSE V11:=0; ENDIF;
IF DATA&131072 THEN V12:=1; ELSE V12:=0; ENDIF;
ENDIF;
count4 := count4+1;
);
TIMEOUT 300
END;
TELEGRAM Read2 NAMED "Read2" IS
QUESTION
DATA[0] := BYTE(Id);
DATA[1] := HEX(03);
DATA[2] := RWORD(3332);
DATA[4] := RWORD(3);
ANSWER SIZE 11
DATA[0] = BYTE(Id);
DATA[1] = BYTE(03);
DATA[3] -> RWORD(
tmp:=DATA;
);
DATA[5] -> RWORD(
tmp:=tmp+DATA;
);
DATA[7] -> RWORD(
tmp:=tmp+DATA;
IF tmp>0 THEN V13:=1; ELSE V13:=0; ENDIF;
);
TIMEOUT 300
END;
END;
PARAMETER
Id : "Adress";
PUBLIC
V1 : "On" [""]INT; %1281 bit 0, 1=on
V2 : "Real SP" ["°C"]; %1537
V3 : "Chiller SP" ["°C"]; % 1538
V4 : "Heat pump SP" ["°C"]; % 1539
V5 : "Alarm relay" [""]INT; % 2049 bit 11
V6 : "Compressor 1" [""]INT; % 2050 bit 8 relay
V7 : "Compressor 2" [""]INT; % 2050 bit 9 relay
V8 : "Delivery fan" [""]INT; % 2050 bit 10 relay
V9 : "Condensing fan" [""]INT; % 2050 bit 11 relay
V10 : "Anti-freeze" [""]INT; % 2050 bit 12 relay
V11 : "Pump" [""]INT; % 2050 bit 13 relay
V12 : "Solenoid valve" [""]INT; % 2050 bit 14 relay on the water side
V13 : "Funct. alarms" [""]; % 3332-3334 collective functional alarms
PRIVATE
count4;
tmp;
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM Read NAMED "Read" IS
QUESTION
DATA[0] := BYTE(Id);
DATA[1] := HEX(03);
DATA[2] <- RWORD(
IF(count4>5) THEN count4 := 0; ENDIF;
IF (count4=0) THEN tmp := 1281;
ELSIF (count4=1) THEN tmp := 1537;
ELSIF (count4=2) THEN tmp := 1538;
ELSIF (count4=3) THEN tmp := 1539;
ELSIF (count4=4) THEN tmp := 2049;
ELSIF (count4=5) THEN tmp := 2050;
ENDIF;
DATA:= tmp;
);
DATA[4] := RWORD(1);
ANSWER SIZE 7
DATA[0] = BYTE(Id);
DATA[1] = BYTE(03);
DATA[3] -> RWORD(
IF (count4=0) THEN IF DATA&1 THEN V1:=1; ELSE V1:=0; ENDIF;
ELSIF (count4=1) THEN V2:=DATA/10;
ELSIF (count4=2) THEN V3:=DATA/10;
ELSIF (count4=3) THEN V4:=DATA/10;
ELSIF (count4=4) THEN IF DATA&2048 THEN V5:=1; ELSE V5:=0; ENDIF;
ELSIF (count4=5) THEN
IF DATA&256 THEN V3:=1; ELSE V3:=0; ENDIF;
IF DATA&512 THEN V4:=1; ELSE V4:=0; ENDIF;
IF DATA&1024 THEN V5:=1; ELSE V5:=0; ENDIF;
IF DATA&2048 THEN V6:=1; ELSE V6:=0; ENDIF;
IF DATA&4096 THEN V7:=1; ELSE V7:=0; ENDIF;
IF DATA&8192 THEN V8:=1; ELSE V8:=0; ENDIF;
IF DATA&16384 THEN V9:=1; ELSE V9:=0; ENDIF;
IF DATA&32768 THEN V10:=1; ELSE V10:=0; ENDIF;
IF DATA&65536 THEN V11:=1; ELSE V11:=0; ENDIF;
IF DATA&131072 THEN V12:=1; ELSE V12:=0; ENDIF;
ENDIF;
count4 := count4+1;
);
TIMEOUT 300
END;
TELEGRAM Read2 NAMED "Read2" IS
QUESTION
DATA[0] := BYTE(Id);
DATA[1] := HEX(03);
DATA[2] := RWORD(3332);
DATA[4] := RWORD(3);
ANSWER SIZE 11
DATA[0] = BYTE(Id);
DATA[1] = BYTE(03);
DATA[3] -> RWORD(
tmp:=DATA;
);
DATA[5] -> RWORD(
tmp:=tmp+DATA;
);
DATA[7] -> RWORD(
tmp:=tmp+DATA;
IF tmp>0 THEN V13:=1; ELSE V13:=0; 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.