Wilo
Detaljer
- Typ
- Drivrutin
- Upplaggd av
- Ove Jansson, Abelko Innovation
- Version
- 1
- Uppdaterad
- 2013-08-28
- Skapad
- 2013-08-28
- Kategori
- Modbus, Övrig utrustning, Vatten och avlopp
- Visningar
- 3250
Beskrivning
Drivrutin
Bruksanvisning
Hur man installerar typdefinitionerna och driftsätter modulerna finns beskrivet i användarmanualen, kapitel 18.7.
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 Wilo NAMED "Wilo" TYPEID 22112 IS
PARAMETER
Id : "Adress";
V8 : "Set Value" ["%"];
V9 : "Pump Command" [""]; % bit0(1=pump on,0=off), b1=min speed, b2=max speed
V10 : "Operation Mode" [""]; % mode 1= fixed speed, 3=DELTAp-c reg (default), 4=DELTA-v reg, 6=DELTA-T reg, 140=PID control (not supported by DigiCon)
V11 : "Tmin for DELTAp-T" ["K"];
V12 : "Tmax for DELTAp-T" ["K"];
V13 : "pmin for DELTAp-T" ["m WS"]; % 1m WS =9.8kPa = 0.098 bar
V14 : "pmax for DELTAp-T" ["m WS"]; % 1m WS =9.8kPa = 0.098 bar
PUBLIC
V1 : "Set Value" ["%"];
V2 : "Pump Command" [""]; % bit0(1=pump on,0=off), b1=min speed, b2=max speed
V3 : "Operation Mode" [""]; % mode 1= fixed speed, 3=DELTAp-c reg (default), 4=DELTA-v reg, 6=DELTA-T reg, 140=PID control (not supported by DigiCon)
V4 : "Tmin for DELTAp-T" ["K"];
V5 : "Tmax for DELTAp-T" ["K"];
V6 : "pmin for DELTAp-T" ["m WS"]; % 1m WS =9.8kPa = 0.098 bar
V7 : "pmax for DELTAp-T" ["m WS"]; % 1m WS =9.8kPa = 0.098 bar
PRIVATE
count6;
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 kod 03
DATA[2] := RWORD(1); % Start address
DATA[4] := RWORD(47); % Antal register att l�sa
ANSWER SIZE 99 % (Antal register * 2) + 5
DATA[0] = BYTE(Id);
DATA[1] = BYTE(03);
DATA[2] = BYTE(94); % Antal Bytes
DATA[3] -> RWORD(V1 := DATA/0.5;);
DATA[81] -> RWORD(V2 := DATA;);
DATA[85] -> RWORD(V3 := DATA;);
DATA[89] -> RWORD(V4 := DATA/10;);
DATA[91] -> RWORD(V5 := DATA/10;);
DATA[93] -> RWORD(V6 := DATA/10;);
DATA[95] -> RWORD(V7 := DATA/10;);
TIMEOUT 500
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 := 1;
ELSIF (count6=1) THEN DATA := 40;
ELSIF (count6=2) THEN DATA := 42;
ELSIF (count6=3) THEN DATA := 44;
ELSIF (count6=4) THEN DATA := 45;
ELSIF (count6=5) THEN DATA := 46;
ELSIF (count6=6) THEN DATA := 47;
ENDIF;
); % Register adress
DATA[4] <- RWORD(
IF (count6=0) THEN DATA := V8/0.5;
ELSIF (count6=1) THEN DATA := V9;
ELSIF (count6=2) THEN DATA := V10;
ELSIF (count6=3) THEN DATA := V11/10;
ELSIF (count6=4) THEN DATA := V12/10;
ELSIF (count6=5) THEN DATA := V13/10;
ELSIF (count6=6) THEN DATA := V14/10;
ENDIF;
count6 := count6+1;
);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = BYTE(06);
TIMEOUT 500
END;
END;
DEVICETYPE WiloInput NAMED "Wilo Input" TYPEID 22113 IS
PARAMETER
Id : "Adress";
PUBLIC
V1 : "Actual Differential Preasure" ["m WS"]DEC1; % 1m WS =9.8kPa = 0.098 bar
V2 : "Flow Rate" ["m3/h"]DEC1;
V3 : "Power Consumption" ["kWh"];
V4 : "Power Rating" ["W"];
V5 : "Operation Hours" ["10 hours"];
V6 : "Mains Current" ["A"]DEC1;
V7 : "Speed" ["rpm"];
V8 : "Medium Temperature" ["K"]DEC1;
V9 : "Current Operation Mode" [""]; % mode 1= fixed speed, 3=DELTAp-c reg (default), 4=DELTA-v reg, 6=DELTA-T reg, 140=PID control (not supported by DigiCon)
V10 : "Pump Module" [""]; % bit1(1=pump is regulated with a frequency-converter, 0=not regulated)
V11 : "Pump type" [""]; % see http://www.wilo.com/automation
V12 : "Max speed" ["rpm"];
V13 : "Min Speed" ["rpm"];
PRIVATE
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 kod 04
DATA[2] := RWORD(1); % Start address
DATA[4] := RWORD(19); % Antal register att l�sa
ANSWER SIZE 43 % (Antal register * 2) + 5
DATA[0] = BYTE(Id);
DATA[1] = BYTE(04);
DATA[2] = BYTE(38); % Antal Bytes
DATA[3] -> RWORD(V1 := DATA/10;);
DATA[5] -> RWORD(V2 := DATA/10;);
DATA[7] -> RWORD(V3 := DATA;);
DATA[9] -> RWORD(V4 := DATA;);
DATA[11] -> RWORD(V5 := DATA;);
DATA[13] -> RWORD(V6 := DATA/10;);
DATA[15] -> RWORD(V7 := DATA;);
DATA[17] -> RWORD(V8 := DATA/10;);
DATA[19] -> RWORD(V9 := DATA;);
DATA[33] -> RWORD(V10 := DATA;);
DATA[35] -> RWORD(V11 := DATA;);
DATA[37] -> RWORD(V12 := DATA;);
DATA[39] -> RWORD(V13 := DATA;);
TIMEOUT 500
END;
END;
PARAMETER
Id : "Adress";
V8 : "Set Value" ["%"];
V9 : "Pump Command" [""]; % bit0(1=pump on,0=off), b1=min speed, b2=max speed
V10 : "Operation Mode" [""]; % mode 1= fixed speed, 3=DELTAp-c reg (default), 4=DELTA-v reg, 6=DELTA-T reg, 140=PID control (not supported by DigiCon)
V11 : "Tmin for DELTAp-T" ["K"];
V12 : "Tmax for DELTAp-T" ["K"];
V13 : "pmin for DELTAp-T" ["m WS"]; % 1m WS =9.8kPa = 0.098 bar
V14 : "pmax for DELTAp-T" ["m WS"]; % 1m WS =9.8kPa = 0.098 bar
PUBLIC
V1 : "Set Value" ["%"];
V2 : "Pump Command" [""]; % bit0(1=pump on,0=off), b1=min speed, b2=max speed
V3 : "Operation Mode" [""]; % mode 1= fixed speed, 3=DELTAp-c reg (default), 4=DELTA-v reg, 6=DELTA-T reg, 140=PID control (not supported by DigiCon)
V4 : "Tmin for DELTAp-T" ["K"];
V5 : "Tmax for DELTAp-T" ["K"];
V6 : "pmin for DELTAp-T" ["m WS"]; % 1m WS =9.8kPa = 0.098 bar
V7 : "pmax for DELTAp-T" ["m WS"]; % 1m WS =9.8kPa = 0.098 bar
PRIVATE
count6;
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 kod 03
DATA[2] := RWORD(1); % Start address
DATA[4] := RWORD(47); % Antal register att l�sa
ANSWER SIZE 99 % (Antal register * 2) + 5
DATA[0] = BYTE(Id);
DATA[1] = BYTE(03);
DATA[2] = BYTE(94); % Antal Bytes
DATA[3] -> RWORD(V1 := DATA/0.5;);
DATA[81] -> RWORD(V2 := DATA;);
DATA[85] -> RWORD(V3 := DATA;);
DATA[89] -> RWORD(V4 := DATA/10;);
DATA[91] -> RWORD(V5 := DATA/10;);
DATA[93] -> RWORD(V6 := DATA/10;);
DATA[95] -> RWORD(V7 := DATA/10;);
TIMEOUT 500
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 := 1;
ELSIF (count6=1) THEN DATA := 40;
ELSIF (count6=2) THEN DATA := 42;
ELSIF (count6=3) THEN DATA := 44;
ELSIF (count6=4) THEN DATA := 45;
ELSIF (count6=5) THEN DATA := 46;
ELSIF (count6=6) THEN DATA := 47;
ENDIF;
); % Register adress
DATA[4] <- RWORD(
IF (count6=0) THEN DATA := V8/0.5;
ELSIF (count6=1) THEN DATA := V9;
ELSIF (count6=2) THEN DATA := V10;
ELSIF (count6=3) THEN DATA := V11/10;
ELSIF (count6=4) THEN DATA := V12/10;
ELSIF (count6=5) THEN DATA := V13/10;
ELSIF (count6=6) THEN DATA := V14/10;
ENDIF;
count6 := count6+1;
);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = BYTE(06);
TIMEOUT 500
END;
END;
DEVICETYPE WiloInput NAMED "Wilo Input" TYPEID 22113 IS
PARAMETER
Id : "Adress";
PUBLIC
V1 : "Actual Differential Preasure" ["m WS"]DEC1; % 1m WS =9.8kPa = 0.098 bar
V2 : "Flow Rate" ["m3/h"]DEC1;
V3 : "Power Consumption" ["kWh"];
V4 : "Power Rating" ["W"];
V5 : "Operation Hours" ["10 hours"];
V6 : "Mains Current" ["A"]DEC1;
V7 : "Speed" ["rpm"];
V8 : "Medium Temperature" ["K"]DEC1;
V9 : "Current Operation Mode" [""]; % mode 1= fixed speed, 3=DELTAp-c reg (default), 4=DELTA-v reg, 6=DELTA-T reg, 140=PID control (not supported by DigiCon)
V10 : "Pump Module" [""]; % bit1(1=pump is regulated with a frequency-converter, 0=not regulated)
V11 : "Pump type" [""]; % see http://www.wilo.com/automation
V12 : "Max speed" ["rpm"];
V13 : "Min Speed" ["rpm"];
PRIVATE
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 kod 04
DATA[2] := RWORD(1); % Start address
DATA[4] := RWORD(19); % Antal register att l�sa
ANSWER SIZE 43 % (Antal register * 2) + 5
DATA[0] = BYTE(Id);
DATA[1] = BYTE(04);
DATA[2] = BYTE(38); % Antal Bytes
DATA[3] -> RWORD(V1 := DATA/10;);
DATA[5] -> RWORD(V2 := DATA/10;);
DATA[7] -> RWORD(V3 := DATA;);
DATA[9] -> RWORD(V4 := DATA;);
DATA[11] -> RWORD(V5 := DATA;);
DATA[13] -> RWORD(V6 := DATA/10;);
DATA[15] -> RWORD(V7 := DATA;);
DATA[17] -> RWORD(V8 := DATA/10;);
DATA[19] -> RWORD(V9 := DATA;);
DATA[33] -> RWORD(V10 := DATA;);
DATA[35] -> RWORD(V11 := DATA;);
DATA[37] -> RWORD(V12 := DATA;);
DATA[39] -> RWORD(V13 := DATA;);
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.