Grundfos Magna 3 Redwolf Genibus
Detaljer
- Typ
- Drivrutin
- Upplaggd av
- Ove Jansson, Abelko Innovation
- Version
- 2
- Uppdaterad
- 2013-08-31
- Skapad
- 2013-08-27
- Kategori
- Värme
- Visningar
- 2571
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 Genibus NAMED "Genibus" TYPEID 15352
IS
PARAMETER
Destination :"Destination Address"INT;
Source :"Source Address"INT;
Start :"Start"INT;
th :"Tryckhöjd [%]"DEC2;
PUBLIC
% i_mo : "Motorström"["A"]INT;
% t_mo : "t_mo"["C"]DEC2;
t_w : "Vattentemp."["C"]DEC2;
speed : "Varvtal"["RPM"]INT;
q : "Vattenflöde"["m3/h"]DEC2;
h : "Tryckhöjd"["m"]DEC2;
p : "Effekt"["W"]INT;
energy : "Energi"["kWh"]INT;
time : "Drifttid"["h"]INT;
ALARM : "Alarm"INT;
PRIVATE
INFO1;
ZERO1;
RANGE1;
UNIT1;
INFO2;
ZERO2;
RANGE2;
UNIT2;
state;
p1;
p2;
tmp;
L1;
L2;
L3;
L4;
L5;
L6;
L7;
L8;
hi;
head_unit;
BAUDRATE 9600;
%PARITY EVEN;
CHECKSUM CRC16 SKIP 1 POLY 1021 INIT FFFF XOR FFFF;
POSTBYTES 0;
TELEGRAM Read NAMED "Read" IS
QUESTION
DATA[0] := HEX(27); % start delimiter
DATA[1] := BYTE(10); % datalength
DATA[2] := BYTE(Destination+31); % destination address
DATA[3] := BYTE(Source); % source address
% variables to be read
DATA[4] := HEX(02); % class 2 measured data
DATA[5] := HEX(C2); % OS=3(INFO operation), Length=2
DATA[6] <- BYTE(
state := state + 1;
IF (state < 0) THEN state:=0; ENDIF;
IF (state > 8) THEN state:=0; ENDIF;
IF (state=0) THEN DATA:=34; % p, power
ELSIF (state=1) THEN DATA:=37; % h, pump head/pressure
ELSIF (state=2) THEN DATA:=58; % t_w, pumped water temp
ELSIF (state=3) THEN DATA:=34;
ELSIF (state=4) THEN DATA:=34;
ELSIF (state=5) THEN DATA:=34;
ELSIF (state=6) THEN DATA:=34;
ELSIF (state=7) THEN DATA:=152; % energy_lo1, accumulated energy consumption
ELSIF (state=8) THEN DATA:=24; % t_2hour_hi, operating hours time hi
ENDIF;
% DATA := p1;
);
DATA[7] <- BYTE(
IF (state=0) THEN DATA:=35; % speed_hi, motor speed, RPM
ELSIF (state=1) THEN DATA:=39; % q, actual pump flow
ELSIF (state=2) THEN DATA:=32; % i_mo, motor current
ELSIF (state=3) THEN DATA:=34;
ELSIF (state=4) THEN DATA:=34;
ELSIF (state=5) THEN DATA:=34;
ELSIF (state=6) THEN DATA:=34;
ELSIF (state=7) THEN DATA:=152;
ELSIF (state=8) THEN DATA:=24; % INFO time hi
% ELSE p2:=58;
ENDIF;
% DATA := p2;
);
DATA[8] := HEX(02); % class 2 measured data
DATA[9] := HEX(02); % OS=0(GET operation), Length=2
DATA[10] <- BYTE(
IF (state=0) THEN DATA:=34;
ELSIF (state=1) THEN DATA:=37;
ELSIF (state=2) THEN DATA:=58;
ELSIF (state=3) THEN DATA:=64;
ELSIF (state=4) THEN DATA:=65;
ELSIF (state=5) THEN DATA:=66;
ELSIF (state=6) THEN DATA:=67;
ELSIF (state=7) THEN DATA:=152; % energy_hi
ELSIF (state=8) THEN DATA:=24; % time hi
ENDIF;
); % p
DATA[11] <- BYTE(
IF (state=0) THEN DATA:=35;
ELSIF (state=1) THEN DATA:=39;
ELSIF (state=2) THEN DATA:=32;
ELSIF (state=3) THEN DATA:=68;
ELSIF (state=4) THEN DATA:=69;
ELSIF (state=5) THEN DATA:=70;
ELSIF (state=6) THEN DATA:=71;
ELSIF (state=7) THEN DATA:=153; % energy_lo
ELSIF (state=8) THEN DATA:=25; % time hi
% ELSE DATA:= 58;
ENDIF;
);
ANSWER SIZE 20 % 28 14
DATA[0] = HEX(24); % start delimiter
DATA[1] = HEX(10); % datalength
DATA[6] -> BYTE(INFO1 := DATA;);
DATA[7] -> BYTE(UNIT1 := DATA;);
DATA[8] -> BYTE(ZERO1 := DATA;);
DATA[9] -> BYTE(RANGE1 := DATA;);
DATA[10] -> BYTE(INFO2 := DATA;);
DATA[11] -> BYTE(UNIT2 := DATA;);
DATA[12] -> BYTE(ZERO2 := DATA;);
DATA[13] -> BYTE(RANGE2 := DATA;);
DATA[16] -> BYTE(
tmp := (ZERO1+DATA*RANGE1/254);
IF (state=0) THEN % power
p:= tmp;
IF (UNIT1 = 8) THEN p:=p*10;
ELSIF (UNIT1 = 9) THEN p:=p*100;
ELSIF (UNIT1 = 44) THEN p:=p*1000;
ELSIF (UNIT1 = 44) THEN p:=p*10000;
ENDIF;
ELSIF (state=1) THEN % pump head
h:=tmp;
IF (UNIT1 = 91) THEN h:=h*0.0001;
ELSIF (UNIT1 = 83) THEN h:=h*0.01;
ELSIF (UNIT1 = 24) THEN h:=h*0.1;
ELSIF (UNIT1 = 25) THEN h:=h*1;
ELSIF (UNIT1 = 26) THEN h:=h*10;
ENDIF;
ELSIF (state=2) THEN % water temp;
t_w:=tmp;
IF (UNIT1 = 20) THEN t_w:=t_w*0.1;
ELSIF (UNIT1 = 21) THEN t_w:=t_w*1;
ELSIF (UNIT1 = 57) THEN t_w:=t_w*0.1;
ELSIF (UNIT1 = 84) THEN t_w:=t_w*0.01-273.15;
ENDIF;
ELSIF (state=3) THEN
L1 := DATA;
ELSIF (state=4) THEN
L2 := DATA;
ELSIF (state=5) THEN
L3 := DATA;
ELSIF (state=6) THEN
L4 := DATA;
ELSIF (state=7) THEN
hi := DATA;
ELSIF (state=8) THEN
hi := DATA;
ENDIF;
);
DATA[17] -> BYTE(
tmp := (ZERO2+DATA*RANGE2/254);
IF (state=0) THEN % rpm
speed:= tmp;
IF (UNIT2 = 18) THEN speed:=speed*12;
ELSIF (UNIT2 = 19) THEN speed:=speed*100;
ENDIF;
ELSIF (state=1) THEN % flow
q:=tmp;
IF (UNIT2 = 95) THEN q:=q*0.01;
ELSIF (UNIT2 = 22) THEN q:=q*0.1;
ELSIF (UNIT2 = 23) THEN q:=q*1;
ELSIF (UNIT2 = 41) THEN q:=q*5;
ELSIF (UNIT2 = 92) THEN q:=q*10;
ELSIF (UNIT2 = 93) THEN q:=q*100;
ELSE q := -1;
ENDIF;
ELSIF (state=2) THEN % motor current
%i_mo:=tmp;
%IF (UNIT2 = 1) THEN i_mo:=i_mo*0.1;
%ELSIF (UNIT2 = 42) THEN i_mo:=i_mo*0.2;
%ELSIF (UNIT2 = 62) THEN i_mo:=i_mo*0.5;
%ELSIF (UNIT2 = 2) THEN i_mo:=i_mo*5;
%ELSE i_mo := -1;
%ENDIF;
ELSIF (state=3) THEN
L5 := DATA;
ELSIF (state=4) THEN
L6 := DATA;
ELSIF (state=5) THEN
L7 := DATA;
ELSIF (state=6) THEN
L8 := DATA;
ALARM:=L1;
ALARM:=ALARM+L2*256;
ALARM:=ALARM+L3*65536;
ALARM:=ALARM+L4*16777216;
ALARM:=ALARM+L5*4294967296;
ALARM:=ALARM+L6*1099511627776;
ELSIF (state=7) THEN
energy := (ZERO2+(DATA+hi*256)*RANGE2/(254*256));
IF (UNIT1 = 87) THEN energy:=energy/1000/3600;
ELSIF (UNIT1 = 94) THEN energy:=energy/1000;
ELSIF (UNIT1 = 31) THEN energy:=energy*1;
ELSIF (UNIT1 = 85) THEN energy:=energy*2;
ELSIF (UNIT1 = 32) THEN energy:=energy*10;
ELSIF (UNIT1 = 33) THEN energy:=energy*100;
ELSIF (UNIT1 = 40) THEN energy:=energy*512;
ELSIF (UNIT1 = 46) THEN energy:=energy*1000;
ELSIF (UNIT1 = 47) THEN energy:=energy*10000;
ELSIF (UNIT1 = 48) THEN energy:=energy*100000;
ENDIF;
ELSIF (state=8) THEN
time := (ZERO2+(DATA+hi*256)*RANGE2/(254*256));
IF (UNIT1 = 39) THEN time:=time*1024;
ELSIF (UNIT1 = 81) THEN time:=time*100;
ELSIF (UNIT1 = 72) THEN time:=time*1024/60;
ELSIF (UNIT1 = 13) THEN time:=time*2;
ELSIF (UNIT1 = 35) THEN time:=time*1;
ENDIF;
ENDIF;
);
TIMEOUT 1000
END;
TELEGRAM WriteSettings NAMED "WriteSettings" IS
QUESTION
DATA[0] := HEX(27); % start delimiter
DATA[1] := BYTE(14); % datalength
DATA[2] := BYTE(Destination+31); % destination address
DATA[3] := BYTE(Source); % source address
% read INFO data
DATA[4] := HEX(04); % class 4 data
DATA[5] := HEX(C1); % OS=3(INFO operation), Length=1
DATA[6] := BYTE(83); % Constant pressure minimum pressure
% variables to be written
DATA[7] := HEX(03); % class 3 command
DATA[8] := HEX(83); % OS=2(SET), Length=2
DATA[9] := HEX(07); % setting remote mode
DATA[10] := HEX(25); % Max mode
DATA[11] <- BYTE(IF (Start=0) THEN DATA:=5; ELSE DATA:= 6; ENDIF;);
DATA[12] := HEX(05); % class 5
DATA[13] := HEX(82); % OS=2(SET), Length=2
DATA[14] := HEX(01); % remote reference
DATA[15] <- BYTE(tmp:=th*2.54; % data
IF tmp > 254 THEN tmp:=254; ENDIF;
IF tmp < 0 THEN tmp:=0;ENDIF;
DATA := tmp;
);
% DATA[12] := HEX(04);
% DATA[13] := HEX(84);
% DATA[14] := HEX(84);
% DATA[15] <- BYTE(IF (head_unit=91) THEN tmp := th*0.0001;
% ELSIF (head_unit=83) THEN tmp := th*0.01;
% ELSIF (head_unit=24) THEN tmp := th*0.1;
% ELSIF (head_unit=25) THEN tmp := th;
% ELSIF (head_unit=26) THEN tmp := th*10;
% ELSIF (head_unit=56) THEN tmp := th*3.28;
% ELSIF (head_unit=56) THEN tmp := th*3.28*10;
% ENDIF;
% DATA:=th;
% );
% DATA[16] := HEX(86);
% DATA[17] <- BYTE(DATA:=th;);
ANSWER SIZE 16
DATA[0] = HEX(24);
DATA[7] -> BYTE(head_unit:=DATA;);
TIMEOUT 1000
END;
END;
IS
PARAMETER
Destination :"Destination Address"INT;
Source :"Source Address"INT;
Start :"Start"INT;
th :"Tryckhöjd [%]"DEC2;
PUBLIC
% i_mo : "Motorström"["A"]INT;
% t_mo : "t_mo"["C"]DEC2;
t_w : "Vattentemp."["C"]DEC2;
speed : "Varvtal"["RPM"]INT;
q : "Vattenflöde"["m3/h"]DEC2;
h : "Tryckhöjd"["m"]DEC2;
p : "Effekt"["W"]INT;
energy : "Energi"["kWh"]INT;
time : "Drifttid"["h"]INT;
ALARM : "Alarm"INT;
PRIVATE
INFO1;
ZERO1;
RANGE1;
UNIT1;
INFO2;
ZERO2;
RANGE2;
UNIT2;
state;
p1;
p2;
tmp;
L1;
L2;
L3;
L4;
L5;
L6;
L7;
L8;
hi;
head_unit;
BAUDRATE 9600;
%PARITY EVEN;
CHECKSUM CRC16 SKIP 1 POLY 1021 INIT FFFF XOR FFFF;
POSTBYTES 0;
TELEGRAM Read NAMED "Read" IS
QUESTION
DATA[0] := HEX(27); % start delimiter
DATA[1] := BYTE(10); % datalength
DATA[2] := BYTE(Destination+31); % destination address
DATA[3] := BYTE(Source); % source address
% variables to be read
DATA[4] := HEX(02); % class 2 measured data
DATA[5] := HEX(C2); % OS=3(INFO operation), Length=2
DATA[6] <- BYTE(
state := state + 1;
IF (state < 0) THEN state:=0; ENDIF;
IF (state > 8) THEN state:=0; ENDIF;
IF (state=0) THEN DATA:=34; % p, power
ELSIF (state=1) THEN DATA:=37; % h, pump head/pressure
ELSIF (state=2) THEN DATA:=58; % t_w, pumped water temp
ELSIF (state=3) THEN DATA:=34;
ELSIF (state=4) THEN DATA:=34;
ELSIF (state=5) THEN DATA:=34;
ELSIF (state=6) THEN DATA:=34;
ELSIF (state=7) THEN DATA:=152; % energy_lo1, accumulated energy consumption
ELSIF (state=8) THEN DATA:=24; % t_2hour_hi, operating hours time hi
ENDIF;
% DATA := p1;
);
DATA[7] <- BYTE(
IF (state=0) THEN DATA:=35; % speed_hi, motor speed, RPM
ELSIF (state=1) THEN DATA:=39; % q, actual pump flow
ELSIF (state=2) THEN DATA:=32; % i_mo, motor current
ELSIF (state=3) THEN DATA:=34;
ELSIF (state=4) THEN DATA:=34;
ELSIF (state=5) THEN DATA:=34;
ELSIF (state=6) THEN DATA:=34;
ELSIF (state=7) THEN DATA:=152;
ELSIF (state=8) THEN DATA:=24; % INFO time hi
% ELSE p2:=58;
ENDIF;
% DATA := p2;
);
DATA[8] := HEX(02); % class 2 measured data
DATA[9] := HEX(02); % OS=0(GET operation), Length=2
DATA[10] <- BYTE(
IF (state=0) THEN DATA:=34;
ELSIF (state=1) THEN DATA:=37;
ELSIF (state=2) THEN DATA:=58;
ELSIF (state=3) THEN DATA:=64;
ELSIF (state=4) THEN DATA:=65;
ELSIF (state=5) THEN DATA:=66;
ELSIF (state=6) THEN DATA:=67;
ELSIF (state=7) THEN DATA:=152; % energy_hi
ELSIF (state=8) THEN DATA:=24; % time hi
ENDIF;
); % p
DATA[11] <- BYTE(
IF (state=0) THEN DATA:=35;
ELSIF (state=1) THEN DATA:=39;
ELSIF (state=2) THEN DATA:=32;
ELSIF (state=3) THEN DATA:=68;
ELSIF (state=4) THEN DATA:=69;
ELSIF (state=5) THEN DATA:=70;
ELSIF (state=6) THEN DATA:=71;
ELSIF (state=7) THEN DATA:=153; % energy_lo
ELSIF (state=8) THEN DATA:=25; % time hi
% ELSE DATA:= 58;
ENDIF;
);
ANSWER SIZE 20 % 28 14
DATA[0] = HEX(24); % start delimiter
DATA[1] = HEX(10); % datalength
DATA[6] -> BYTE(INFO1 := DATA;);
DATA[7] -> BYTE(UNIT1 := DATA;);
DATA[8] -> BYTE(ZERO1 := DATA;);
DATA[9] -> BYTE(RANGE1 := DATA;);
DATA[10] -> BYTE(INFO2 := DATA;);
DATA[11] -> BYTE(UNIT2 := DATA;);
DATA[12] -> BYTE(ZERO2 := DATA;);
DATA[13] -> BYTE(RANGE2 := DATA;);
DATA[16] -> BYTE(
tmp := (ZERO1+DATA*RANGE1/254);
IF (state=0) THEN % power
p:= tmp;
IF (UNIT1 = 8) THEN p:=p*10;
ELSIF (UNIT1 = 9) THEN p:=p*100;
ELSIF (UNIT1 = 44) THEN p:=p*1000;
ELSIF (UNIT1 = 44) THEN p:=p*10000;
ENDIF;
ELSIF (state=1) THEN % pump head
h:=tmp;
IF (UNIT1 = 91) THEN h:=h*0.0001;
ELSIF (UNIT1 = 83) THEN h:=h*0.01;
ELSIF (UNIT1 = 24) THEN h:=h*0.1;
ELSIF (UNIT1 = 25) THEN h:=h*1;
ELSIF (UNIT1 = 26) THEN h:=h*10;
ENDIF;
ELSIF (state=2) THEN % water temp;
t_w:=tmp;
IF (UNIT1 = 20) THEN t_w:=t_w*0.1;
ELSIF (UNIT1 = 21) THEN t_w:=t_w*1;
ELSIF (UNIT1 = 57) THEN t_w:=t_w*0.1;
ELSIF (UNIT1 = 84) THEN t_w:=t_w*0.01-273.15;
ENDIF;
ELSIF (state=3) THEN
L1 := DATA;
ELSIF (state=4) THEN
L2 := DATA;
ELSIF (state=5) THEN
L3 := DATA;
ELSIF (state=6) THEN
L4 := DATA;
ELSIF (state=7) THEN
hi := DATA;
ELSIF (state=8) THEN
hi := DATA;
ENDIF;
);
DATA[17] -> BYTE(
tmp := (ZERO2+DATA*RANGE2/254);
IF (state=0) THEN % rpm
speed:= tmp;
IF (UNIT2 = 18) THEN speed:=speed*12;
ELSIF (UNIT2 = 19) THEN speed:=speed*100;
ENDIF;
ELSIF (state=1) THEN % flow
q:=tmp;
IF (UNIT2 = 95) THEN q:=q*0.01;
ELSIF (UNIT2 = 22) THEN q:=q*0.1;
ELSIF (UNIT2 = 23) THEN q:=q*1;
ELSIF (UNIT2 = 41) THEN q:=q*5;
ELSIF (UNIT2 = 92) THEN q:=q*10;
ELSIF (UNIT2 = 93) THEN q:=q*100;
ELSE q := -1;
ENDIF;
ELSIF (state=2) THEN % motor current
%i_mo:=tmp;
%IF (UNIT2 = 1) THEN i_mo:=i_mo*0.1;
%ELSIF (UNIT2 = 42) THEN i_mo:=i_mo*0.2;
%ELSIF (UNIT2 = 62) THEN i_mo:=i_mo*0.5;
%ELSIF (UNIT2 = 2) THEN i_mo:=i_mo*5;
%ELSE i_mo := -1;
%ENDIF;
ELSIF (state=3) THEN
L5 := DATA;
ELSIF (state=4) THEN
L6 := DATA;
ELSIF (state=5) THEN
L7 := DATA;
ELSIF (state=6) THEN
L8 := DATA;
ALARM:=L1;
ALARM:=ALARM+L2*256;
ALARM:=ALARM+L3*65536;
ALARM:=ALARM+L4*16777216;
ALARM:=ALARM+L5*4294967296;
ALARM:=ALARM+L6*1099511627776;
ELSIF (state=7) THEN
energy := (ZERO2+(DATA+hi*256)*RANGE2/(254*256));
IF (UNIT1 = 87) THEN energy:=energy/1000/3600;
ELSIF (UNIT1 = 94) THEN energy:=energy/1000;
ELSIF (UNIT1 = 31) THEN energy:=energy*1;
ELSIF (UNIT1 = 85) THEN energy:=energy*2;
ELSIF (UNIT1 = 32) THEN energy:=energy*10;
ELSIF (UNIT1 = 33) THEN energy:=energy*100;
ELSIF (UNIT1 = 40) THEN energy:=energy*512;
ELSIF (UNIT1 = 46) THEN energy:=energy*1000;
ELSIF (UNIT1 = 47) THEN energy:=energy*10000;
ELSIF (UNIT1 = 48) THEN energy:=energy*100000;
ENDIF;
ELSIF (state=8) THEN
time := (ZERO2+(DATA+hi*256)*RANGE2/(254*256));
IF (UNIT1 = 39) THEN time:=time*1024;
ELSIF (UNIT1 = 81) THEN time:=time*100;
ELSIF (UNIT1 = 72) THEN time:=time*1024/60;
ELSIF (UNIT1 = 13) THEN time:=time*2;
ELSIF (UNIT1 = 35) THEN time:=time*1;
ENDIF;
ENDIF;
);
TIMEOUT 1000
END;
TELEGRAM WriteSettings NAMED "WriteSettings" IS
QUESTION
DATA[0] := HEX(27); % start delimiter
DATA[1] := BYTE(14); % datalength
DATA[2] := BYTE(Destination+31); % destination address
DATA[3] := BYTE(Source); % source address
% read INFO data
DATA[4] := HEX(04); % class 4 data
DATA[5] := HEX(C1); % OS=3(INFO operation), Length=1
DATA[6] := BYTE(83); % Constant pressure minimum pressure
% variables to be written
DATA[7] := HEX(03); % class 3 command
DATA[8] := HEX(83); % OS=2(SET), Length=2
DATA[9] := HEX(07); % setting remote mode
DATA[10] := HEX(25); % Max mode
DATA[11] <- BYTE(IF (Start=0) THEN DATA:=5; ELSE DATA:= 6; ENDIF;);
DATA[12] := HEX(05); % class 5
DATA[13] := HEX(82); % OS=2(SET), Length=2
DATA[14] := HEX(01); % remote reference
DATA[15] <- BYTE(tmp:=th*2.54; % data
IF tmp > 254 THEN tmp:=254; ENDIF;
IF tmp < 0 THEN tmp:=0;ENDIF;
DATA := tmp;
);
% DATA[12] := HEX(04);
% DATA[13] := HEX(84);
% DATA[14] := HEX(84);
% DATA[15] <- BYTE(IF (head_unit=91) THEN tmp := th*0.0001;
% ELSIF (head_unit=83) THEN tmp := th*0.01;
% ELSIF (head_unit=24) THEN tmp := th*0.1;
% ELSIF (head_unit=25) THEN tmp := th;
% ELSIF (head_unit=26) THEN tmp := th*10;
% ELSIF (head_unit=56) THEN tmp := th*3.28;
% ELSIF (head_unit=56) THEN tmp := th*3.28*10;
% ENDIF;
% DATA:=th;
% );
% DATA[16] := HEX(86);
% DATA[17] <- BYTE(DATA:=th;);
ANSWER SIZE 16
DATA[0] = HEX(24);
DATA[7] -> BYTE(head_unit:=DATA;);
TIMEOUT 1000
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.