Corrigo Cooling
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
DEVICETYPE ExigoCool NAMED "Corrigo Exigo cooling" IS
% reads max 47 registers
PARAMETER
Id : "Address"INT;
Started : "Write if changed" ["Off,On"]ENUM;
w3_507 : "Set Outdoor temp" ["°C"]DEC1;
w3_538 : "Set Parallel adj of curve CS1" ["°C"]DEC1;
w3_539 : "Set Outdoor temp x1 curve CS1" ["°C"]INT;
w3_540 : "Set Outdoor temp x2 curve CS1" ["°C"]INT;
w3_541 : "Set Outdoor temp x3 curve CS1" ["°C"]INT;
w3_542 : "Set Outdoor temp x4 curve CS1" ["°C"]INT;
w3_543 : "Set Outdoor temp x5 curve CS1" ["°C"]INT;
w3_544 : "Set Outdoor temp x6 curve CS1" ["°C"]INT;
w3_545 : "Set Outdoor temp x7 curve CS1" ["°C"]INT;
w3_546 : "Set Outdoor temp x8 curve CS1" ["°C"]INT;
w3_547 : "Set Setpoint temp y1 curve CS1" ["°C"]INT;
w3_548 : "Set Setpoint temp y2 curve CS1" ["°C"]INT;
w3_549 : "Set Setpoint temp y3 curve CS1" ["°C"]INT;
w3_550 : "Set Setpoint temp y4 curve CS1" ["°C"]INT;
w3_551 : "Set Setpoint temp y5 curve CS1" ["°C"]INT;
w3_552 : "Set Setpoint temp y6 curve CS1" ["°C"]INT;
w3_553 : "Set Setpoint temp y7 curve CS1" ["°C"]INT;
w3_554 : "Set Setpoint temp y8 curve CS1" ["°C"]INT;
w3_604 : "Set Outdoor temp for pump stop day" ["°C"]DEC1;
w3_606 : "Set Setpoint CS1" ["°C"]DEC1;
PUBLIC
% r3=Holding register
r3_507 : "Outdoor temp" ["°C"]DEC1;
r3_538 : "Parallel adj of curve CS1" ["°C"]DEC1;
r3_539 : "Outdoor temp x1 curve CS1" ["°C"]INT; %default 20
r3_540 : "Outdoor temp x2 curve CS1" ["°C"]INT; %default 22
r3_541 : "Outdoor temp x3 curve CS1" ["°C"]INT; %default 24
r3_542 : "Outdoor temp x4 curve CS1" ["°C"]INT; %default 26
r3_543 : "Outdoor temp x5 curve CS1" ["°C"]INT; %default 28
r3_544 : "Outdoor temp x6 curve CS1" ["°C"]INT; %default 30
r3_545 : "Outdoor temp x7 curve CS1" ["°C"]INT; %default 32
r3_546 : "Outdoor temp x8 curve CS1" ["°C"]INT; %default 34
r3_547 : "Setpoint temp y1 curve CS1" ["°C"]INT; %default 14
r3_548 : "Setpoint temp y2 curve CS1" ["°C"]INT; %default 14
r3_549 : "Setpoint temp y3 curve CS1" ["°C"]INT; %default 13
r3_550 : "Setpoint temp y4 curve CS1" ["°C"]INT; %default 12
r3_551 : "Setpoint temp y5 curve CS1" ["°C"]INT; %default 12
r3_552 : "Setpoint temp y6 curve CS1" ["°C"]INT; %default 11
r3_553 : "Setpoint temp y7 curve CS1" ["°C"]INT; %default 10
r3_554 : "Setpoint temp y8 curve CS1" ["°C"]INT; %default 9
r3_604 : "Outdoor temp for pump stop day" ["°C"]DEC1;
r3_606 : "Setpoint CS1" ["°C"]DEC1;
% r4=input tegister
r4_097 : "Expansion vessel alarm"INT;
r4_185 : "Sensor error CS1 supply"INT;
r4_186 : "Sensor error CS1 reply"INT;
r4_207 : "Deviation CS1 alarm"INT;
r4_213 : "Malfunction P1A-CS1"INT;
r4_214 : "Malfunction P1B-CS1"INT;
r4_215 : "Malfunction P1A&B-CS1"INT;
r4_216 : "P1A-CS1 manual"INT;
r4_217 : "P1B-CS1 manual"INT;
r4_238 : "Start signal pump CS1 P1A"INT;
r4_239 : "Start signal pump CS1 P1B"INT;
r4_240 : "Pump running CS1 P1A"INT;
r4_241 : "Pump running CS1 P1B"INT;
r4_342 : "Supply temperature CS1" ["°C"]DEC1;
r4_343 : "Setpoint supply temperature CS1 dew comp" ["°C"]DEC1;
r4_344 : "Room temperature CS1" ["°C"]DEC1;
r4_345 : "Return temperature CS1" ["°C"]DEC1;
r4_348 : "Control output CS1" ["%"]INT;
r4_349 : "Control signal CS1 CV" ["V"]INT;
r4_357 : "Humidity" INT;
r4_413 : "Calculated dewpoint temp" ["°C"]DEC1;
% Input status register
r2_102 : "Internal battery error"INT;
PRIVATE
started;
count3;
Tmp;
% old local values
ol3_507;
ol3_538;
ol3_539;
ol3_540;
ol3_541;
ol3_542;
ol3_543;
ol3_544;
ol3_545;
ol3_546;
ol3_547;
ol3_548;
ol3_549;
ol3_550;
ol3_551;
ol3_552;
ol3_553;
ol3_554;
ol3_604;
ol3_606;
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM ReadD_102 NAMED "Read Discrete 102" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(02); % Modbus kommando för att läsa register kod 02
DATA[2] := RWORD(101); % Start address
DATA[4] := RWORD(1); % Antal register att läsa
ANSWER SIZE 6 % (Antal register / 8) avrundat uppåt + 5
DATA[0] = BYTE(Id);
DATA[1] = BYTE(02);
DATA[2] = BYTE(1); % Antal Bytes
DATA[3] -> BYTE(
IF (DATA & 1) THEN r2_102 := 1; ELSE r2_102 := 0; ENDIF;
);
TIMEOUT 1000
END;
TELEGRAM ReadI_97 NAMED "Read Input 97&413" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(04); % Modbus kommando för att läsa input register kod 03
DATA[2] <- RWORD(
IF count3>1 THEN count3:=0; ENDIF;
IF count3=0 THEN DATA:=96;
ELSIF count3=1 THEN DATA:=412;
ENDIF;
); % Start address
DATA[4] := RWORD(1); % Antal register att läsa
ANSWER SIZE 7 % (Antal register * 2) + 5
DATA[0] = BYTE(Id);
DATA[1] = BYTE(04);
DATA[2] = BYTE(2); % Antal Bytes
DATA[3] -> RINT(
IF count3=0 THEN IF r4_097=7 THEN r4_097:=1; ELSE r4_097:=0; ENDIF;
ELSIF count3=1 THEN r4_413:=DATA/10;
ENDIF;
count3:=count3+1;
);
TIMEOUT 1000
END;
TELEGRAM ReadI_185 NAMED "Read Input 185-186" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(04); % Modbus kommando för att läsa register kod 03
DATA[2] := RWORD(184); % Start address
DATA[4] := RWORD(2); % Antal register att läsa
ANSWER SIZE 9 % (Antal register * 2) + 5
DATA[0] = BYTE(Id);
DATA[1] = BYTE(04);
DATA[2] = BYTE(4); % Antal Bytes
DATA[3] -> RINT(IF r4_185=7 THEN r4_185:=1; ELSE r4_185:=0; ENDIF;);
DATA[5] -> RINT(IF r4_186=7 THEN r4_186:=1; ELSE r4_186:=0; ENDIF;);
TIMEOUT 1000
END;
TELEGRAM ReadI_207 NAMED "Read Input 207-241" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(04); % Modbus kommando för att läsa register kod 03
DATA[2] := RWORD(206); % Start address
DATA[4] := RWORD(35); % Antal register att läsa
ANSWER SIZE 75 % (Antal register * 2) + 5
DATA[0] = BYTE(Id);
DATA[1] = BYTE(04);
DATA[2] = BYTE(70); % Antal Bytes
DATA[3] -> RINT(IF r4_207=7 THEN Tmp:=1; ELSE Tmp:=0; ENDIF; r4_207 := Tmp;);
DATA[15] -> RINT(IF r4_213=7 THEN Tmp:=1; ELSE Tmp:=0; ENDIF; r4_213 := Tmp;);
DATA[17] -> RINT(IF r4_214=7 THEN Tmp:=1; ELSE Tmp:=0; ENDIF; r4_214 := Tmp;);
DATA[19] -> RINT(IF r4_215=7 THEN Tmp:=1; ELSE Tmp:=0; ENDIF; r4_215 := Tmp;);
DATA[21] -> RINT(IF r4_216=7 THEN Tmp:=1; ELSE Tmp:=0; ENDIF; r4_216 := Tmp;);
DATA[23] -> RINT(IF r4_217=7 THEN Tmp:=1; ELSE Tmp:=0; ENDIF; r4_217 := Tmp;);
DATA[45] -> RINT(IF r4_238=7 THEN Tmp:=1; ELSE Tmp:=0; ENDIF; r4_238 := Tmp;);
DATA[47] -> RINT(IF r4_239=7 THEN Tmp:=1; ELSE Tmp:=0; ENDIF; r4_239 := Tmp;);
DATA[49] -> RINT(IF r4_240=7 THEN Tmp:=1; ELSE Tmp:=0; ENDIF; r4_240 := Tmp;);
DATA[41] -> RINT(IF r4_241=7 THEN Tmp:=1; ELSE Tmp:=0; ENDIF; r4_241 := Tmp;);
TIMEOUT 1000
END;
TELEGRAM ReadI_342 NAMED "Read Input 342-357" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(04); % Modbus kommando för att läsa register kod 03
DATA[2] := RWORD(341); % Start address
DATA[4] := RWORD(35); % Antal register att läsa
ANSWER SIZE 75 % (Antal register * 2) + 5
DATA[0] = BYTE(Id);
DATA[1] = BYTE(04);
DATA[2] = BYTE(70); % Antal Bytes
DATA[3] -> RINT(r4_342 := DATA/10;);
DATA[5] -> RINT(r4_343 := DATA/10;);
DATA[7] -> RINT(r4_344 := DATA/10;);
DATA[9] -> RINT(r4_345 := DATA/10;);
DATA[15] -> RINT(r4_348 := DATA/10;);
DATA[17] -> RINT(r4_349 := DATA;);
DATA[33] -> RINT(r4_357 := DATA;);
TIMEOUT 1000
END;
TELEGRAM ReadH_507 NAMED "Read Holding 507" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(03); % Modbus kommando för att läsa register kod 04
DATA[2] := RWORD(506); % Start address
DATA[4] := RWORD(1); % Antal register att läsa
ANSWER SIZE 7 % (Antal register * 2) + 5
DATA[0] = BYTE(Id);
DATA[1] = BYTE(03);
DATA[2] = BYTE(2); % Antal Bytes
DATA[3] -> RINT(r3_507 := DATA/10;);
TIMEOUT 1000
END;
TELEGRAM ReadH_538 NAMED "Read Holding 538-554" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(03); % Modbus kommando för att läsa register kod 04
DATA[2] := RWORD(537); % Start address
DATA[4] := RWORD(17); % Antal register att läsa
ANSWER SIZE 39 % (Antal register * 2) + 5
DATA[0] = BYTE(Id);
DATA[1] = BYTE(03);
DATA[2] = BYTE(34); % Antal Bytes
DATA[3] -> RINT(r3_538 := DATA/10;);
DATA[5] -> RINT(r3_539 := DATA;);
DATA[7] -> RINT(r3_540 := DATA;);
DATA[9] -> RINT(r3_541 := DATA;);
DATA[11] -> RINT(r3_542 := DATA;);
DATA[13] -> RINT(r3_543 := DATA;);
DATA[15] -> RINT(r3_544 := DATA;);
DATA[17] -> RINT(r3_545 := DATA;);
DATA[19] -> RINT(r3_546 := DATA;);
DATA[21] -> RINT(r3_547 := DATA;);
DATA[23] -> RINT(r3_548 := DATA;);
DATA[25] -> RINT(r3_549 := DATA;);
DATA[27] -> RINT(r3_550 := DATA;);
DATA[29] -> RINT(r3_551 := DATA;);
DATA[31] -> RINT(r3_552 := DATA;);
DATA[33] -> RINT(r3_553 := DATA;);
DATA[35] -> RINT(r3_554 := DATA;);
TIMEOUT 1000
END;
TELEGRAM ReadH_604 NAMED "Read Holding 604-606" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(03); % Modbus kommando för att läsa register kod 04
DATA[2] := RWORD(603); % Start address
DATA[4] := RWORD(3); % Antal register att läsa
ANSWER SIZE 11 % (Antal register * 2) + 5
DATA[0] = BYTE(Id);
DATA[1] = BYTE(03);
DATA[2] = BYTE(6); % Antal Bytes
DATA[3] -> RINT(r3_604 := DATA/10;);
DATA[7] -> RINT(r3_606 := DATA/10;);
TIMEOUT 1000
END;
TELEGRAM WriteH_507 NAMED "Write holding 507" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(06); % Modbus kommando för att skriva ett register
DATA[2] := RWORD(506); % Register adress
DATA[4] <- RWORD(DATA:=w3_507*10;);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = BYTE(06);
TIMEOUT 1000
END;
TELEGRAM WriteH_538 NAMED "Write holding 538" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(06); % Modbus kommando för att skriva ett register
DATA[2] := RWORD(537); % Register adress
DATA[4] <- RWORD(DATA:=w3_538*10;);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = BYTE(06);
TIMEOUT 1000
END;
TELEGRAM WriteH_539 NAMED "Write holding 539" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(06); % Modbus kommando för att skriva ett register
DATA[2] := RWORD(538); % Register adress
DATA[4] <- RWORD(DATA:=w3_539;);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = BYTE(06);
TIMEOUT 1000
END;
TELEGRAM WriteH_540 NAMED "Write holding 540" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(06); % Modbus kommando för att skriva ett register
DATA[2] := RWORD(539); % Register adress
DATA[4] <- RWORD(DATA:=w3_540;);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = BYTE(06);
TIMEOUT 1000
END;
TELEGRAM WriteH_541 NAMED "Write holding 541" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(06); % Modbus kommando för att skriva ett register
DATA[2] := RWORD(540); % Register adress
DATA[4] <- RWORD(DATA:=w3_541;);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = BYTE(06);
TIMEOUT 1000
END;
TELEGRAM WriteH_542 NAMED "Write holding 542" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(06); % Modbus kommando för att skriva ett register
DATA[2] := RWORD(541); % Register adress
DATA[4] <- RWORD(DATA:=w3_542;);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = BYTE(06);
TIMEOUT 1000
END;
TELEGRAM WriteH_543 NAMED "Write holding 543" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(06); % Modbus kommando för att skriva ett register
DATA[2] := RWORD(542); % Register adress
DATA[4] <- RWORD(DATA:=w3_543;);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = BYTE(06);
TIMEOUT 1000
END;
TELEGRAM WriteH_544 NAMED "Write holding 544" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(06); % Modbus kommando för att skriva ett register
DATA[2] := RWORD(543); % Register adress
DATA[4] <- RWORD(DATA:=w3_544;);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = BYTE(06);
TIMEOUT 1000
END;
TELEGRAM WriteH_545 NAMED "Write holding 545" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(06); % Modbus kommando för att skriva ett register
DATA[2] := RWORD(544); % Register adress
DATA[4] <- RWORD(DATA:=w3_545;);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = BYTE(06);
TIMEOUT 1000
END;
TELEGRAM WriteH_546 NAMED "Write holding 546" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(06); % Modbus kommando för att skriva ett register
DATA[2] := RWORD(545); % Register adress
DATA[4] <- RWORD(DATA:=w3_546;);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = BYTE(06);
TIMEOUT 1000
END;
TELEGRAM WriteH_547 NAMED "Write holding 547" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(06); % Modbus kommando för att skriva ett register
DATA[2] := RWORD(546); % Register adress
DATA[4] <- RWORD(DATA:=w3_547;);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = BYTE(06);
TIMEOUT 1000
END;
TELEGRAM WriteH_548 NAMED "Write holding 548" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(06); % Modbus kommando för att skriva ett register
DATA[2] := RWORD(547); % Register adress
DATA[4] <- RWORD(DATA:=w3_548;);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = BYTE(06);
TIMEOUT 1000
END;
TELEGRAM WriteH_549 NAMED "Write holding 549" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(06); % Modbus kommando för att skriva ett register
DATA[2] := RWORD(548); % Register adress
DATA[4] <- RWORD(DATA:=w3_549;);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = BYTE(06);
TIMEOUT 1000
END;
TELEGRAM WriteH_550 NAMED "Write holding 550" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(06); % Modbus kommando för att skriva ett register
DATA[2] := RWORD(549); % Register adress
DATA[4] <- RWORD(DATA:=w3_550;);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = BYTE(06);
TIMEOUT 1000
END;
TELEGRAM WriteH_551 NAMED "Write holding 551" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(06); % Modbus kommando för att skriva ett register
DATA[2] := RWORD(550); % Register adress
DATA[4] <- RWORD(DATA:=w3_551;);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = BYTE(06);
TIMEOUT 1000
END;
TELEGRAM WriteH_552 NAMED "Write holding 552" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(06); % Modbus kommando för att skriva ett register
DATA[2] := RWORD(551); % Register adress
DATA[4] <- RWORD(DATA:=w3_552;);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = BYTE(06);
TIMEOUT 1000
END;
TELEGRAM WriteH_553 NAMED "Write holding 553" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(06); % Modbus kommando för att skriva ett register
DATA[2] := RWORD(552); % Register adress
DATA[4] <- RWORD(DATA:=w3_553;);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = BYTE(06);
TIMEOUT 1000
END;
TELEGRAM WriteH_554 NAMED "Write holding 554" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(06); % Modbus kommando för att skriva ett register
DATA[2] := RWORD(553); % Register adress
DATA[4] <- RWORD(DATA:=w3_554;);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = BYTE(06);
TIMEOUT 1000
END;
TELEGRAM WriteH_604 NAMED "Write holding 604" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(06); % Modbus kommando för att skriva ett register
DATA[2] := RWORD(603); % Register adress
DATA[4] <- RWORD(DATA:=w3_604*10;);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = BYTE(06);
TIMEOUT 1000
END;
TELEGRAM WriteH_606 NAMED "Write holding 606" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(06); % Modbus kommando för att skriva ett register
DATA[2] := RWORD(605); % Register adress
DATA[4] <- RWORD(DATA:=w3_606*10;);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = BYTE(06);
TIMEOUT 1000
END;
SCHEDULER BEGIN
DEFAULT(ReadH_507);
DEFAULT(ReadH_538);
DEFAULT(ReadH_604);
DEFAULT(ReadI_97);
DEFAULT(ReadI_185);
DEFAULT(ReadI_207);
DEFAULT(ReadI_342);
IF (started AND Started) THEN
IF (ol3_507 <> w3_507) AND (NOT WriteH_507.ISDISABLED) THEN
TRANSMIT(WriteH_507);
ENDIF;
IF (ol3_538 <> w3_538) AND (NOT WriteH_538.ISDISABLED) THEN
TRANSMIT(WriteH_538);
ENDIF;
IF (ol3_539 <> w3_539) AND (NOT WriteH_539.ISDISABLED) THEN
TRANSMIT(WriteH_539);
ENDIF;
IF (ol3_540 <> w3_540) AND (NOT WriteH_540.ISDISABLED) THEN
TRANSMIT(WriteH_540);
ENDIF;
IF (ol3_541 <> w3_541) AND (NOT WriteH_541.ISDISABLED) THEN
TRANSMIT(WriteH_541);
ENDIF;
IF (ol3_542 <> w3_542) AND (NOT WriteH_542.ISDISABLED) THEN
TRANSMIT(WriteH_542);
ENDIF;
IF (ol3_543 <> w3_543) AND (NOT WriteH_543.ISDISABLED) THEN
TRANSMIT(WriteH_543);
ENDIF;
IF (ol3_544 <> w3_544) AND (NOT WriteH_544.ISDISABLED) THEN
TRANSMIT(WriteH_544);
ENDIF;
IF (ol3_545 <> w3_545) AND (NOT WriteH_545.ISDISABLED) THEN
TRANSMIT(WriteH_545);
ENDIF;
IF (ol3_546 <> w3_546) AND (NOT WriteH_546.ISDISABLED) THEN
TRANSMIT(WriteH_546);
ENDIF;
IF (ol3_547 <> w3_547) AND (NOT WriteH_547.ISDISABLED) THEN
TRANSMIT(WriteH_547);
ENDIF;
IF (ol3_548 <> w3_548) AND (NOT WriteH_548.ISDISABLED) THEN
TRANSMIT(WriteH_548);
ENDIF;
IF (ol3_549 <> w3_549) AND (NOT WriteH_549.ISDISABLED) THEN
TRANSMIT(WriteH_549);
ENDIF;
IF (ol3_550 <> w3_550) AND (NOT WriteH_550.ISDISABLED) THEN
TRANSMIT(WriteH_550);
ENDIF;
IF (ol3_551 <> w3_551) AND (NOT WriteH_551.ISDISABLED) THEN
TRANSMIT(WriteH_551);
ENDIF;
IF (ol3_552 <> w3_552) AND (NOT WriteH_552.ISDISABLED) THEN
TRANSMIT(WriteH_552);
ENDIF;
IF (ol3_553 <> w3_553) AND (NOT WriteH_553.ISDISABLED) THEN
TRANSMIT(WriteH_553);
ENDIF;
IF (ol3_554 <> w3_554) AND (NOT WriteH_554.ISDISABLED) THEN
TRANSMIT(WriteH_554);
ENDIF;
IF (ol3_604 <> w3_604) AND (NOT WriteH_604.ISDISABLED) THEN
TRANSMIT(WriteH_604);
ENDIF;
IF (ol3_606 <> w3_606) AND (NOT WriteH_606.ISDISABLED) THEN
TRANSMIT(WriteH_606);
ENDIF;
ENDIF;
IF (Started) THEN
started := 1;
ELSE
started := 0;
ENDIF;
ol3_507 := w3_507;
ol3_538 := w3_538 ;
ol3_539 := w3_539;
ol3_540 := w3_540 ;
ol3_541 := w3_541 ;
ol3_542 := w3_542 ;
ol3_543 := w3_543 ;
ol3_544 := w3_544 ;
ol3_545 := w3_545 ;
ol3_546 := w3_546;
ol3_547 := w3_547;
ol3_548 := w3_548;
ol3_549 := w3_549;
ol3_550 := w3_550;
ol3_551 := w3_551;
ol3_551 := w3_551;
ol3_552 := w3_552;
ol3_553 := w3_553;
ol3_554 := w3_554;
ol3_604 := w3_604;
ol3_606 := w3_606;
END;
END;
% reads max 47 registers
PARAMETER
Id : "Address"INT;
Started : "Write if changed" ["Off,On"]ENUM;
w3_507 : "Set Outdoor temp" ["°C"]DEC1;
w3_538 : "Set Parallel adj of curve CS1" ["°C"]DEC1;
w3_539 : "Set Outdoor temp x1 curve CS1" ["°C"]INT;
w3_540 : "Set Outdoor temp x2 curve CS1" ["°C"]INT;
w3_541 : "Set Outdoor temp x3 curve CS1" ["°C"]INT;
w3_542 : "Set Outdoor temp x4 curve CS1" ["°C"]INT;
w3_543 : "Set Outdoor temp x5 curve CS1" ["°C"]INT;
w3_544 : "Set Outdoor temp x6 curve CS1" ["°C"]INT;
w3_545 : "Set Outdoor temp x7 curve CS1" ["°C"]INT;
w3_546 : "Set Outdoor temp x8 curve CS1" ["°C"]INT;
w3_547 : "Set Setpoint temp y1 curve CS1" ["°C"]INT;
w3_548 : "Set Setpoint temp y2 curve CS1" ["°C"]INT;
w3_549 : "Set Setpoint temp y3 curve CS1" ["°C"]INT;
w3_550 : "Set Setpoint temp y4 curve CS1" ["°C"]INT;
w3_551 : "Set Setpoint temp y5 curve CS1" ["°C"]INT;
w3_552 : "Set Setpoint temp y6 curve CS1" ["°C"]INT;
w3_553 : "Set Setpoint temp y7 curve CS1" ["°C"]INT;
w3_554 : "Set Setpoint temp y8 curve CS1" ["°C"]INT;
w3_604 : "Set Outdoor temp for pump stop day" ["°C"]DEC1;
w3_606 : "Set Setpoint CS1" ["°C"]DEC1;
PUBLIC
% r3=Holding register
r3_507 : "Outdoor temp" ["°C"]DEC1;
r3_538 : "Parallel adj of curve CS1" ["°C"]DEC1;
r3_539 : "Outdoor temp x1 curve CS1" ["°C"]INT; %default 20
r3_540 : "Outdoor temp x2 curve CS1" ["°C"]INT; %default 22
r3_541 : "Outdoor temp x3 curve CS1" ["°C"]INT; %default 24
r3_542 : "Outdoor temp x4 curve CS1" ["°C"]INT; %default 26
r3_543 : "Outdoor temp x5 curve CS1" ["°C"]INT; %default 28
r3_544 : "Outdoor temp x6 curve CS1" ["°C"]INT; %default 30
r3_545 : "Outdoor temp x7 curve CS1" ["°C"]INT; %default 32
r3_546 : "Outdoor temp x8 curve CS1" ["°C"]INT; %default 34
r3_547 : "Setpoint temp y1 curve CS1" ["°C"]INT; %default 14
r3_548 : "Setpoint temp y2 curve CS1" ["°C"]INT; %default 14
r3_549 : "Setpoint temp y3 curve CS1" ["°C"]INT; %default 13
r3_550 : "Setpoint temp y4 curve CS1" ["°C"]INT; %default 12
r3_551 : "Setpoint temp y5 curve CS1" ["°C"]INT; %default 12
r3_552 : "Setpoint temp y6 curve CS1" ["°C"]INT; %default 11
r3_553 : "Setpoint temp y7 curve CS1" ["°C"]INT; %default 10
r3_554 : "Setpoint temp y8 curve CS1" ["°C"]INT; %default 9
r3_604 : "Outdoor temp for pump stop day" ["°C"]DEC1;
r3_606 : "Setpoint CS1" ["°C"]DEC1;
% r4=input tegister
r4_097 : "Expansion vessel alarm"INT;
r4_185 : "Sensor error CS1 supply"INT;
r4_186 : "Sensor error CS1 reply"INT;
r4_207 : "Deviation CS1 alarm"INT;
r4_213 : "Malfunction P1A-CS1"INT;
r4_214 : "Malfunction P1B-CS1"INT;
r4_215 : "Malfunction P1A&B-CS1"INT;
r4_216 : "P1A-CS1 manual"INT;
r4_217 : "P1B-CS1 manual"INT;
r4_238 : "Start signal pump CS1 P1A"INT;
r4_239 : "Start signal pump CS1 P1B"INT;
r4_240 : "Pump running CS1 P1A"INT;
r4_241 : "Pump running CS1 P1B"INT;
r4_342 : "Supply temperature CS1" ["°C"]DEC1;
r4_343 : "Setpoint supply temperature CS1 dew comp" ["°C"]DEC1;
r4_344 : "Room temperature CS1" ["°C"]DEC1;
r4_345 : "Return temperature CS1" ["°C"]DEC1;
r4_348 : "Control output CS1" ["%"]INT;
r4_349 : "Control signal CS1 CV" ["V"]INT;
r4_357 : "Humidity" INT;
r4_413 : "Calculated dewpoint temp" ["°C"]DEC1;
% Input status register
r2_102 : "Internal battery error"INT;
PRIVATE
started;
count3;
Tmp;
% old local values
ol3_507;
ol3_538;
ol3_539;
ol3_540;
ol3_541;
ol3_542;
ol3_543;
ol3_544;
ol3_545;
ol3_546;
ol3_547;
ol3_548;
ol3_549;
ol3_550;
ol3_551;
ol3_552;
ol3_553;
ol3_554;
ol3_604;
ol3_606;
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM ReadD_102 NAMED "Read Discrete 102" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(02); % Modbus kommando för att läsa register kod 02
DATA[2] := RWORD(101); % Start address
DATA[4] := RWORD(1); % Antal register att läsa
ANSWER SIZE 6 % (Antal register / 8) avrundat uppåt + 5
DATA[0] = BYTE(Id);
DATA[1] = BYTE(02);
DATA[2] = BYTE(1); % Antal Bytes
DATA[3] -> BYTE(
IF (DATA & 1) THEN r2_102 := 1; ELSE r2_102 := 0; ENDIF;
);
TIMEOUT 1000
END;
TELEGRAM ReadI_97 NAMED "Read Input 97&413" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(04); % Modbus kommando för att läsa input register kod 03
DATA[2] <- RWORD(
IF count3>1 THEN count3:=0; ENDIF;
IF count3=0 THEN DATA:=96;
ELSIF count3=1 THEN DATA:=412;
ENDIF;
); % Start address
DATA[4] := RWORD(1); % Antal register att läsa
ANSWER SIZE 7 % (Antal register * 2) + 5
DATA[0] = BYTE(Id);
DATA[1] = BYTE(04);
DATA[2] = BYTE(2); % Antal Bytes
DATA[3] -> RINT(
IF count3=0 THEN IF r4_097=7 THEN r4_097:=1; ELSE r4_097:=0; ENDIF;
ELSIF count3=1 THEN r4_413:=DATA/10;
ENDIF;
count3:=count3+1;
);
TIMEOUT 1000
END;
TELEGRAM ReadI_185 NAMED "Read Input 185-186" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(04); % Modbus kommando för att läsa register kod 03
DATA[2] := RWORD(184); % Start address
DATA[4] := RWORD(2); % Antal register att läsa
ANSWER SIZE 9 % (Antal register * 2) + 5
DATA[0] = BYTE(Id);
DATA[1] = BYTE(04);
DATA[2] = BYTE(4); % Antal Bytes
DATA[3] -> RINT(IF r4_185=7 THEN r4_185:=1; ELSE r4_185:=0; ENDIF;);
DATA[5] -> RINT(IF r4_186=7 THEN r4_186:=1; ELSE r4_186:=0; ENDIF;);
TIMEOUT 1000
END;
TELEGRAM ReadI_207 NAMED "Read Input 207-241" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(04); % Modbus kommando för att läsa register kod 03
DATA[2] := RWORD(206); % Start address
DATA[4] := RWORD(35); % Antal register att läsa
ANSWER SIZE 75 % (Antal register * 2) + 5
DATA[0] = BYTE(Id);
DATA[1] = BYTE(04);
DATA[2] = BYTE(70); % Antal Bytes
DATA[3] -> RINT(IF r4_207=7 THEN Tmp:=1; ELSE Tmp:=0; ENDIF; r4_207 := Tmp;);
DATA[15] -> RINT(IF r4_213=7 THEN Tmp:=1; ELSE Tmp:=0; ENDIF; r4_213 := Tmp;);
DATA[17] -> RINT(IF r4_214=7 THEN Tmp:=1; ELSE Tmp:=0; ENDIF; r4_214 := Tmp;);
DATA[19] -> RINT(IF r4_215=7 THEN Tmp:=1; ELSE Tmp:=0; ENDIF; r4_215 := Tmp;);
DATA[21] -> RINT(IF r4_216=7 THEN Tmp:=1; ELSE Tmp:=0; ENDIF; r4_216 := Tmp;);
DATA[23] -> RINT(IF r4_217=7 THEN Tmp:=1; ELSE Tmp:=0; ENDIF; r4_217 := Tmp;);
DATA[45] -> RINT(IF r4_238=7 THEN Tmp:=1; ELSE Tmp:=0; ENDIF; r4_238 := Tmp;);
DATA[47] -> RINT(IF r4_239=7 THEN Tmp:=1; ELSE Tmp:=0; ENDIF; r4_239 := Tmp;);
DATA[49] -> RINT(IF r4_240=7 THEN Tmp:=1; ELSE Tmp:=0; ENDIF; r4_240 := Tmp;);
DATA[41] -> RINT(IF r4_241=7 THEN Tmp:=1; ELSE Tmp:=0; ENDIF; r4_241 := Tmp;);
TIMEOUT 1000
END;
TELEGRAM ReadI_342 NAMED "Read Input 342-357" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(04); % Modbus kommando för att läsa register kod 03
DATA[2] := RWORD(341); % Start address
DATA[4] := RWORD(35); % Antal register att läsa
ANSWER SIZE 75 % (Antal register * 2) + 5
DATA[0] = BYTE(Id);
DATA[1] = BYTE(04);
DATA[2] = BYTE(70); % Antal Bytes
DATA[3] -> RINT(r4_342 := DATA/10;);
DATA[5] -> RINT(r4_343 := DATA/10;);
DATA[7] -> RINT(r4_344 := DATA/10;);
DATA[9] -> RINT(r4_345 := DATA/10;);
DATA[15] -> RINT(r4_348 := DATA/10;);
DATA[17] -> RINT(r4_349 := DATA;);
DATA[33] -> RINT(r4_357 := DATA;);
TIMEOUT 1000
END;
TELEGRAM ReadH_507 NAMED "Read Holding 507" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(03); % Modbus kommando för att läsa register kod 04
DATA[2] := RWORD(506); % Start address
DATA[4] := RWORD(1); % Antal register att läsa
ANSWER SIZE 7 % (Antal register * 2) + 5
DATA[0] = BYTE(Id);
DATA[1] = BYTE(03);
DATA[2] = BYTE(2); % Antal Bytes
DATA[3] -> RINT(r3_507 := DATA/10;);
TIMEOUT 1000
END;
TELEGRAM ReadH_538 NAMED "Read Holding 538-554" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(03); % Modbus kommando för att läsa register kod 04
DATA[2] := RWORD(537); % Start address
DATA[4] := RWORD(17); % Antal register att läsa
ANSWER SIZE 39 % (Antal register * 2) + 5
DATA[0] = BYTE(Id);
DATA[1] = BYTE(03);
DATA[2] = BYTE(34); % Antal Bytes
DATA[3] -> RINT(r3_538 := DATA/10;);
DATA[5] -> RINT(r3_539 := DATA;);
DATA[7] -> RINT(r3_540 := DATA;);
DATA[9] -> RINT(r3_541 := DATA;);
DATA[11] -> RINT(r3_542 := DATA;);
DATA[13] -> RINT(r3_543 := DATA;);
DATA[15] -> RINT(r3_544 := DATA;);
DATA[17] -> RINT(r3_545 := DATA;);
DATA[19] -> RINT(r3_546 := DATA;);
DATA[21] -> RINT(r3_547 := DATA;);
DATA[23] -> RINT(r3_548 := DATA;);
DATA[25] -> RINT(r3_549 := DATA;);
DATA[27] -> RINT(r3_550 := DATA;);
DATA[29] -> RINT(r3_551 := DATA;);
DATA[31] -> RINT(r3_552 := DATA;);
DATA[33] -> RINT(r3_553 := DATA;);
DATA[35] -> RINT(r3_554 := DATA;);
TIMEOUT 1000
END;
TELEGRAM ReadH_604 NAMED "Read Holding 604-606" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(03); % Modbus kommando för att läsa register kod 04
DATA[2] := RWORD(603); % Start address
DATA[4] := RWORD(3); % Antal register att läsa
ANSWER SIZE 11 % (Antal register * 2) + 5
DATA[0] = BYTE(Id);
DATA[1] = BYTE(03);
DATA[2] = BYTE(6); % Antal Bytes
DATA[3] -> RINT(r3_604 := DATA/10;);
DATA[7] -> RINT(r3_606 := DATA/10;);
TIMEOUT 1000
END;
TELEGRAM WriteH_507 NAMED "Write holding 507" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(06); % Modbus kommando för att skriva ett register
DATA[2] := RWORD(506); % Register adress
DATA[4] <- RWORD(DATA:=w3_507*10;);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = BYTE(06);
TIMEOUT 1000
END;
TELEGRAM WriteH_538 NAMED "Write holding 538" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(06); % Modbus kommando för att skriva ett register
DATA[2] := RWORD(537); % Register adress
DATA[4] <- RWORD(DATA:=w3_538*10;);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = BYTE(06);
TIMEOUT 1000
END;
TELEGRAM WriteH_539 NAMED "Write holding 539" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(06); % Modbus kommando för att skriva ett register
DATA[2] := RWORD(538); % Register adress
DATA[4] <- RWORD(DATA:=w3_539;);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = BYTE(06);
TIMEOUT 1000
END;
TELEGRAM WriteH_540 NAMED "Write holding 540" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(06); % Modbus kommando för att skriva ett register
DATA[2] := RWORD(539); % Register adress
DATA[4] <- RWORD(DATA:=w3_540;);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = BYTE(06);
TIMEOUT 1000
END;
TELEGRAM WriteH_541 NAMED "Write holding 541" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(06); % Modbus kommando för att skriva ett register
DATA[2] := RWORD(540); % Register adress
DATA[4] <- RWORD(DATA:=w3_541;);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = BYTE(06);
TIMEOUT 1000
END;
TELEGRAM WriteH_542 NAMED "Write holding 542" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(06); % Modbus kommando för att skriva ett register
DATA[2] := RWORD(541); % Register adress
DATA[4] <- RWORD(DATA:=w3_542;);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = BYTE(06);
TIMEOUT 1000
END;
TELEGRAM WriteH_543 NAMED "Write holding 543" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(06); % Modbus kommando för att skriva ett register
DATA[2] := RWORD(542); % Register adress
DATA[4] <- RWORD(DATA:=w3_543;);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = BYTE(06);
TIMEOUT 1000
END;
TELEGRAM WriteH_544 NAMED "Write holding 544" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(06); % Modbus kommando för att skriva ett register
DATA[2] := RWORD(543); % Register adress
DATA[4] <- RWORD(DATA:=w3_544;);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = BYTE(06);
TIMEOUT 1000
END;
TELEGRAM WriteH_545 NAMED "Write holding 545" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(06); % Modbus kommando för att skriva ett register
DATA[2] := RWORD(544); % Register adress
DATA[4] <- RWORD(DATA:=w3_545;);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = BYTE(06);
TIMEOUT 1000
END;
TELEGRAM WriteH_546 NAMED "Write holding 546" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(06); % Modbus kommando för att skriva ett register
DATA[2] := RWORD(545); % Register adress
DATA[4] <- RWORD(DATA:=w3_546;);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = BYTE(06);
TIMEOUT 1000
END;
TELEGRAM WriteH_547 NAMED "Write holding 547" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(06); % Modbus kommando för att skriva ett register
DATA[2] := RWORD(546); % Register adress
DATA[4] <- RWORD(DATA:=w3_547;);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = BYTE(06);
TIMEOUT 1000
END;
TELEGRAM WriteH_548 NAMED "Write holding 548" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(06); % Modbus kommando för att skriva ett register
DATA[2] := RWORD(547); % Register adress
DATA[4] <- RWORD(DATA:=w3_548;);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = BYTE(06);
TIMEOUT 1000
END;
TELEGRAM WriteH_549 NAMED "Write holding 549" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(06); % Modbus kommando för att skriva ett register
DATA[2] := RWORD(548); % Register adress
DATA[4] <- RWORD(DATA:=w3_549;);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = BYTE(06);
TIMEOUT 1000
END;
TELEGRAM WriteH_550 NAMED "Write holding 550" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(06); % Modbus kommando för att skriva ett register
DATA[2] := RWORD(549); % Register adress
DATA[4] <- RWORD(DATA:=w3_550;);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = BYTE(06);
TIMEOUT 1000
END;
TELEGRAM WriteH_551 NAMED "Write holding 551" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(06); % Modbus kommando för att skriva ett register
DATA[2] := RWORD(550); % Register adress
DATA[4] <- RWORD(DATA:=w3_551;);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = BYTE(06);
TIMEOUT 1000
END;
TELEGRAM WriteH_552 NAMED "Write holding 552" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(06); % Modbus kommando för att skriva ett register
DATA[2] := RWORD(551); % Register adress
DATA[4] <- RWORD(DATA:=w3_552;);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = BYTE(06);
TIMEOUT 1000
END;
TELEGRAM WriteH_553 NAMED "Write holding 553" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(06); % Modbus kommando för att skriva ett register
DATA[2] := RWORD(552); % Register adress
DATA[4] <- RWORD(DATA:=w3_553;);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = BYTE(06);
TIMEOUT 1000
END;
TELEGRAM WriteH_554 NAMED "Write holding 554" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(06); % Modbus kommando för att skriva ett register
DATA[2] := RWORD(553); % Register adress
DATA[4] <- RWORD(DATA:=w3_554;);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = BYTE(06);
TIMEOUT 1000
END;
TELEGRAM WriteH_604 NAMED "Write holding 604" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(06); % Modbus kommando för att skriva ett register
DATA[2] := RWORD(603); % Register adress
DATA[4] <- RWORD(DATA:=w3_604*10;);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = BYTE(06);
TIMEOUT 1000
END;
TELEGRAM WriteH_606 NAMED "Write holding 606" IS
QUESTION
DATA[0] := BYTE(Id); % Enhetens Modbus adress
DATA[1] := HEX(06); % Modbus kommando för att skriva ett register
DATA[2] := RWORD(605); % Register adress
DATA[4] <- RWORD(DATA:=w3_606*10;);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = BYTE(06);
TIMEOUT 1000
END;
SCHEDULER BEGIN
DEFAULT(ReadH_507);
DEFAULT(ReadH_538);
DEFAULT(ReadH_604);
DEFAULT(ReadI_97);
DEFAULT(ReadI_185);
DEFAULT(ReadI_207);
DEFAULT(ReadI_342);
IF (started AND Started) THEN
IF (ol3_507 <> w3_507) AND (NOT WriteH_507.ISDISABLED) THEN
TRANSMIT(WriteH_507);
ENDIF;
IF (ol3_538 <> w3_538) AND (NOT WriteH_538.ISDISABLED) THEN
TRANSMIT(WriteH_538);
ENDIF;
IF (ol3_539 <> w3_539) AND (NOT WriteH_539.ISDISABLED) THEN
TRANSMIT(WriteH_539);
ENDIF;
IF (ol3_540 <> w3_540) AND (NOT WriteH_540.ISDISABLED) THEN
TRANSMIT(WriteH_540);
ENDIF;
IF (ol3_541 <> w3_541) AND (NOT WriteH_541.ISDISABLED) THEN
TRANSMIT(WriteH_541);
ENDIF;
IF (ol3_542 <> w3_542) AND (NOT WriteH_542.ISDISABLED) THEN
TRANSMIT(WriteH_542);
ENDIF;
IF (ol3_543 <> w3_543) AND (NOT WriteH_543.ISDISABLED) THEN
TRANSMIT(WriteH_543);
ENDIF;
IF (ol3_544 <> w3_544) AND (NOT WriteH_544.ISDISABLED) THEN
TRANSMIT(WriteH_544);
ENDIF;
IF (ol3_545 <> w3_545) AND (NOT WriteH_545.ISDISABLED) THEN
TRANSMIT(WriteH_545);
ENDIF;
IF (ol3_546 <> w3_546) AND (NOT WriteH_546.ISDISABLED) THEN
TRANSMIT(WriteH_546);
ENDIF;
IF (ol3_547 <> w3_547) AND (NOT WriteH_547.ISDISABLED) THEN
TRANSMIT(WriteH_547);
ENDIF;
IF (ol3_548 <> w3_548) AND (NOT WriteH_548.ISDISABLED) THEN
TRANSMIT(WriteH_548);
ENDIF;
IF (ol3_549 <> w3_549) AND (NOT WriteH_549.ISDISABLED) THEN
TRANSMIT(WriteH_549);
ENDIF;
IF (ol3_550 <> w3_550) AND (NOT WriteH_550.ISDISABLED) THEN
TRANSMIT(WriteH_550);
ENDIF;
IF (ol3_551 <> w3_551) AND (NOT WriteH_551.ISDISABLED) THEN
TRANSMIT(WriteH_551);
ENDIF;
IF (ol3_552 <> w3_552) AND (NOT WriteH_552.ISDISABLED) THEN
TRANSMIT(WriteH_552);
ENDIF;
IF (ol3_553 <> w3_553) AND (NOT WriteH_553.ISDISABLED) THEN
TRANSMIT(WriteH_553);
ENDIF;
IF (ol3_554 <> w3_554) AND (NOT WriteH_554.ISDISABLED) THEN
TRANSMIT(WriteH_554);
ENDIF;
IF (ol3_604 <> w3_604) AND (NOT WriteH_604.ISDISABLED) THEN
TRANSMIT(WriteH_604);
ENDIF;
IF (ol3_606 <> w3_606) AND (NOT WriteH_606.ISDISABLED) THEN
TRANSMIT(WriteH_606);
ENDIF;
ENDIF;
IF (Started) THEN
started := 1;
ELSE
started := 0;
ENDIF;
ol3_507 := w3_507;
ol3_538 := w3_538 ;
ol3_539 := w3_539;
ol3_540 := w3_540 ;
ol3_541 := w3_541 ;
ol3_542 := w3_542 ;
ol3_543 := w3_543 ;
ol3_544 := w3_544 ;
ol3_545 := w3_545 ;
ol3_546 := w3_546;
ol3_547 := w3_547;
ol3_548 := w3_548;
ol3_549 := w3_549;
ol3_550 := w3_550;
ol3_551 := w3_551;
ol3_551 := w3_551;
ol3_552 := w3_552;
ol3_553 := w3_553;
ol3_554 := w3_554;
ol3_604 := w3_604;
ol3_606 := w3_606;
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.