Climaveneta
Detaljer
- Typ
- Drivrutin
- Upplaggd av
- Ove Jansson, Abelko Innovation
- Version
- 1
- Uppdaterad
- 2013-04-06
- Skapad
- 2013-04-06
- Kategori
- Modbus, Ventilation
- Visningar
- 3105
Beskrivning
För Climaventa luftkonditionering
Bruksanvisning
saknas
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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for Climaveneta, Digital inputs
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2010-11-22 inital version
%
DEVICETYPE ClimavenetaDI NAMED "Climaveneta DI" TYPEID 21401 IS
PARAMETER
Id : "Adress";
PUBLIC
C002 : "Aggregat" ; % 002 B Ut Driftstatus aggregat (0 = Från 1 = Till)
C004 : "PumpVärmeKöld"; % 004 B Ut Driftstatus värme-/köldbärarpump 1 (0 = Från 1 = Till)
C009 : "ÖVSStartStopp"; % 009 B In/Ut Aktivera start/stopp från övervakningssystem (0 = Start 1 = Stopp)
C012 : "ÖVSAktivera" ; % 012 B Ut Val av driftsätt från övervakningssystem (0 = Ej aktiv 1 = Aktiv)
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM DigitalInput NAMED "Läs Status 2-12" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(01); % Modbus command "01h" read coil input (bit)
DATA[2] := RWORD(1); % Start adress (2-1)
DATA[4] := RWORD(20); % Number of inputs
ANSWER SIZE 8 % ((Number of inputs / 8) + (Rest>0)) + 5
DATA[0] = BYTE(Id);
DATA[1] = HEX(01);
%DATA[2] = BYTE(3);
DATA[3] -> BYTE(
IF (DATA & 1) THEN C002:= 1; ELSE C002:= 0; ENDIF;
% IF (DATA & 2) THEN C003:= 1; ELSE C003:= 0; ENDIF;
IF (DATA & 4) THEN C004:= 1; ELSE C004:= 0; ENDIF;
% IF (DATA & 8) THEN C005:= 1; ELSE C005:= 0; ENDIF;
% IF (DATA & 16) THEN C006:= 1; ELSE C006:= 0; ENDIF;
% IF (DATA & 32) THEN C007:= 1; ELSE C007:= 0; ENDIF;
% IF (DATA & 64) THEN C008:= 1; ELSE C008:= 0; ENDIF;
IF (DATA & 128) THEN C009:= 1; ELSE C009:= 0; ENDIF;
);
DATA[4] -> BYTE(
% IF (DATA & 1) THEN C010:= 1; ELSE C010:= 0; ENDIF;
% IF (DATA & 2) THEN C011:= 1; ELSE C011:= 0; ENDIF;
IF (DATA & 4) THEN C012:= 1; ELSE C012:= 0; ENDIF;
% IF (DATA & 8) THEN C013:= 1; ELSE C013:= 0; ENDIF;
% IF (DATA & 16) THEN C014:= 1; ELSE C014:= 0; ENDIF;
% IF (DATA & 32) THEN C015:= 1; ELSE C015:= 0; ENDIF;
% IF (DATA & 64) THEN C016:= 1; ELSE C016:= 0; ENDIF;
% IF (DATA & 128) THEN C017:= 1; ELSE C017:= 0; ENDIF;
);
%DATA[5] -> BYTE(
% IF (DATA & 1) THEN C018:= 1; ELSE C018:= 0; ENDIF;
% IF (DATA & 2) THEN C019:= 1; ELSE C019:= 0; ENDIF;
% IF (DATA & 4) THEN C020:= 1; ELSE C020:= 0; ENDIF;
% IF (DATA & 8) THEN C021:= 1; ELSE C021:= 0; ENDIF;
%);
TIMEOUT 1000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for Climaveneta Digital outputs
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2010-11-22 inital version
%
DEVICETYPE ClimavenetaDO NAMED "Climaveneta DU" TYPEID 21402 IS
PARAMETER
Id : "Adress";
C009 : "ÖVSStartStopp"; % 009 B In/Ut Aktivera start/stopp från övervakningssystem
% (0 = Start 1 = Stopp)
PUBLIC
X009 : "ÖVSStartStoppDU"; % 009 B In/Ut Aktivera start/stopp från övervakningssystem
PRIVATE
Cnt;
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM WriteDISET1 NAMED "Sätt Dig.Status" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(05); % Modbus command "05h" Set coil status (bit)
DATA[2] <- RWORD(
Cnt := Cnt + 1;
IF Cnt>0 THEN Cnt:=0; ENDIF;
Cnt := 0;
IF Cnt=0 THEN DATA := 8; % Coil 9
%ELSIF Cnt=1 THEN DATA := 8; % Coil 9
%ELSIF Cnt=2 THEN DATA := 8; % Coil 9
%ELSIF Cnt=3 THEN DATA := 8; % Coil 9
%ELSIF Cnt=4 THEN DATA := 8; % Coil 9
%ELSIF Cnt=5 THEN DATA := 8; % Coil 9
%ELSIF Cnt=6 THEN DATA := 8; % Coil 9
%ELSIF Cnt=7 THEN DATA := 8; % Coil 9
%ELSE DATA := 8; % Coil 9
ENDIF;
);
DATA[4] <- RWORD(
IF Cnt=0 THEN IF C009 THEN X009:=1; DATA:=65280; ELSE X009:=0; DATA:=0; ENDIF;
%ELSIF Cnt=1 THEN IF C009 THEN DATA:=65280; ELSE DATA:=0; ENDIF;
%ELSIF Cnt=2 THEN IF C009 THEN DATA:=65280; ELSE DATA:=0; ENDIF;
%ELSIF Cnt=3 THEN IF C009 THEN DATA:=65280; ELSE DATA:=0; ENDIF;
%ELSIF Cnt=4 THEN IF C009 THEN DATA:=65280; ELSE DATA:=0; ENDIF;
%ELSIF Cnt=5 THEN IF C009 THEN DATA:=65280; ELSE DATA:=0; ENDIF;
%ELSIF Cnt=6 THEN IF C009 THEN DATA:=65280; ELSE DATA:=0; ENDIF;
%ELSIF Cnt=7 THEN IF C009 THEN DATA:=65280; ELSE DATA:=0; ENDIF;
%ELSE IF C009 THEN DATA:=65280; ELSE DATA:=0; ENDIF;
ENDIF;
);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = HEX(05);
TIMEOUT 1000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for Climaveneta Analog inputs
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Note! Telegram for reading Analog status AI and AO
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2010-11-22 inital version
%
DEVICETYPE ClimavenetaA1 NAMED "ClimavenetaTemp" TYPEID 21403 IS
PARAMETER
Id : "Adress";
PUBLIC
R002 : "BörvärdeKöldb." ["°C"]; % 40002 A In/Ut Önskad köldbärartemperatur (börvärde)
R003 : "BörvärdeVärmeb."["°C"]; % 40003 A In/Ut Önskad värmebärartemperatur (börvärde)
R005 : "KopplingsDiffKB"["°C"]; % 40005 A In/Ut Kopplingsdifferens köldbärartemperatur(P-band)
R007 : "KöldbärarTempIn"["°C"]; % 40007 A Ut Ingående köldbärartemperatur
R008 : "KöldbärarTempUt"["°C"]; % 40008 A Ut Utgående köldbärartemperatur
R009 : "VärmebärarTmpIn"["°C"]; % 40009 A Ut Ingående värmebärartemperatur
R010 : "VärmebärarTmpUt"["°C"]; % 40010 A Ut Utgående värmebärartemperatur
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM AnalogInput1 NAMED "Läs reg 002-021" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(03); % Modbus command "03h" Read holding registers
DATA[2] := RWORD(1); % Start address register (2)
DATA[4] := RWORD(20); % Number of registers
ANSWER SIZE 45 % (Number of registers * 2) + 5
DATA[0] = BYTE(Id); % ID
DATA[1] = HEX(03); % Modbus command "03h" Read holding registers
%DATA[2] = BYTE(40); % Byte count
DATA[3] -> RWORD(IF (DATA>=32768) THEN R002:=(DATA-65536)/10; ELSE R002:=DATA/10; ENDIF;);
DATA[5] -> RWORD(IF (DATA>=32768) THEN R003:=(DATA-65536)/10; ELSE R003:=DATA/10; ENDIF;);
%DATA[7] -> RWORD(R004 := DATA;);
DATA[9] -> RWORD(IF (DATA>=32768) THEN R005:=(DATA-65536)/10; ELSE R005:=DATA/10; ENDIF;);
%DATA[11] -> RWORD(R006 := DATA;);
DATA[13] -> RWORD(IF (DATA>=32768) THEN R007:=(DATA-65536)/10; ELSE R007:=DATA/10; ENDIF;);
DATA[15] -> RWORD(IF (DATA>=32768) THEN R008:=(DATA-65536)/10; ELSE R008:=DATA/10; ENDIF;);
DATA[17] -> RWORD(IF (DATA>=32768) THEN R009:=(DATA-65536)/10; ELSE R009:=DATA/10; ENDIF;);
DATA[19] -> RWORD(IF (DATA>=32768) THEN R010:=(DATA-65536)/10; ELSE R010:=DATA/10; ENDIF;);
%DATA[21] -> RWORD(R011 := DATA;);
%DATA[23] -> RWORD(R012 := DATA;);
%DATA[25] -> RWORD(R013 := DATA;);
%DATA[27] -> RWORD(R014 := DATA;);
%DATA[29] -> RWORD(R015 := DATA;);
%DATA[31] -> RWORD(R016 := DATA;);
%DATA[33] -> RWORD(R017 := DATA;);
%DATA[35] -> RWORD(R018 := DATA;);
%DATA[37] -> RWORD(R019 := DATA;);
%DATA[39] -> RWORD(R020 := DATA;);
%DATA[41] -> RWORD(R021 := DATA;);
TIMEOUT 1000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for Climaveneta Analog inputs 132-151
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Note! Telegram for reading Analog status AI and AO
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2010-11-22 inital version
%
DEVICETYPE ClimavenetaA2 NAMED "Climaveneta AI2" TYPEID 21404 IS
PARAMETER
Id : "Adress";
PUBLIC
% Integer values
R132 : "VersionMjukvara"; % 40132 I Ut Version av mjukvara
R133 : "VersionDatum"; % 40133 I Ut Datum på version av mjukvara
R134 : "AggregatTyp"; % 40134 I Ut Typ av aggregat, 10 = Värmepump
R135 : "KretsAntal"; % 40135 I Ut Antal kretsar
R136 : "KompressorAntal"; % 40136 I Ut Antal kompressorer
R138 : "KompressorTyp"; % 40138 I Ut Typ av kompressor 1 = Hermetisk
R139 : "AggregatKonfig1"; % 40139 I Ut Aggregatkonfiguration status 1
% Bit0: 0 = Värmepump avaktiverad 1 = Värmepump aktiverad
% Bit1 (enbart scroll kompressorer): 0 = Styrning med flytande börvärde (Quick Mind) avaktiverad
% 1 = Styrning med flytande börvärde (Quick Mind) aktiverad
% Bit2: 0 = Styrs på ingående givare 1 = Styrs på utgående givare
R140 : "AggregatKonfig2"; % 40140 I Ut Aggregatkonfiguration status 2
% Bit1: 0 = "Pump Down" avaktiverad 1 = "Pump Down" aktiverad
% Bit2: 0 = Ändring av börvärde avaktiverad 1 = Ändring av börvärde aktiverad
% Bit3: 1 = Vätskekyld kondensor
% Bit4: 0 = Sequenser avaktiverad 1 = Sequenser aktiverad
R141 : "AggregatStatus"; % 40141 I Ut Aggregatstatus
% 0 = Startat från aggregatets manöverpanel
% 1 = Startat med digital signal (extern kontakt)
% 3 = Startat från övervaktningsystem
% 4 = Stoppat av larm
% 5 = Stoppat från övervaktningsystem
% 7 = Stoppat med digital signal (extern kontakt)
% 8 = Stoppat från aggregatets manöverpanel
% 9 = Manuell start/stopp
% 10 = Stoppat
R143 : "Driftsätt"; % 40143 I In/Ut Driftsätt:
% 3 = Vätskekylaggregat
% 4 = Värmepump
R144 : "StatusKompr.1"; % 40144 I Ut Kompressor 1
% Bit1: 0 = Avaktiverad 1 = Aktiverad
% Bit2: 0 = Stopp 1 = Drift
% Bit3: 0 = "Pump Down" avaktiverad 1 = "Pump Down" aktiverad
% Bit4: 0 = Larm avaktiverad 1 = Larm aktiverad
% Bit9: 0 = Stopp 1 = Startat med driftsätt kyldrift
% Bit10: 0 = Stopp 1 = Startat med driftsätt värmedrift
R145 : "StatusKompr.2"; % 40145 I Ut Kompressor 2
% Bit1: 0 = Avaktiverad 1 = Aktiverad
% Bit2: 0 = Stopp 1 = Drift
% Bit3: 0 = "Pump Down" avaktiverad 1 = "Pump Down" aktiverad
% Bit4: 0 = Larm avaktiverad 1 = Larm aktiverad
% Bit9: 0 = Stopp 1 = Startat med driftsätt kyldrift
% Bit10: 0 = Stopp 1 = Startat med driftsätt värmedrift
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM AnalogInput2 NAMED "Läs reg 132-147" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(03); % Modbus command "03h" Read holding registers
DATA[2] := RWORD(131); % Start address register 132-1
DATA[4] := RWORD(16); % Number of registers
ANSWER SIZE 37 % (Number of registers * 2) + 5
DATA[0] = BYTE(Id); % ID
DATA[1] = HEX(03); % Modbus command "03h" Read holding registers
%DATA[2] = BYTE(32); % Byte count
DATA[3] -> RWORD(R132 := DATA;);
DATA[5] -> RWORD(R133 := DATA;);
DATA[7] -> RWORD(R134 := DATA;);
DATA[9] -> RWORD(R135 := DATA;);
DATA[11] -> RWORD(R136 := DATA;);
%DATA[13] -> RWORD(R137 := DATA;);
DATA[15] -> RWORD(R138 := DATA;);
DATA[17] -> RWORD(R139 := DATA;);
DATA[19] -> RWORD(R140 := DATA;);
DATA[21] -> RWORD(R141 := DATA;);
%DATA[23] -> RWORD(R142 := DATA;);
DATA[25] -> RWORD(R143 := DATA;);
DATA[27] -> RWORD(R144 := DATA;);
DATA[29] -> RWORD(R145 := DATA;);
%DATA[31] -> RWORD(R146 := DATA;);
%DATA[33] -> RWORD(R147 := DATA;);
TIMEOUT 1000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for Climaveneta Analog inputs
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Note! Telegram for reading Analog status AI and AO
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2010-08-18 inital version
%
DEVICETYPE ClimavenetaA3 NAMED "Climaveneta AI3" TYPEID 21405 IS
PARAMETER
Id : "Adress";
PUBLIC
R152 : "DriftTidKompr."; % 40152 I Ut Genomsnittlig drifttid/kompressor (antal timmar x 1000)
% 40153 I Ut Genomsnittlig drifttid/kompressor (antal timmar)
R154 : "År Månad"; % 40154 I Ut År/Månad
R155 : "Dag Timme Minut"; % 40155 I Ut Dag/Timme/Minuter
R157 : "DriftIndikering"; % 40157 I Ut Driftindikering
% Bit7: 0 = Avaktiverad 1 = Effektbegr. aktiverad
% Bit8: 0 = Avaktiverad 1 = Begr.frysskydd aktiverad
R161 : "Summalarm"; % 40161 I Ut Summalarm (koder med högre prioritet (Kod 0 = inget larm))
R163 : "Kylbehov" ["%"]; % 40163 I Ut Kylbehov [%]
R164 : "KylEffekt" ["%"]; % 40164 I Ut Antal effektsteg i drift [%] (kyldrift)
R165 : "KylEffektMax" ["%"]; % 40165 I Ut Max tillgängliga effektsteg [%] (kyldrift)
R166 : "Värmebehov" ["%"]; % 40166 I Ut Värmebehov [%]
R167 : "VärmeEffekt" ["%"]; % 40167 I Ut Antal effektsteg i drift [%] (värmedrift)
R168 : "VärmeEffektMax" ["%"]; % 40168 I Ut Max tillgängliga effektsteg [%] (värmedrift)
R172 : "KylaEffektBegr" ["%"]; % 40172 I In/Ut Effektbegränsning [%] (kyldrift)
R173 : "VärmeEffektBegr"["%"]; % 40173 I In/Ut Effektbegränsning [%] (värmedrift)
PRIVATE
Tmp;
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM AnalogInput30 NAMED "Läs reg 152-157" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(03); % Modbus command "03h" Read holding registers
DATA[2] := RWORD(151); % Start address register 152-1
DATA[4] := RWORD(6); % Number of registers
ANSWER SIZE 17 % (Number of registers * 2) + 5
DATA[0] = BYTE(Id); % ID
DATA[1] = HEX(03); % Modbus command "03h" Read holding registers
%DATA[2] = BYTE(12); % Byte count
DATA[3] -> RWORD(Tmp := 1000 * DATA;);
DATA[5] -> RWORD(R152 := Tmp + DATA;);
DATA[7] -> RWORD(R154 := DATA;);
DATA[9] -> RWORD(R155 := DATA;);
%DATA[11] -> RWORD(R156 := DATA;);
DATA[13] -> RWORD(R157 := DATA;);
%DATA[15] -> RWORD(R158 := DATA;);
%DATA[17] -> RWORD(R159 := DATA;);
%DATA[19] -> RWORD(R160 := DATA;);
TIMEOUT 1000
END;
TELEGRAM AnalogInput31 NAMED "Läs reg 161" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(03); % Modbus command "03h" Read holding registers
DATA[2] := RWORD(160); % Start address register 161-1
DATA[4] := RWORD(1); % Number of registers
ANSWER SIZE 7 % (Number of registers * 2) + 5
DATA[0] = BYTE(Id); % ID
DATA[1] = HEX(03); % Modbus command "03h" Read holding registers
%DATA[2] = BYTE(2); % Byte count
DATA[3] -> RWORD(R161 := DATA;);
TIMEOUT 1000
END;
TELEGRAM AnalogInput32 NAMED "Läs reg 163-178" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(03); % Modbus command "03h" Read holding registers
DATA[2] := RWORD(162); % Start address register 163-1
DATA[4] := RWORD(16); % Number of registers
ANSWER SIZE 37 % (Number of registers * 2) + 5
DATA[0] = BYTE(Id); % ID
DATA[1] = HEX(03); % Modbus command "03h" Read holding registers
%DATA[2] = BYTE(30); % Byte count
DATA[3] -> RWORD(R163 := DATA;);
DATA[5] -> RWORD(R164 := DATA;);
DATA[7] -> RWORD(R165 := DATA;);
DATA[9] -> RWORD(R166 := DATA;);
DATA[11] -> RWORD(R167 := DATA;);
DATA[13] -> RWORD(R168 := DATA;);
%DATA[15] -> RWORD(R169 := DATA;);
%DATA[17] -> RWORD(R170 := DATA;);
%DATA[19] -> RWORD(R171 := DATA;);
DATA[21] -> RWORD(R172 := DATA;);
DATA[23] -> RWORD(R173 := DATA;);
%DATA[25] -> RWORD(R174 := DATA;);
%DATA[27] -> RWORD(R175 := DATA;);
%DATA[29] -> RWORD(R176 := DATA;);
%DATA[31] -> RWORD(R177 := DATA;);
%DATA[33] -> RWORD(R178 := DATA;);
TIMEOUT 1000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for Climaveneta Analog settings
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2010-11-22 inital version
%
DEVICETYPE ClimavenetaSet NAMED "ClimavenetaSätt" TYPEID 21406 IS
PARAMETER
Id : "Adress";
%R002 : "BörvärdeKöldb." ["°C"]; % 40002 A In/Ut Önskad köldbärartemperatur (börvärde)
R003 : "VärmebärareBörv"["°C"]; % 40003 A In/Ut Önskad värmebärartemperatur (börvärde)
R005 : "KopplingsDiffKB"["°C"]; % 40005 A In/Ut Kopplingsdifferens köldbärartemperatur(P-band)
%R143 : "Driftsätt"; % 40143 I In/Ut Driftsätt:
% 3 = Vätskekylaggregat
% 4 = Värmepump
%R172 : "KylaEffektBegr" ["%"]; % 40172 I In/Ut Effektbegränsning [%] (kyldrift)
%R173 : "VärmeEffektBegr"["%"]; % 40173 I In/Ut Effektbegränsning [%] (värmedrift)
PUBLIC
U003 : "VärmebärareBörv"["°C"]; % 40003 A Önskad värmebärartemperatur
U005 : "KopplingsDiffKB"["°C"]; % 40005 A Kopplingsdifferens
PRIVATE
Cnt;
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM Settings1 NAMED "Ställ värden" IS
QUESTION
DATA[0] := BYTE(Id);
DATA[1] := HEX(06); % Write singel register
DATA[2] <- RWORD( % Start adress (regnr-1)
Cnt := Cnt + 1;
IF Cnt>1 THEN Cnt:=0; ENDIF;
% Adress=Register-1
IF Cnt=0 THEN DATA := 2; % R003
ELSIF Cnt=1 THEN DATA := 4; % R005
%ELSIF Cnt=2 THEN DATA := 2; % R003
%ELSIF Cnt=3 THEN DATA := 172; % R173
%ELSIF Cnt=4 THEN DATA := 2; % R003
%ELSIF Cnt=5 THEN DATA := 172; % R173
%ELSIF Cnt=6 THEN DATA := 2; % R003
%ELSIF Cnt=7 THEN DATA := 172; % R173
%ELSE DATA := 2; % R003
ENDIF;
);
DATA[4] <- RWORD(
IF Cnt=0 THEN
U003 := R003;
IF R003<0 THEN DATA := 0; % R003 Önskad värmebärartemp (börvärde)
ELSE DATA := R003;
ENDIF;
ELSIF Cnt=1 THEN
U005 := R005;
IF R005<0 THEN DATA := 0; % R005 Kopplingsdifferens
ELSE DATA := R005;
ENDIF;
%ELSIF Cnt=2 THEN
% IF R003<0 THEN DATA := 0; % R003 Önskad värmebärartemp(börvärde)
% ELSIF R003>200 THEN DATA := 2000;
% ELSE DATA := R003;
% ENDIF;
%ELSIF Cnt=3 THEN
% IF R173<0 THEN DATA := 0; % R173 Effektbegränsning [%] (värmedrift)
% ELSIF R173>100 THEN DATA := 100;
% ELSE DATA := R173;
% ENDIF;
%ELSIF Cnt=4 THEN
% IF R003<0 THEN DATA := 0; % R003 Önskad värmebärartemp (börvärde)
% ELSIF R003>200 THEN DATA := 2000;
% ELSE DATA := R003;
% ENDIF;
%ELSIF Cnt=5 THEN
% IF R173<0 THEN DATA := 0; % R173 Effektbegränsning [%] (värmedrift)
% ELSIF R173>100 THEN DATA := 100;
% ELSE DATA := R173;
% ENDIF;
%ELSIF Cnt=6 THEN
% IF R003<0 THEN DATA := 0; % R003 Önskad värmebärartemp (börvärde)
% ELSIF R003>200 THEN DATA := 2000;
% ELSE DATA := R003;
% ENDIF;
%ELSIF Cnt=7 THEN
% IF R173<0 THEN DATA := 0; % R173 Effektbegränsning [%] (värmedrift)
% ELSIF R173>100 THEN DATA := 100;
% ELSE DATA := R173;
% ENDIF;
%ELSE
% IF R003<0 THEN DATA := 0; % R003 Önskad värmebärartemp (börvärde)
% ELSIF R003>200 THEN DATA := 2000;
% ELSE DATA := R003;
% ENDIF;
ENDIF;
);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = HEX(06);
TIMEOUT 1000
END;
END;
% Device definition for Climaveneta, Digital inputs
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2010-11-22 inital version
%
DEVICETYPE ClimavenetaDI NAMED "Climaveneta DI" TYPEID 21401 IS
PARAMETER
Id : "Adress";
PUBLIC
C002 : "Aggregat" ; % 002 B Ut Driftstatus aggregat (0 = Från 1 = Till)
C004 : "PumpVärmeKöld"; % 004 B Ut Driftstatus värme-/köldbärarpump 1 (0 = Från 1 = Till)
C009 : "ÖVSStartStopp"; % 009 B In/Ut Aktivera start/stopp från övervakningssystem (0 = Start 1 = Stopp)
C012 : "ÖVSAktivera" ; % 012 B Ut Val av driftsätt från övervakningssystem (0 = Ej aktiv 1 = Aktiv)
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM DigitalInput NAMED "Läs Status 2-12" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(01); % Modbus command "01h" read coil input (bit)
DATA[2] := RWORD(1); % Start adress (2-1)
DATA[4] := RWORD(20); % Number of inputs
ANSWER SIZE 8 % ((Number of inputs / 8) + (Rest>0)) + 5
DATA[0] = BYTE(Id);
DATA[1] = HEX(01);
%DATA[2] = BYTE(3);
DATA[3] -> BYTE(
IF (DATA & 1) THEN C002:= 1; ELSE C002:= 0; ENDIF;
% IF (DATA & 2) THEN C003:= 1; ELSE C003:= 0; ENDIF;
IF (DATA & 4) THEN C004:= 1; ELSE C004:= 0; ENDIF;
% IF (DATA & 8) THEN C005:= 1; ELSE C005:= 0; ENDIF;
% IF (DATA & 16) THEN C006:= 1; ELSE C006:= 0; ENDIF;
% IF (DATA & 32) THEN C007:= 1; ELSE C007:= 0; ENDIF;
% IF (DATA & 64) THEN C008:= 1; ELSE C008:= 0; ENDIF;
IF (DATA & 128) THEN C009:= 1; ELSE C009:= 0; ENDIF;
);
DATA[4] -> BYTE(
% IF (DATA & 1) THEN C010:= 1; ELSE C010:= 0; ENDIF;
% IF (DATA & 2) THEN C011:= 1; ELSE C011:= 0; ENDIF;
IF (DATA & 4) THEN C012:= 1; ELSE C012:= 0; ENDIF;
% IF (DATA & 8) THEN C013:= 1; ELSE C013:= 0; ENDIF;
% IF (DATA & 16) THEN C014:= 1; ELSE C014:= 0; ENDIF;
% IF (DATA & 32) THEN C015:= 1; ELSE C015:= 0; ENDIF;
% IF (DATA & 64) THEN C016:= 1; ELSE C016:= 0; ENDIF;
% IF (DATA & 128) THEN C017:= 1; ELSE C017:= 0; ENDIF;
);
%DATA[5] -> BYTE(
% IF (DATA & 1) THEN C018:= 1; ELSE C018:= 0; ENDIF;
% IF (DATA & 2) THEN C019:= 1; ELSE C019:= 0; ENDIF;
% IF (DATA & 4) THEN C020:= 1; ELSE C020:= 0; ENDIF;
% IF (DATA & 8) THEN C021:= 1; ELSE C021:= 0; ENDIF;
%);
TIMEOUT 1000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for Climaveneta Digital outputs
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2010-11-22 inital version
%
DEVICETYPE ClimavenetaDO NAMED "Climaveneta DU" TYPEID 21402 IS
PARAMETER
Id : "Adress";
C009 : "ÖVSStartStopp"; % 009 B In/Ut Aktivera start/stopp från övervakningssystem
% (0 = Start 1 = Stopp)
PUBLIC
X009 : "ÖVSStartStoppDU"; % 009 B In/Ut Aktivera start/stopp från övervakningssystem
PRIVATE
Cnt;
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM WriteDISET1 NAMED "Sätt Dig.Status" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(05); % Modbus command "05h" Set coil status (bit)
DATA[2] <- RWORD(
Cnt := Cnt + 1;
IF Cnt>0 THEN Cnt:=0; ENDIF;
Cnt := 0;
IF Cnt=0 THEN DATA := 8; % Coil 9
%ELSIF Cnt=1 THEN DATA := 8; % Coil 9
%ELSIF Cnt=2 THEN DATA := 8; % Coil 9
%ELSIF Cnt=3 THEN DATA := 8; % Coil 9
%ELSIF Cnt=4 THEN DATA := 8; % Coil 9
%ELSIF Cnt=5 THEN DATA := 8; % Coil 9
%ELSIF Cnt=6 THEN DATA := 8; % Coil 9
%ELSIF Cnt=7 THEN DATA := 8; % Coil 9
%ELSE DATA := 8; % Coil 9
ENDIF;
);
DATA[4] <- RWORD(
IF Cnt=0 THEN IF C009 THEN X009:=1; DATA:=65280; ELSE X009:=0; DATA:=0; ENDIF;
%ELSIF Cnt=1 THEN IF C009 THEN DATA:=65280; ELSE DATA:=0; ENDIF;
%ELSIF Cnt=2 THEN IF C009 THEN DATA:=65280; ELSE DATA:=0; ENDIF;
%ELSIF Cnt=3 THEN IF C009 THEN DATA:=65280; ELSE DATA:=0; ENDIF;
%ELSIF Cnt=4 THEN IF C009 THEN DATA:=65280; ELSE DATA:=0; ENDIF;
%ELSIF Cnt=5 THEN IF C009 THEN DATA:=65280; ELSE DATA:=0; ENDIF;
%ELSIF Cnt=6 THEN IF C009 THEN DATA:=65280; ELSE DATA:=0; ENDIF;
%ELSIF Cnt=7 THEN IF C009 THEN DATA:=65280; ELSE DATA:=0; ENDIF;
%ELSE IF C009 THEN DATA:=65280; ELSE DATA:=0; ENDIF;
ENDIF;
);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = HEX(05);
TIMEOUT 1000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for Climaveneta Analog inputs
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Note! Telegram for reading Analog status AI and AO
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2010-11-22 inital version
%
DEVICETYPE ClimavenetaA1 NAMED "ClimavenetaTemp" TYPEID 21403 IS
PARAMETER
Id : "Adress";
PUBLIC
R002 : "BörvärdeKöldb." ["°C"]; % 40002 A In/Ut Önskad köldbärartemperatur (börvärde)
R003 : "BörvärdeVärmeb."["°C"]; % 40003 A In/Ut Önskad värmebärartemperatur (börvärde)
R005 : "KopplingsDiffKB"["°C"]; % 40005 A In/Ut Kopplingsdifferens köldbärartemperatur(P-band)
R007 : "KöldbärarTempIn"["°C"]; % 40007 A Ut Ingående köldbärartemperatur
R008 : "KöldbärarTempUt"["°C"]; % 40008 A Ut Utgående köldbärartemperatur
R009 : "VärmebärarTmpIn"["°C"]; % 40009 A Ut Ingående värmebärartemperatur
R010 : "VärmebärarTmpUt"["°C"]; % 40010 A Ut Utgående värmebärartemperatur
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM AnalogInput1 NAMED "Läs reg 002-021" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(03); % Modbus command "03h" Read holding registers
DATA[2] := RWORD(1); % Start address register (2)
DATA[4] := RWORD(20); % Number of registers
ANSWER SIZE 45 % (Number of registers * 2) + 5
DATA[0] = BYTE(Id); % ID
DATA[1] = HEX(03); % Modbus command "03h" Read holding registers
%DATA[2] = BYTE(40); % Byte count
DATA[3] -> RWORD(IF (DATA>=32768) THEN R002:=(DATA-65536)/10; ELSE R002:=DATA/10; ENDIF;);
DATA[5] -> RWORD(IF (DATA>=32768) THEN R003:=(DATA-65536)/10; ELSE R003:=DATA/10; ENDIF;);
%DATA[7] -> RWORD(R004 := DATA;);
DATA[9] -> RWORD(IF (DATA>=32768) THEN R005:=(DATA-65536)/10; ELSE R005:=DATA/10; ENDIF;);
%DATA[11] -> RWORD(R006 := DATA;);
DATA[13] -> RWORD(IF (DATA>=32768) THEN R007:=(DATA-65536)/10; ELSE R007:=DATA/10; ENDIF;);
DATA[15] -> RWORD(IF (DATA>=32768) THEN R008:=(DATA-65536)/10; ELSE R008:=DATA/10; ENDIF;);
DATA[17] -> RWORD(IF (DATA>=32768) THEN R009:=(DATA-65536)/10; ELSE R009:=DATA/10; ENDIF;);
DATA[19] -> RWORD(IF (DATA>=32768) THEN R010:=(DATA-65536)/10; ELSE R010:=DATA/10; ENDIF;);
%DATA[21] -> RWORD(R011 := DATA;);
%DATA[23] -> RWORD(R012 := DATA;);
%DATA[25] -> RWORD(R013 := DATA;);
%DATA[27] -> RWORD(R014 := DATA;);
%DATA[29] -> RWORD(R015 := DATA;);
%DATA[31] -> RWORD(R016 := DATA;);
%DATA[33] -> RWORD(R017 := DATA;);
%DATA[35] -> RWORD(R018 := DATA;);
%DATA[37] -> RWORD(R019 := DATA;);
%DATA[39] -> RWORD(R020 := DATA;);
%DATA[41] -> RWORD(R021 := DATA;);
TIMEOUT 1000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for Climaveneta Analog inputs 132-151
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Note! Telegram for reading Analog status AI and AO
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2010-11-22 inital version
%
DEVICETYPE ClimavenetaA2 NAMED "Climaveneta AI2" TYPEID 21404 IS
PARAMETER
Id : "Adress";
PUBLIC
% Integer values
R132 : "VersionMjukvara"; % 40132 I Ut Version av mjukvara
R133 : "VersionDatum"; % 40133 I Ut Datum på version av mjukvara
R134 : "AggregatTyp"; % 40134 I Ut Typ av aggregat, 10 = Värmepump
R135 : "KretsAntal"; % 40135 I Ut Antal kretsar
R136 : "KompressorAntal"; % 40136 I Ut Antal kompressorer
R138 : "KompressorTyp"; % 40138 I Ut Typ av kompressor 1 = Hermetisk
R139 : "AggregatKonfig1"; % 40139 I Ut Aggregatkonfiguration status 1
% Bit0: 0 = Värmepump avaktiverad 1 = Värmepump aktiverad
% Bit1 (enbart scroll kompressorer): 0 = Styrning med flytande börvärde (Quick Mind) avaktiverad
% 1 = Styrning med flytande börvärde (Quick Mind) aktiverad
% Bit2: 0 = Styrs på ingående givare 1 = Styrs på utgående givare
R140 : "AggregatKonfig2"; % 40140 I Ut Aggregatkonfiguration status 2
% Bit1: 0 = "Pump Down" avaktiverad 1 = "Pump Down" aktiverad
% Bit2: 0 = Ändring av börvärde avaktiverad 1 = Ändring av börvärde aktiverad
% Bit3: 1 = Vätskekyld kondensor
% Bit4: 0 = Sequenser avaktiverad 1 = Sequenser aktiverad
R141 : "AggregatStatus"; % 40141 I Ut Aggregatstatus
% 0 = Startat från aggregatets manöverpanel
% 1 = Startat med digital signal (extern kontakt)
% 3 = Startat från övervaktningsystem
% 4 = Stoppat av larm
% 5 = Stoppat från övervaktningsystem
% 7 = Stoppat med digital signal (extern kontakt)
% 8 = Stoppat från aggregatets manöverpanel
% 9 = Manuell start/stopp
% 10 = Stoppat
R143 : "Driftsätt"; % 40143 I In/Ut Driftsätt:
% 3 = Vätskekylaggregat
% 4 = Värmepump
R144 : "StatusKompr.1"; % 40144 I Ut Kompressor 1
% Bit1: 0 = Avaktiverad 1 = Aktiverad
% Bit2: 0 = Stopp 1 = Drift
% Bit3: 0 = "Pump Down" avaktiverad 1 = "Pump Down" aktiverad
% Bit4: 0 = Larm avaktiverad 1 = Larm aktiverad
% Bit9: 0 = Stopp 1 = Startat med driftsätt kyldrift
% Bit10: 0 = Stopp 1 = Startat med driftsätt värmedrift
R145 : "StatusKompr.2"; % 40145 I Ut Kompressor 2
% Bit1: 0 = Avaktiverad 1 = Aktiverad
% Bit2: 0 = Stopp 1 = Drift
% Bit3: 0 = "Pump Down" avaktiverad 1 = "Pump Down" aktiverad
% Bit4: 0 = Larm avaktiverad 1 = Larm aktiverad
% Bit9: 0 = Stopp 1 = Startat med driftsätt kyldrift
% Bit10: 0 = Stopp 1 = Startat med driftsätt värmedrift
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM AnalogInput2 NAMED "Läs reg 132-147" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(03); % Modbus command "03h" Read holding registers
DATA[2] := RWORD(131); % Start address register 132-1
DATA[4] := RWORD(16); % Number of registers
ANSWER SIZE 37 % (Number of registers * 2) + 5
DATA[0] = BYTE(Id); % ID
DATA[1] = HEX(03); % Modbus command "03h" Read holding registers
%DATA[2] = BYTE(32); % Byte count
DATA[3] -> RWORD(R132 := DATA;);
DATA[5] -> RWORD(R133 := DATA;);
DATA[7] -> RWORD(R134 := DATA;);
DATA[9] -> RWORD(R135 := DATA;);
DATA[11] -> RWORD(R136 := DATA;);
%DATA[13] -> RWORD(R137 := DATA;);
DATA[15] -> RWORD(R138 := DATA;);
DATA[17] -> RWORD(R139 := DATA;);
DATA[19] -> RWORD(R140 := DATA;);
DATA[21] -> RWORD(R141 := DATA;);
%DATA[23] -> RWORD(R142 := DATA;);
DATA[25] -> RWORD(R143 := DATA;);
DATA[27] -> RWORD(R144 := DATA;);
DATA[29] -> RWORD(R145 := DATA;);
%DATA[31] -> RWORD(R146 := DATA;);
%DATA[33] -> RWORD(R147 := DATA;);
TIMEOUT 1000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for Climaveneta Analog inputs
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Note! Telegram for reading Analog status AI and AO
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2010-08-18 inital version
%
DEVICETYPE ClimavenetaA3 NAMED "Climaveneta AI3" TYPEID 21405 IS
PARAMETER
Id : "Adress";
PUBLIC
R152 : "DriftTidKompr."; % 40152 I Ut Genomsnittlig drifttid/kompressor (antal timmar x 1000)
% 40153 I Ut Genomsnittlig drifttid/kompressor (antal timmar)
R154 : "År Månad"; % 40154 I Ut År/Månad
R155 : "Dag Timme Minut"; % 40155 I Ut Dag/Timme/Minuter
R157 : "DriftIndikering"; % 40157 I Ut Driftindikering
% Bit7: 0 = Avaktiverad 1 = Effektbegr. aktiverad
% Bit8: 0 = Avaktiverad 1 = Begr.frysskydd aktiverad
R161 : "Summalarm"; % 40161 I Ut Summalarm (koder med högre prioritet (Kod 0 = inget larm))
R163 : "Kylbehov" ["%"]; % 40163 I Ut Kylbehov [%]
R164 : "KylEffekt" ["%"]; % 40164 I Ut Antal effektsteg i drift [%] (kyldrift)
R165 : "KylEffektMax" ["%"]; % 40165 I Ut Max tillgängliga effektsteg [%] (kyldrift)
R166 : "Värmebehov" ["%"]; % 40166 I Ut Värmebehov [%]
R167 : "VärmeEffekt" ["%"]; % 40167 I Ut Antal effektsteg i drift [%] (värmedrift)
R168 : "VärmeEffektMax" ["%"]; % 40168 I Ut Max tillgängliga effektsteg [%] (värmedrift)
R172 : "KylaEffektBegr" ["%"]; % 40172 I In/Ut Effektbegränsning [%] (kyldrift)
R173 : "VärmeEffektBegr"["%"]; % 40173 I In/Ut Effektbegränsning [%] (värmedrift)
PRIVATE
Tmp;
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM AnalogInput30 NAMED "Läs reg 152-157" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(03); % Modbus command "03h" Read holding registers
DATA[2] := RWORD(151); % Start address register 152-1
DATA[4] := RWORD(6); % Number of registers
ANSWER SIZE 17 % (Number of registers * 2) + 5
DATA[0] = BYTE(Id); % ID
DATA[1] = HEX(03); % Modbus command "03h" Read holding registers
%DATA[2] = BYTE(12); % Byte count
DATA[3] -> RWORD(Tmp := 1000 * DATA;);
DATA[5] -> RWORD(R152 := Tmp + DATA;);
DATA[7] -> RWORD(R154 := DATA;);
DATA[9] -> RWORD(R155 := DATA;);
%DATA[11] -> RWORD(R156 := DATA;);
DATA[13] -> RWORD(R157 := DATA;);
%DATA[15] -> RWORD(R158 := DATA;);
%DATA[17] -> RWORD(R159 := DATA;);
%DATA[19] -> RWORD(R160 := DATA;);
TIMEOUT 1000
END;
TELEGRAM AnalogInput31 NAMED "Läs reg 161" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(03); % Modbus command "03h" Read holding registers
DATA[2] := RWORD(160); % Start address register 161-1
DATA[4] := RWORD(1); % Number of registers
ANSWER SIZE 7 % (Number of registers * 2) + 5
DATA[0] = BYTE(Id); % ID
DATA[1] = HEX(03); % Modbus command "03h" Read holding registers
%DATA[2] = BYTE(2); % Byte count
DATA[3] -> RWORD(R161 := DATA;);
TIMEOUT 1000
END;
TELEGRAM AnalogInput32 NAMED "Läs reg 163-178" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(03); % Modbus command "03h" Read holding registers
DATA[2] := RWORD(162); % Start address register 163-1
DATA[4] := RWORD(16); % Number of registers
ANSWER SIZE 37 % (Number of registers * 2) + 5
DATA[0] = BYTE(Id); % ID
DATA[1] = HEX(03); % Modbus command "03h" Read holding registers
%DATA[2] = BYTE(30); % Byte count
DATA[3] -> RWORD(R163 := DATA;);
DATA[5] -> RWORD(R164 := DATA;);
DATA[7] -> RWORD(R165 := DATA;);
DATA[9] -> RWORD(R166 := DATA;);
DATA[11] -> RWORD(R167 := DATA;);
DATA[13] -> RWORD(R168 := DATA;);
%DATA[15] -> RWORD(R169 := DATA;);
%DATA[17] -> RWORD(R170 := DATA;);
%DATA[19] -> RWORD(R171 := DATA;);
DATA[21] -> RWORD(R172 := DATA;);
DATA[23] -> RWORD(R173 := DATA;);
%DATA[25] -> RWORD(R174 := DATA;);
%DATA[27] -> RWORD(R175 := DATA;);
%DATA[29] -> RWORD(R176 := DATA;);
%DATA[31] -> RWORD(R177 := DATA;);
%DATA[33] -> RWORD(R178 := DATA;);
TIMEOUT 1000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for Climaveneta Analog settings
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2010-11-22 inital version
%
DEVICETYPE ClimavenetaSet NAMED "ClimavenetaSätt" TYPEID 21406 IS
PARAMETER
Id : "Adress";
%R002 : "BörvärdeKöldb." ["°C"]; % 40002 A In/Ut Önskad köldbärartemperatur (börvärde)
R003 : "VärmebärareBörv"["°C"]; % 40003 A In/Ut Önskad värmebärartemperatur (börvärde)
R005 : "KopplingsDiffKB"["°C"]; % 40005 A In/Ut Kopplingsdifferens köldbärartemperatur(P-band)
%R143 : "Driftsätt"; % 40143 I In/Ut Driftsätt:
% 3 = Vätskekylaggregat
% 4 = Värmepump
%R172 : "KylaEffektBegr" ["%"]; % 40172 I In/Ut Effektbegränsning [%] (kyldrift)
%R173 : "VärmeEffektBegr"["%"]; % 40173 I In/Ut Effektbegränsning [%] (värmedrift)
PUBLIC
U003 : "VärmebärareBörv"["°C"]; % 40003 A Önskad värmebärartemperatur
U005 : "KopplingsDiffKB"["°C"]; % 40005 A Kopplingsdifferens
PRIVATE
Cnt;
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM Settings1 NAMED "Ställ värden" IS
QUESTION
DATA[0] := BYTE(Id);
DATA[1] := HEX(06); % Write singel register
DATA[2] <- RWORD( % Start adress (regnr-1)
Cnt := Cnt + 1;
IF Cnt>1 THEN Cnt:=0; ENDIF;
% Adress=Register-1
IF Cnt=0 THEN DATA := 2; % R003
ELSIF Cnt=1 THEN DATA := 4; % R005
%ELSIF Cnt=2 THEN DATA := 2; % R003
%ELSIF Cnt=3 THEN DATA := 172; % R173
%ELSIF Cnt=4 THEN DATA := 2; % R003
%ELSIF Cnt=5 THEN DATA := 172; % R173
%ELSIF Cnt=6 THEN DATA := 2; % R003
%ELSIF Cnt=7 THEN DATA := 172; % R173
%ELSE DATA := 2; % R003
ENDIF;
);
DATA[4] <- RWORD(
IF Cnt=0 THEN
U003 := R003;
IF R003<0 THEN DATA := 0; % R003 Önskad värmebärartemp (börvärde)
ELSE DATA := R003;
ENDIF;
ELSIF Cnt=1 THEN
U005 := R005;
IF R005<0 THEN DATA := 0; % R005 Kopplingsdifferens
ELSE DATA := R005;
ENDIF;
%ELSIF Cnt=2 THEN
% IF R003<0 THEN DATA := 0; % R003 Önskad värmebärartemp(börvärde)
% ELSIF R003>200 THEN DATA := 2000;
% ELSE DATA := R003;
% ENDIF;
%ELSIF Cnt=3 THEN
% IF R173<0 THEN DATA := 0; % R173 Effektbegränsning [%] (värmedrift)
% ELSIF R173>100 THEN DATA := 100;
% ELSE DATA := R173;
% ENDIF;
%ELSIF Cnt=4 THEN
% IF R003<0 THEN DATA := 0; % R003 Önskad värmebärartemp (börvärde)
% ELSIF R003>200 THEN DATA := 2000;
% ELSE DATA := R003;
% ENDIF;
%ELSIF Cnt=5 THEN
% IF R173<0 THEN DATA := 0; % R173 Effektbegränsning [%] (värmedrift)
% ELSIF R173>100 THEN DATA := 100;
% ELSE DATA := R173;
% ENDIF;
%ELSIF Cnt=6 THEN
% IF R003<0 THEN DATA := 0; % R003 Önskad värmebärartemp (börvärde)
% ELSIF R003>200 THEN DATA := 2000;
% ELSE DATA := R003;
% ENDIF;
%ELSIF Cnt=7 THEN
% IF R173<0 THEN DATA := 0; % R173 Effektbegränsning [%] (värmedrift)
% ELSIF R173>100 THEN DATA := 100;
% ELSE DATA := R173;
% ENDIF;
%ELSE
% IF R003<0 THEN DATA := 0; % R003 Önskad värmebärartemp (börvärde)
% ELSIF R003>200 THEN DATA := 2000;
% ELSE DATA := R003;
% ENDIF;
ENDIF;
);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = HEX(06);
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.