Clint kylmaskin med ECH 400 Modbus
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 Clint NAMED "Clint" TYPEID 10344 IS
PARAMETER
Id : "Adress";
PUBLIC
V1 : "Setpoint Cooling" ["°C"]DEC1;
V2 : "Min SP cooling" ["°C"]DEC1;
V3 : "Max SP cooling" ["°C"]DEC1;
V4 : "Temperatur Unit" [""]; % Default 0=C, 1=F
V5 : "SP Antifreeze" ["°C"];
V6 : "Hysteris Antifreeze" ["°C"]DEC1;
V7 : "LowPressBypassTime" ["s"];
V8 : "Cooling hysteresis" ["°C"]DEC1;
V9 : "Steps diff" ["°C"]DEC1;
V10 : "Prop band" [""]; % °C/10-Kpa*10
V11 : "AI1" ["°C"]DEC1;
V12 : "AI2" ["°C"]DEC1;
V13 : "AI3" ["°C"]DEC1;
V14 : "AI4" ["°C"]DEC1;
V15 : "AI5" ["°C"]DEC1;
V16 : "AI6" ["°C"]DEC1;
V17 : "On" [""];
PRIVATE
count3;
count4;
tmp;
BAUDRATE 9600;
PARITY EVEN;
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>10) THEN count3 := 0; ENDIF;
IF (count3=0) THEN tmp := 2049;
ELSIF (count3=1) THEN tmp := 2053;
ELSIF (count3=2) THEN tmp := 2054;
ELSIF (count3=3) THEN tmp := 2114;
ELSIF (count3=4) THEN tmp := 2130;
ELSIF (count3=5) THEN tmp := 2131;
ELSIF (count3=6) THEN tmp := 2135;
ELSIF (count3=7) THEN tmp := 2148;
ELSIF (count3=8) THEN tmp := 2149;
ELSIF (count3=9) THEN tmp := 2162;
ELSIF (count3=10) THEN tmp := 16495;
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 IF (DATA>=32768) THEN V1:=(DATA-65536)/10; ELSE V1:=DATA/10; ENDIF;
ELSIF (count3=1) THEN IF (DATA>=32768) THEN V2:=(DATA-65536)/10; ELSE V2:=DATA/10; ENDIF;
ELSIF (count3=2) THEN IF (DATA>=32768) THEN V3:=(DATA-65536)/10; ELSE V3:=DATA/10; ENDIF;
ELSIF (count3=3) THEN IF (DATA>=32768) THEN V4:=(DATA-65536); ELSE V4:=DATA; ENDIF;
ELSIF (count3=4) THEN IF (DATA>=32768) THEN V5:=(DATA-65536); ELSE V5:=DATA; ENDIF;
ELSIF (count3=5) THEN IF (DATA>=32768) THEN V6:=(DATA-65536)/10; ELSE V6:=DATA/10; ENDIF;
ELSIF (count3=6) THEN V7 := DATA;
ELSIF (count3=7) THEN V8 := DATA/10;
ELSIF (count3=8) THEN V9 := DATA/10;
ELSIF (count3=9) THEN V10 := DATA;
ELSIF (count3=10) THEN V17 := DATA & 1;
ENDIF;
count3 := count3+1;
);
TIMEOUT 500
END;
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>5) THEN count4 := 0; ENDIF;
IF (count4=0) THEN tmp := 4097;
ELSIF (count4=1) THEN tmp := 4098;
ELSIF (count4=2) THEN tmp := 4099;
ELSIF (count4=3) THEN tmp := 4100;
ELSIF (count4=4) THEN tmp := 4101;
ELSIF (count4=5) THEN tmp := 4102;
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 IF (DATA>=32768) THEN V11:=(DATA-65536)/10; ELSE V11:=DATA/10; ENDIF;
ELSIF (count4=1) THEN IF (DATA>=32768) THEN V12:=(DATA-65536)/10; ELSE V12:=DATA/10; ENDIF;
ELSIF (count4=2) THEN IF (DATA>=32768) THEN V13:=(DATA-65536)/10; ELSE V13:=DATA/10; ENDIF;
ELSIF (count4=3) THEN IF (DATA>=32768) THEN V14:=(DATA-65536)/10; ELSE V14:=DATA/10; ENDIF;
ELSIF (count4=4) THEN IF (DATA>=32768) THEN V15:=(DATA-65536)/10; ELSE V15:=DATA/10; ENDIF;
ELSIF (count4=5) THEN IF (DATA>=32768) THEN V16:=(DATA-65536)/10; ELSE V16:=DATA/10; ENDIF;
ENDIF;
count4 := count4+1;
);
TIMEOUT 500
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 Clint NAMED "Clint" TYPEID 10344 IS
PARAMETER
Id : "Adress";
PUBLIC
V1 : "Setpoint Cooling" ["°C"]DEC1;
V2 : "Min SP cooling" ["°C"]DEC1;
V3 : "Max SP cooling" ["°C"]DEC1;
V4 : "Temperatur Unit" [""]; % Default 0=C, 1=F
V5 : "SP Antifreeze" ["°C"];
V6 : "Hysteris Antifreeze" ["°C"]DEC1;
V7 : "LowPressBypassTime" ["s"];
V8 : "Cooling hysteresis" ["°C"]DEC1;
V9 : "Steps diff" ["°C"]DEC1;
V10 : "Prop band" [""]; % °C/10-Kpa*10
V11 : "AI1" ["°C"]DEC1;
V12 : "AI2" ["°C"]DEC1;
V13 : "AI3" ["°C"]DEC1;
V14 : "AI4" ["°C"]DEC1;
V15 : "AI5" ["°C"]DEC1;
V16 : "AI6" ["°C"]DEC1;
V17 : "On" [""];
PRIVATE
count3;
count4;
tmp;
BAUDRATE 9600;
PARITY EVEN;
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>10) THEN count3 := 0; ENDIF;
IF (count3=0) THEN tmp := 2049;
ELSIF (count3=1) THEN tmp := 2053;
ELSIF (count3=2) THEN tmp := 2054;
ELSIF (count3=3) THEN tmp := 2114;
ELSIF (count3=4) THEN tmp := 2130;
ELSIF (count3=5) THEN tmp := 2131;
ELSIF (count3=6) THEN tmp := 2135;
ELSIF (count3=7) THEN tmp := 2148;
ELSIF (count3=8) THEN tmp := 2149;
ELSIF (count3=9) THEN tmp := 2162;
ELSIF (count3=10) THEN tmp := 16495;
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 IF (DATA>=32768) THEN V1:=(DATA-65536)/10; ELSE V1:=DATA/10; ENDIF;
ELSIF (count3=1) THEN IF (DATA>=32768) THEN V2:=(DATA-65536)/10; ELSE V2:=DATA/10; ENDIF;
ELSIF (count3=2) THEN IF (DATA>=32768) THEN V3:=(DATA-65536)/10; ELSE V3:=DATA/10; ENDIF;
ELSIF (count3=3) THEN IF (DATA>=32768) THEN V4:=(DATA-65536); ELSE V4:=DATA; ENDIF;
ELSIF (count3=4) THEN IF (DATA>=32768) THEN V5:=(DATA-65536); ELSE V5:=DATA; ENDIF;
ELSIF (count3=5) THEN IF (DATA>=32768) THEN V6:=(DATA-65536)/10; ELSE V6:=DATA/10; ENDIF;
ELSIF (count3=6) THEN V7 := DATA;
ELSIF (count3=7) THEN V8 := DATA/10;
ELSIF (count3=8) THEN V9 := DATA/10;
ELSIF (count3=9) THEN V10 := DATA;
ELSIF (count3=10) THEN V17 := DATA & 1;
ENDIF;
count3 := count3+1;
);
TIMEOUT 500
END;
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>5) THEN count4 := 0; ENDIF;
IF (count4=0) THEN tmp := 4097;
ELSIF (count4=1) THEN tmp := 4098;
ELSIF (count4=2) THEN tmp := 4099;
ELSIF (count4=3) THEN tmp := 4100;
ELSIF (count4=4) THEN tmp := 4101;
ELSIF (count4=5) THEN tmp := 4102;
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 IF (DATA>=32768) THEN V11:=(DATA-65536)/10; ELSE V11:=DATA/10; ENDIF;
ELSIF (count4=1) THEN IF (DATA>=32768) THEN V12:=(DATA-65536)/10; ELSE V12:=DATA/10; ENDIF;
ELSIF (count4=2) THEN IF (DATA>=32768) THEN V13:=(DATA-65536)/10; ELSE V13:=DATA/10; ENDIF;
ELSIF (count4=3) THEN IF (DATA>=32768) THEN V14:=(DATA-65536)/10; ELSE V14:=DATA/10; ENDIF;
ELSIF (count4=4) THEN IF (DATA>=32768) THEN V15:=(DATA-65536)/10; ELSE V15:=DATA/10; ENDIF;
ELSIF (count4=5) THEN IF (DATA>=32768) THEN V16:=(DATA-65536)/10; ELSE V16:=DATA/10; ENDIF;
ENDIF;
count4 := count4+1;
);
TIMEOUT 500
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.