Swegon GOLD
Detaljer
- Typ
- Drivrutin
- Upplaggd av
- Ove Jansson, Abelko Innovation
- Version
- 1
- Uppdaterad
- 2013-08-27
- Skapad
- 2013-08-27
- Kategori
- Modbus, Ventilation
- Visningar
- 6816
Beskrivning
Drivrutin till Swegon GOLD
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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Modified 100416: Added registers in "Swegon settings"
% Modified 101115: Klarar nu negativa temperaturer
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for SWEGON GOLD 04-80 read input registers 1-20
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Note! Telegram for reading Analog status
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2008-01-03 inital version
% History: 2010-03-30 Updated for Gold 04-80 version 1.05 and newer
%
DEVICETYPE SwegonAnalog1 NAMED "Swegon analog 1" TYPEID 21201 IS
PARAMETER
Id : "Address";
PUBLIC
R1 : "SA Airflow" ["l/s"]; %SA Airflow
R2 : "SA Airflow setp" ["l/s"]; %SA Airflow setpoint
R3 : "EA Airflow" ["l/s"]; %EA Airflow
R4 : "EA Airflow setp" ["l/s"]; %EA Airflow setpoint
R5 : "SA DuctPressure" ["Pa"]; %SA Duct press.
R6 : "SA DuctSetpoint" ["Pa"]; %SA Duct press. setpoint
R7 : "EA DuctPressure" ["Pa"]; %EA Duct press.
R8 : "EA DuctSetpoint" ["Pa"]; %EA Duct press. setpoint
R9 : "SA VAV demand" ["%"]; %SA VAV demand/boost input
R10 : "SA VAV setpoint" ["%"]; %SA VAV demand setpoint
R11 : "EA VAV demand" ["%"]; %EA VAV demand/boost input
R12 : "EA VAV setpoint" ["%"]; %EA VAV demand setpoint
R13 : "SA Fan level" ["%"]; %SA Fan level
R14 : "EA Fan level" ["%"]; %EA Fan level
R15 : "SA Fan effect" ["W"]; %SA Fan effect
R16 : "EA Fan effect" ["W"]; %EA Fan effect
R17 : "SFP" [" "]; %SFP
R18 : "SA FanFrequency" ["Hz"]; %SA Fan Frequency
R19 : "EA FanFrequency" ["Hz"]; %EA Fan Frequency
R20 : "SA Fan Voltage" ["V"]; %SA Fan Voltage
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM AnalogInput1 NAMED "Register 1-20" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(04); % Modbus command "04h" Read registers
DATA[2] := RWORD(0); % Start address register
DATA[4] := RWORD(20); % Number of registers
ANSWER SIZE 45
DATA[0] = BYTE(Id); % ID
DATA[1] = HEX(04); % Modbus command "04h" Read registers
DATA[2] = BYTE(40); % Byte count
DATA[3] -> RWORD(R1 := DATA;); % 0-8200 l/s
DATA[5] -> RWORD(R2 := DATA;); % 0-8200 l/s
DATA[7] -> RWORD(R3 := DATA;); % 0-8200 l/s
DATA[9] -> RWORD(R4 := DATA;); % 0-8200 l/s
DATA[11] -> RWORD(R5 := DATA;); % 20-750 Pa
DATA[13] -> RWORD(R6 := DATA;); % 20-750 Pa
DATA[15] -> RWORD(R7 := DATA;); % 20-750 Pa
DATA[17] -> RWORD(R8 := DATA;); % 20-750 Pa
DATA[19] -> RWORD(R9 := DATA /100;); % 0-100.00 %
DATA[21] -> RWORD(R10 := DATA /100;); % 0-100.00 %
DATA[23] -> RWORD(R11 := DATA /100;); % 0-100.00 %
DATA[25] -> RWORD(R12 := DATA /100;); % 0-100.00 %
DATA[27] -> RWORD(R13 := DATA /100;); % 0-100.00 %
DATA[29] -> RWORD(R14 := DATA /100;); % 0-100.00 %
DATA[31] -> RWORD(R15 := DATA;); % 0-6500 W
DATA[33] -> RWORD(R16 := DATA;); % 0-6500 W
DATA[35] -> RWORD(R17 := DATA / 10;); % 0.0-9.9 ?
DATA[37] -> RWORD(R18 := DATA /100;); % 0-100.00 Hz
DATA[39] -> RWORD(R19 := DATA /100;); % 0-100.00 Hz
DATA[41] -> RWORD(R20 := DATA;); % 0-500 V
TIMEOUT 2000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for SWEGON GOLD 04-80 read input registers 21-40
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Note! Telegram for reading Analog status
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2008-01-03 inital version
%
DEVICETYPE SwegonAnalog2 NAMED "Swegon analog 2" TYPEID 21202 IS
PARAMETER
Id : "Address";
PUBLIC
R21 : "EA Fan Voltage" ["V"]; %EA Fan Voltage
R22 : "SA Fan Current" ["A"]; %SA Fan Current
R23 : "EA Fan Current" ["A"]; %EA Fan Current
R24 : "SA Pressure" ["Pa"]; %SA Inlet Airflow press.
R25 : "EA Pressure" ["Pa"]; %EA Inlet Airflow press.
R26 : "SA TempSetpoint" ["°C"]; %SA Temp setpoint
R27 : "EA TempSetpoint" ["°C"]; %EA Temp setpoint
R28 : "SA Temperature" ["°C"]; %SA Temp
R29 : "EA RoomTemp" ["°C"]; %EA/Room Temp (internal)
R30 : "OutdoorTemp" ["°C"]; %Outdoor Temp (internal)
R31 : "EA RoomTemp Ext" ["°C"]; %EA/Room Temp (external)
R32 : "OutdoorTemp Ext" ["°C"]; %Outdoor Temp (external)
R33 : "Anti frost Temp" ["°C"]; %Anti frost Temp
R34 : "Temp sensor 3" ["°C"]; %Temp sensor 3
R35 : "Temp sensor 4" ["°C"]; %Temp sensor 4
R36 : "Rotary HX level" ["%"]; %Rotary HX level
R37 : "Reheat level" ["%"]; %Reheat level
R38 : "SA Down level" ["%"]; %SA Down regulation level
R39 : "Extra Seq.level" ["%"]; %Extra reg. sequence level
R40 : "Cooling level" ["%"]; %Cooling level
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM AnalogInput2 NAMED "Register 21-40" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(04); % Modbus command "04h" Read registers
DATA[2] := RWORD(20); % Start address register
DATA[4] := RWORD(20); % Number of registers
ANSWER SIZE 45
DATA[0] = BYTE(Id); % ID
DATA[1] = HEX(04); % Modbus command "04h" Read registers
DATA[2] = BYTE(40); % Byte count
DATA[3] -> RWORD(R21 := DATA;); % 0-500 V
DATA[5] -> RWORD(R22 := DATA / 1000;); % 0-30.000 A
DATA[7] -> RWORD(R23 := DATA / 1000;); % 0-30.000 A
DATA[9] -> RWORD(R24 := DATA;); % 0-2000 Pa
DATA[11] -> RWORD(R25 := DATA;); % 0-2000 Pa
DATA[13] -> RWORD(IF (DATA>=32768) THEN R26:=(DATA-65536)/100; ELSE R26:=DATA/100; ENDIF;); %-55.00-125.00°C
DATA[15] -> RWORD(IF (DATA>=32768) THEN R27:=(DATA-65536)/100; ELSE R27:=DATA/100; ENDIF;); %-55.00-125.00°C
DATA[17] -> RWORD(IF (DATA>=32768) THEN R28:=(DATA-65536)/100; ELSE R28:=DATA/100; ENDIF;); %-55.00-125.00°C
DATA[19] -> RWORD(IF (DATA>=32768) THEN R29:=(DATA-65536)/100; ELSE R29:=DATA/100; ENDIF;); %-55.00-125.00°C
DATA[21] -> RWORD(IF (DATA>=32768) THEN R30:=(DATA-65536)/100; ELSE R30:=DATA/100; ENDIF;); %-55.00-125.00°C
DATA[23] -> RWORD(IF (DATA>=32768) THEN R31:=(DATA-65536)/100; ELSE R31:=DATA/100; ENDIF;); %-55.00-125.00°C
DATA[25] -> RWORD(IF (DATA>=32768) THEN R32:=(DATA-65536)/100; ELSE R32:=DATA/100; ENDIF;); %-55.00-125.00°C
DATA[27] -> RWORD(IF (DATA>=32768) THEN R33:=(DATA-65536)/100; ELSE R33:=DATA/100; ENDIF;); %-55.00-125.00°C
DATA[29] -> RWORD(IF (DATA>=32768) THEN R34:=(DATA-65536)/100; ELSE R34:=DATA/100; ENDIF;); %-55.00-125.00°C
DATA[31] -> RWORD(IF (DATA>=32768) THEN R35:=(DATA-65536)/100; ELSE R35:=DATA/100; ENDIF;); %-55.00-125.00°C
DATA[33] -> RWORD(R36 := DATA / 100;); % 0-100.00 %
DATA[35] -> RWORD(R37 := DATA / 100;); % 0-100.00 %
DATA[37] -> RWORD(R38 := DATA / 100;); % 0-100.00 %
DATA[39] -> RWORD(R39 := DATA / 100;); % 0-100.00 %
DATA[41] -> RWORD(R40 := DATA / 100;); % 0-100.00 %
TIMEOUT 2000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for SWEGON GOLD 04-80 read input registers 41-60
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Note! Telegram for reading Analog status
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2008-01-03 inital version
% History: 2008-08-08 Handels negativ value for register 56 (PW)
%
DEVICETYPE SwegonAnalog3 NAMED "Swegon analog 3" TYPEID 21203 IS
PARAMETER
Id : "Address";
PUBLIC
R41 : "Heat boostLevel" ["%"]; %Heating boost level
R42 : "Cool boostLevel" ["%"]; %Cooling boost level
R43 : "HX pressurLevel" ["Pa"]; %HX press. level
R44 : "HX pressurLimit" ["Pa"]; %HX press. alarm limit
R45 : "HX temperature" ["°C"]; %HX Temp
R46 : "Effect redLevel" ["%"]; %Effect reduction level
R47 : "AF SetpointOper" ["°C"]; %Anti frost temp setpoint/oper
R48 : "AF SetpointStop" ["°C"]; %Anti frost temp setpoint/stop
R49 : "AF Alarm limit" ["°C"]; %Anti frost temp alarm limit
R50 : "SA filt p.level" ["Pa"]; %SA filter press. level
R51 : "SA filt p.limit" ["Pa"]; %SA filter press. alarm limit.
R52 : "SA filt p.lev.n" ["Pa"]; %SA filter press. level, new
R53 : "EA filt p.level" ["Pa"]; %EA filter press. level
R54 : "EA filt p.limit" ["Pa"]; %EA filter press. alarm limit.
R55 : "EA filt p.lev.n" ["Pa"]; %EA filter press. level, new
R56 : "Temp displacem." ["°C"]; %Temp displacement
R57 : "Coil type"; %Coil type
R58 : "Cool step time" ["s"]; %Cool step time
R59 : "Cool res.timeR1" ["s"]; %Cool relay 1 restart time
R60 : "Cool res.timeR2" ["s"]; %Cool relay 2 restart time
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM AnalogInput3 NAMED "Register 41-60" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(04); % Modbus command "04h" Read registers
DATA[2] := RWORD(40); % Start address register
DATA[4] := RWORD(20); % Number of registers
ANSWER SIZE 45
DATA[0] = BYTE(Id); % ID
DATA[1] = HEX(04); % Modbus command "04h" Read registers
DATA[2] = BYTE(40); % Byte count
DATA[3] -> RWORD(R41 := DATA / 100;); % 0-100.00 %
DATA[5] -> RWORD(R42 := DATA / 100;); % 0-100.00 %
DATA[7] -> RWORD(R43 := DATA;); % 0-1000 Pa
DATA[9] -> RWORD(R44 := DATA;); % 0-1000 Pa
DATA[11] -> RWORD(R45 := DATA / 100;); % 0-100.00 °C
DATA[13] -> RWORD(R46 := DATA / 100;); % 0-100.00 %
DATA[15] -> RWORD(R47 := DATA / 100;); % 0-40.00 °C
DATA[17] -> RWORD(R48 := DATA / 100;); % 0-40.00 °C
DATA[19] -> RWORD(R49 := DATA / 100;); % 5.00-30.00 °C
DATA[21] -> RWORD(R50 := DATA;); % 50-300 Pa
DATA[23] -> RWORD(R51 := DATA;); % 50-300 Pa
DATA[25] -> RWORD(R52 := DATA;); % 50-300 Pa
DATA[27] -> RWORD(R53 := DATA;); % 50-300 Pa
DATA[29] -> RWORD(R54 := DATA;); % 50-300 Pa
DATA[31] -> RWORD(R55 := DATA;); % 50-300 Pa
DATA[33] -> RWORD(IF (DATA>=32768) THEN R56:=(DATA-65536)/100; ELSE R56:=DATA/100; ENDIF;); % -5.00-5.00 °C
DATA[35] -> RWORD(R57 := DATA;); % 0-20
DATA[37] -> RWORD(R58 := DATA;); % 0-600 s
DATA[39] -> RWORD(R59 := DATA;); % 0-900 s
DATA[41] -> RWORD(R60 := DATA;); % 0-900 s
TIMEOUT 2000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for SWEGON GOLD 04-80 read input registers 61-80
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Note! Telegram for reading Analog status
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2008-01-03 inital version
%
DEVICETYPE SwegonAnalog4 NAMED "Swegon analog 4" TYPEID 21204 IS
PARAMETER
Id : "Address";
PUBLIC
R61 : "P.ver HMI"; %Progv. HMI (OP)
R62 : "P.ver HMI-slave"; %Progv. HMIslave (extra OP)
R63 : "P.ver Main unit"; %Progv. Ctrl (main unit)
R64 : "P.ver SA FC-1"; %Progv. SA FC-1. (SA freq. conv. 1)
R65 : "P.ver SA FC-2"; %Progv. SA FC-2. (SA freq. conv. 2)
R66 : "P.ver EA FC-1"; %Progv. EA FC-1. (EA freq. conv. 1)
R67 : "P.ver EA FC-2"; %Progv. EA FC-2. (EA freq. conv. 2)
R68 : "P.ver HX unit"; %Progv. HX (control unit)
R69 : "Weekday"; %Weekday
R70 : "Low speed time" ["h"]; %Extended low speed op.
R71 : "Low speed time" ["h"]; %Extended low speed op.
R72 : "High speed time" ["m"]; %Extended high speed op.
R73 : "High speed time" ["m"]; %Extended high speed op.
R74 : "SA Fan time" ["days"]; %SA Fan operation time
R75 : "EA Fan time" ["days"]; %EA Fan operation time
R76 : "Cool time" ["days"]; %Cool operation time
R77 : "HX time" ["days"]; %Heat exchange operation time
R78 : "Reheat time" ["days"]; %Reheat operation time
R79 : "Tripped alarm"; %Present tripped alarm
R80 : "Tripped alarm 1"; %Active not tripped alarm no.1
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM AnalogInput4 NAMED "Register 61-80" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(04); % Modbus command "04h" Read registers
DATA[2] := RWORD(60); % Start address register
DATA[4] := RWORD(20); % Number of registers
ANSWER SIZE 45
DATA[0] = BYTE(Id); % ID
DATA[1] = HEX(04); % Modbus command "04h" Read registers
DATA[2] = BYTE(40); % Byte count
DATA[3] -> RWORD(R61 := DATA / 100;); %0-10.00
DATA[5] -> RWORD(R62 := DATA / 100;); %0-10.00
DATA[7] -> RWORD(R63 := DATA / 100;); %0-10.00
DATA[9] -> RWORD(R64 := DATA / 100;); %0-10.00
DATA[11] -> RWORD(R65 := DATA / 100;); %0-10.00
DATA[13] -> RWORD(R66 := DATA / 100;); %0-10.00
DATA[15] -> RWORD(R67 := DATA / 100;); %0-10.00
DATA[17] -> RWORD(R68 := DATA / 100;); %0-10.00
DATA[19] -> RWORD(R69 := DATA;); %0-6
DATA[21] -> RWORD(R70 := DATA;); %0-23 h
DATA[23] -> RWORD(R71 := DATA;); %0-59 h
DATA[25] -> RWORD(R72 := DATA;); %0-23 m
DATA[27] -> RWORD(R73 := DATA;); %0-59 m
DATA[29] -> RWORD(R74 := DATA;); %0-9999 days
DATA[31] -> RWORD(R75 := DATA;); %0-9999 days
DATA[33] -> RWORD(R76 := DATA;); %0-9999 days
DATA[35] -> RWORD(R77 := DATA;); %0-9999 days
DATA[37] -> RWORD(R78 := DATA;); %0-9999 days
DATA[39] -> RWORD(R79 := DATA;); %0-200
DATA[41] -> RWORD(R80 := DATA;); %0-200
TIMEOUT 2000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for SWEGON GOLD 04-80 read input registers 81-100
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Note! Telegram for reading Analog status
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2008-01-03 inital version
%
DEVICETYPE SwegonAnalog5 NAMED "Swegon analog 5" TYPEID 21205 IS
PARAMETER
Id : "Address";
PUBLIC
R81 : "Tripped alarm 2"; %Active not tripped alarm no.2
R82 : "Tripped alarm 3"; %Active not tripped alarm no.3
R83 : "SA Fan size"; %SA Fan size
R84 : "EA Fan size" ; %EA Fan size
R85 : "OperationMode 1"; %Operation mode 1
R86 : "OperationMode 2"; %Operation mode 2
R87 : "OperationManual"; %Operation mode, manual
R88 : "InputStat 1-16"; %Copy of Input Status 1-16.
R89 : "InputStat 17-32"; %Copy of Input Status 17-32.
R90 : "InputStat 33-48"; %Copy of Input Status 33-48.
R91 : "HX regulator" ["%"]; %HX regulator
R92 : "EA Humidity" ["%"]; %EA-humidity
R93 : "EA HumidityTemp" ["°C"]; %EA-humidity Temp
R94 : "EA Dewpoint" ["°C"]; %EA-dewpoint
R95 : "ColdWater temp" ["°C"]; %Chilled water Temp
R96 : "ColdWater setp" ["°C"]; %Chilled water Temp setpoint
R97 : "ColdWaterOutput" ["%"]; %Chilled water output
R98 : "SA DewpointReg" ["°C"]; %SA-dewpoint regulator
R99 : "SA Humidity" ["%"]; %SA-humidity
R100 : "SA HumidityTemp" ["°C"]; %SA-humidity Temp
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM AnalogInput5 NAMED "Register 81-100" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(04); % Modbus command "04h" Read registers
DATA[2] := RWORD(80); % Start address register
DATA[4] := RWORD(20); % Number of registers
ANSWER SIZE 45
DATA[0] = BYTE(Id); % ID
DATA[1] = HEX(04); % Modbus command "04h" Read registers
DATA[2] = BYTE(40); % Byte count
DATA[3] -> RWORD(R81 := DATA;); %0-200
DATA[5] -> RWORD(R82 := DATA;); %0-200
DATA[7] -> RWORD(R83 := DATA;); %04-80
DATA[9] -> RWORD(R84 := DATA;); %04-80
DATA[11] -> RWORD(R85 := DATA;); %0-18
DATA[13] -> RWORD(R86 := DATA;); %0-22
DATA[15] -> RWORD(R87 := DATA;); %0-3
DATA[17] -> RWORD(R88 := DATA;); %0-65535
DATA[19] -> RWORD(R89 := DATA;); %0-65535
DATA[21] -> RWORD(R90 := DATA;); %0-65535
DATA[23] -> RWORD(R91 := DATA / 100;); %0-100.00 %
DATA[25] -> RWORD(R92 := DATA / 100;); %0-100.00 %
DATA[27] -> RWORD(IF (DATA>=32768) THEN R93:=(DATA-65536)/100; ELSE R93:=DATA/100; ENDIF;); %-55.00-125.00°C
DATA[29] -> RWORD(IF (DATA>=32768) THEN R94:=(DATA-65536)/100; ELSE R94:=DATA/100; ENDIF;); %-55.00-125.00°C
DATA[31] -> RWORD(IF (DATA>=32768) THEN R95:=(DATA-65536)/100; ELSE R95:=DATA/100; ENDIF;); %-55.00-125.00°C
DATA[33] -> RWORD(IF (DATA>=32768) THEN R96:=(DATA-65536)/100; ELSE R96:=DATA/100; ENDIF;); %-55.00-125.00°C
DATA[35] -> RWORD(R97 := DATA / 100;); %0-100.00 %
DATA[37] -> RWORD(IF (DATA>=32768) THEN R98:=(DATA-65536)/100; ELSE R98:=DATA/100; ENDIF;); %-55.00-125.00°C
DATA[39] -> RWORD(R99 := DATA / 100;); %0-100.00 %
DATA[41] -> RWORD(IF (DATA>=32768) THEN R100:=(DATA-65536)/100; ELSE R100:=DATA/100; ENDIF;); %-55.00-125.00°C
TIMEOUT 2000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for SWEGON GOLD 04-80 read input registers 101-120
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Note! Telegram for reading Analog status
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2008-01-03 inital version
%
DEVICETYPE SwegonAnalog6 NAMED "Swegon analog 6" TYPEID 21206 IS
PARAMETER
Id : "Address";
PUBLIC
R101 : "SA Dewpoint" ["°C"]; %SA-dewpoint
R102 : "HX Coil Temp" ["°C"]; %Coil HX. Temp
R103 : "HX Plate Temp 1" ["°C"]; %P.HX. Temp 1 (plate )
R104 : "HX Plate Temp 2" ["°C"]; %P.HX. Temp 2 (plate )
R105 : "HX P/C Humidity" ["%"]; %P/C.HX. Humidity (plate/coil)
R106 : "HX R.Efficiency" ["%"]; %R.HX. efficiency (rotary )
R107 : "HX Coil Valve" ["%"]; %C.HX. Valve output (coil HX)
R108 : "HX Plate bypass" ["%"]; %P.HX bypass output
R109 : "SA pref p.level" ["Pa"]; %SA prefilter press. level
R110 : "SA pref p.limit" ["Pa"]; %SA prefilter press. alarm lim
R111 : "SA pref p.lev.n" ["Pa"]; %SA prefilter press. level new
R112 : "EA pref p.level" ["Pa"]; %EA prefilter press. level
R113 : "EA pref p.limit" ["Pa"]; %EA prefilter press. alarm lim
R114 : "EA pref p.lev.n" ["Pa"]; %EA prefilter press. level new
R115 : "XZ reheat level" ["%"]; %Xzone reheat level
R116 : "XZ AF temp" ["°C"]; %Xzone anti frost Temp
R117 : "XZ CoolLevel" ["%"]; %Xzone cooling level
R118 : "XZ CoolStepTime" ["s"]; %Xzone cool step time
R119 : "XZ CoolResTime1" ["s"]; %Xzone cool relay 1 restart time
R120 : "XZ CoolResTime2" ["s"]; %Xzone cool relay 2 restart time
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM AnalogInput6 NAMED "Register101-120" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(04); % Modbus command "04h" Read registers
DATA[2] := RWORD(100); % Start address register
DATA[4] := RWORD(20); % Number of registers
ANSWER SIZE 45
DATA[0] = BYTE(Id); % ID
DATA[1] = HEX(04); % Modbus command "04h" Read registers
DATA[2] = BYTE(40); % Byte count
DATA[3] -> RWORD(IF (DATA>=32768) THEN R101:=(DATA-65536)/100; ELSE R101:=DATA/100; ENDIF;); %-55.00-125.00°C
DATA[5] -> RWORD(IF (DATA>=32768) THEN R102:=(DATA-65536)/100; ELSE R102:=DATA/100; ENDIF;); %-55.00-125.00°C
DATA[7] -> RWORD(IF (DATA>=32768) THEN R103:=(DATA-65536)/100; ELSE R103:=DATA/100; ENDIF;); %-55.00-125.00°C
DATA[9] -> RWORD(IF (DATA>=32768) THEN R104:=(DATA-65536)/100; ELSE R104:=DATA/100; ENDIF;); %-55.00-125.00°C
DATA[11] -> RWORD(R105 := DATA / 100;); %0-100.00 %
DATA[13] -> RWORD(R106 := DATA / 100;); %0-100.00 %
DATA[15] -> RWORD(R107 := DATA / 100;); %0-100.00 %
DATA[17] -> RWORD(R108 := DATA;); %0-100 %
DATA[19] -> RWORD(R109 := DATA;); %50-300 Pa
DATA[21] -> RWORD(R110 := DATA;); %50-300 Pa
DATA[23] -> RWORD(R111 := DATA;); %50-300 Pa
DATA[25] -> RWORD(R112 := DATA;); %50-300 Pa
DATA[27] -> RWORD(R113 := DATA;); %50-300 Pa
DATA[29] -> RWORD(R114 := DATA;); %50-300 Pa
DATA[31] -> RWORD(R115 := DATA / 100;); %0-100.00 %
DATA[33] -> RWORD(IF (DATA>=32768) THEN R116:=(DATA-65536)/100; ELSE R116:=DATA/100; ENDIF;); %-55.00-125.00°C
DATA[35] -> RWORD(R117 := DATA / 100;); %0-100.00 %
DATA[37] -> RWORD(R118 := DATA;); %0-600 s
DATA[39] -> RWORD(R119 := DATA;); %0-900 s
DATA[41] -> RWORD(R120 := DATA;); %0-900 s
TIMEOUT 2000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for SWEGON GOLD 04-80 read input registers 121-136
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Note! Telegram for reading Analog status
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2008-01-03 inital version
%
DEVICETYPE SwegonAnalog7 NAMED "Swegon analog 7" TYPEID 21207 IS
PARAMETER
Id : "Address";
PUBLIC
R121 : "XZ SA TempReg" ["°C"]; %Xzone SA Temp regulator
R122 : "XZ EA TempReg" ["°C"]; %Xzone EA Temp regulator
R123 : "XZ SA Temp" ["°C"]; %Xzone SA Temp
R124 : "XZ EA/Room temp" ["°C"]; %Xzone EA/Room Temp
R125 : "PreHeat temp" ["°C"]; %Pre-heating air Temp
R126 : "PreHeat templev" ["%"]; %Pre-heating level
R127 : "PreHeat AF temp" ["°C"]; %Pre-heating anti frost Temp
R128 : "ReCO2 input" ["%"]; %ReCO2 CO2 input
R129 : "ReCO2 IntDamper" ["%"]; %ReCO2 internal damper outp
R130 : "ReCO2 ExtDamper" ["%"]; %ReCO2 external damper outp
R131 : "ReCO2 OAFlow" ["l/s"]; %ReCO2 outdoor airflow
R132 : "ReCO2 OAF.Setp." ["l/s"]; %ReCO2 outdoor airflow setp.
R133 : "ReCO2 OAPressur" ["Pa"]; %ReCO2 outdoor airflow press.
R134 : "Preheat time" ["days"]; %Preheat operation time
R135 : "XZ Cool time" ["days"]; %Xzone cool operation time
R136 : "XZ Reheat time" ["days"]; %Xzone reheat operation time
%% Added 100330 PW
R137 : "SA-D temp" ["°C"]; %SA-D temp
R138 : "EA-D temp" ["°C"]; %EA-D temp
R139 : "AYC heat temp" ["°C"]; %AYC heat temp
R140 : "AYC heat Setp." ["°C"]; %AYC heat setpoint
%R141 : "AYC heat Valve" ["%"]; %AYC heat valve output
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM AnalogInput7 NAMED "Register121-141" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(04); % Modbus command "04h" Read registers
DATA[2] := RWORD(120); % Start address register
DATA[4] := RWORD(21); % Number of registers 100330
ANSWER SIZE 47
DATA[0] = BYTE(Id); % ID
DATA[1] = HEX(04); % Modbus command "04h" Read registers
DATA[2] = BYTE(42); % Byte count 100330
DATA[3] -> RWORD(IF (DATA>=32768) THEN R121:=(DATA-65536)/100; ELSE R121:=DATA/100; ENDIF;); %-55.00-125.00°C
DATA[5] -> RWORD(IF (DATA>=32768) THEN R122:=(DATA-65536)/100; ELSE R122:=DATA/100; ENDIF;); %-55.00-125.00°C
DATA[7] -> RWORD(IF (DATA>=32768) THEN R123:=(DATA-65536)/100; ELSE R123:=DATA/100; ENDIF;); %-55.00-125.00°C
DATA[9] -> RWORD(IF (DATA>=32768) THEN R124:=(DATA-65536)/100; ELSE R124:=DATA/100; ENDIF;); %-55.00-125.00°C
DATA[11] -> RWORD(IF (DATA>=32768) THEN R125:=(DATA-65536)/100; ELSE R125:=DATA/100; ENDIF;); %-55.00-125.00°C
DATA[13] -> RWORD(R126 := DATA / 100;); %0-100.00 %
DATA[15] -> RWORD(IF (DATA>=32768) THEN R127:=(DATA-65536)/100; ELSE R127:=DATA/100; ENDIF;); %-55.00-125.00°C
DATA[17] -> RWORD(R128 := DATA / 100;); %0-100.00 %
DATA[19] -> RWORD(R129 := DATA / 100;); %0-100.00 %
DATA[21] -> RWORD(R130 := DATA / 100;); %0-100.00 %
DATA[23] -> RWORD(R131 := DATA;); %0-8200 l/s
DATA[25] -> RWORD(R132 := DATA;); %0-8200 l/s
DATA[27] -> RWORD(R133 := DATA;); %0-2000 Pa
DATA[29] -> RWORD(R134 := DATA;); %0-9999 days
DATA[31] -> RWORD(R135 := DATA;); %0-9999 days
DATA[33] -> RWORD(R136 := DATA;); %0-9999 days
% Added 100330
DATA[35] -> RWORD(IF (DATA>=32768) THEN R137:=(DATA-65536)/100; ELSE R137:=DATA/100; ENDIF;); %-55.00-125.00°C PV 5.07
DATA[37] -> RWORD(IF (DATA>=32768) THEN R138:=(DATA-65536)/100; ELSE R138:=DATA/100; ENDIF;); %-55.00-125.00°C PV 5.07
DATA[39] -> RWORD(IF (DATA>=32768) THEN R139:=(DATA-65536)/100; ELSE R139:=DATA/100; ENDIF;); %-55.00-125.00°C PV 5.07
DATA[41] -> RWORD(IF (DATA>=32768) THEN R140:=(DATA-65536)/100; ELSE R140:=DATA/100; ENDIF;); %-55.00-125.00°C PV 5.07
%DATA[43] -> RWORD(IF (DATA>=32768) THEN R141:=(DATA-65536)/100; ELSE R141:=DATA/100; ENDIF;); % 0-100.00% PV 5.07
TIMEOUT 2000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for SWEGON GOLD 04-80 read digital inputs 1-20
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Note! Telegram for reading digital inputs
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2008-01-03 inital version
%
DEVICETYPE SwegonDigital1 NAMED "Swegon DI 1" TYPEID 21208 IS
PARAMETER
Id : "Address";
PUBLIC
DI1 : "Heat relay"; %Heat relay output
DI2 : "Cool relay 1"; %Cool relay output 1
DI3 : "Cool relay 2"; %Cool relay output 2
DI4 : "Fan low speed"; %Low speed relay output
DI5 : "Fan high speed"; %High speed relay output
DI6 : "A-alarm relay"; %A-alarm relay
DI7 : "B-alarm relay"; %B-alarm relay
DI8 : "Operation relay"; %Operation relay output
DI9 : "Damper relay"; %Damper relay output
DI10 : "Ind. Low speed"; %External low speed input
DI11 : "Ind. High speed"; %External high speed input
DI12 : "Ind. Alarm 1"; %External alarm 1 input
DI13 : "Ind. Alarm 2"; %External alarm 2 input
DI14 : "Ind. Fire alarm"; %External fire alarm input.
DI15 : "Ind. Stop input"; %External stop input
DI16 : "DIP Switch 1"; %DIP Switch 1
DI17 : "DIP Switch 2"; %DIP Switch 2
DI18 : "DIP Switch 3"; %DIP Switch 3
DI19 : "DIP Switch 4"; %DIP Switch 4
DI20 : "DIP Switch 5"; %DIP Switch 5
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM DigitalInput1 NAMED "DI 1-20" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(02); % Modbus command "02h" read discrete input (bit)
DATA[2] := RWORD(0); % Start adress
DATA[4] := RWORD(20); % Number of inputs
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = HEX(02);
DATA[2] = BYTE(3);
DATA[3] -> BYTE(IF (DATA & 1) THEN DI1 := 1; ELSE DI1 := 0; ENDIF;
IF (DATA & 2) THEN DI2 := 1; ELSE DI2 := 0; ENDIF;
IF (DATA & 4) THEN DI3 := 1; ELSE DI3 := 0; ENDIF;
IF (DATA & 8) THEN DI4 := 1; ELSE DI4 := 0; ENDIF;
IF (DATA & 16) THEN DI5 := 1; ELSE DI5 := 0; ENDIF;
IF (DATA & 32) THEN DI6 := 1; ELSE DI6 := 0; ENDIF;
IF (DATA & 64) THEN DI7 := 1; ELSE DI7 := 0; ENDIF;
IF (DATA & 128) THEN DI8 := 1; ELSE DI8 := 0; ENDIF;
);
DATA[4] -> BYTE(IF (DATA & 1) THEN DI9 := 1; ELSE DI9 := 0; ENDIF;
IF (DATA & 2) THEN DI10:= 1; ELSE DI10:= 0; ENDIF;
IF (DATA & 4) THEN DI11:= 1; ELSE DI11:= 0; ENDIF;
IF (DATA & 8) THEN DI12:= 1; ELSE DI12:= 0; ENDIF;
IF (DATA & 16) THEN DI13:= 1; ELSE DI13:= 0; ENDIF;
IF (DATA & 32) THEN DI14:= 1; ELSE DI14:= 0; ENDIF;
IF (DATA & 64) THEN DI15:= 1; ELSE DI15:= 0; ENDIF;
IF (DATA & 128) THEN DI16:= 1; ELSE DI16:= 0; ENDIF;
);
DATA[5] -> BYTE(IF (DATA & 1) THEN DI17:= 1; ELSE DI17:= 0; ENDIF;
IF (DATA & 2) THEN DI18:= 1; ELSE DI18:= 0; ENDIF;
IF (DATA & 4) THEN DI19:= 1; ELSE DI19:= 0; ENDIF;
IF (DATA & 8) THEN DI20:= 1; ELSE DI20:= 0; ENDIF;
);
TIMEOUT 2000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for SWEGON GOLD 04-80 read digital inputs 21-40
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Note! Telegram for reading digital inputs
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2008-01-03 inital version
%
DEVICETYPE SwegonDigital2 NAMED "Swegon DI 2" TYPEID 21209 IS
PARAMETER
Id : "Address";
PUBLIC
DI21 : "DIP Switch 6"; %DIP Switch 6
DI22 : "Reserve 1"; %Reserve 1
DI23 : "Reserve 2"; %Reserve 2
DI24 : "Heat exch. pump"; %(C.HX.) HX pump output
DI25 : "Heat exch. rot."; %(R.HX.) Rotation status
DI26 : "Xzone heat rel."; %Xzone heat relay output
DI27 : "Xzone cool R1"; %Xzone cool relay output 1
DI28 : "Xzone cool R2"; %Xzone cool relay output 2
DI29 : "Pre-heat relay"; %Pre-heat relay output
DI30 : "Reserve 9"; %Reserve 9
DI31 : "Reserve 10"; %Reserve 10
DI32 : "Reserve 11"; %Reserve 11
DI33 : "Reserve 12"; %Reserve 12
DI34 : "Reserve 13"; %Reserve 13
DI35 : "Reserve 14"; %Reserve 14
DI36 : "Reserve 15"; %Reserve 15
DI37 : "Reserve 16"; %Reserve 16
DI38 : "Reserve 17"; %Reserve 17
DI39 : "Reserve 18"; %Reserve 18
DI40 : "Reserve 19"; %Reserve 19
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM DigitalInput2 NAMED "DI 21-40" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(02); % Modbus command "02h" read discrete input (bit)
DATA[2] := RWORD(20); % Start adress
DATA[4] := RWORD(20); % Number of inputs
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = HEX(02);
DATA[2] = BYTE(3);
DATA[3] -> BYTE(IF (DATA & 1) THEN DI21:= 1; ELSE DI21:= 0; ENDIF;
IF (DATA & 2) THEN DI22:= 1; ELSE DI22:= 0; ENDIF;
IF (DATA & 4) THEN DI23:= 1; ELSE DI23:= 0; ENDIF;
IF (DATA & 8) THEN DI24:= 1; ELSE DI24:= 0; ENDIF;
IF (DATA & 16) THEN DI25:= 1; ELSE DI25:= 0; ENDIF;
IF (DATA & 32) THEN DI26:= 1; ELSE DI26:= 0; ENDIF;
IF (DATA & 64) THEN DI27:= 1; ELSE DI27:= 0; ENDIF;
IF (DATA & 128) THEN DI28:= 1; ELSE DI28:= 0; ENDIF;
);
DATA[4] -> BYTE(IF (DATA & 1) THEN DI29:= 1; ELSE DI29:= 0; ENDIF;
IF (DATA & 2) THEN DI30:= 1; ELSE DI30:= 0; ENDIF;
IF (DATA & 4) THEN DI31:= 1; ELSE DI31:= 0; ENDIF;
IF (DATA & 8) THEN DI32:= 1; ELSE DI32:= 0; ENDIF;
IF (DATA & 16) THEN DI33:= 1; ELSE DI33:= 0; ENDIF;
IF (DATA & 32) THEN DI34:= 1; ELSE DI34:= 0; ENDIF;
IF (DATA & 64) THEN DI35:= 1; ELSE DI35:= 0; ENDIF;
IF (DATA & 128) THEN DI36:= 1; ELSE DI36:= 0; ENDIF;
);
DATA[5] -> BYTE(IF (DATA & 1) THEN DI37:= 1; ELSE DI37:= 0; ENDIF;
IF (DATA & 2) THEN DI38:= 1; ELSE DI38:= 0; ENDIF;
IF (DATA & 4) THEN DI39:= 1; ELSE DI39:= 0; ENDIF;
IF (DATA & 8) THEN DI40:= 1; ELSE DI40:= 0; ENDIF;
);
TIMEOUT 2000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for SWEGON GOLD 04-80 read digital inputs 41-51
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Note! Telegram for reading digital inputs
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2008-01-03 inital version
%
DEVICETYPE SwegonDigital3 NAMED "Swegon DI 3" TYPEID 21210 IS
PARAMETER
Id : "Address";
PUBLIC
DI41 : "Reserve 20"; %Reserve 20 1x0041
DI42 : "Reserve 21"; %Reserve 21 1x0042
DI43 : "Reserve 22"; %Reserve 22 1x0043
DI44 : "Reserve 23"; %Reserve 23 1x0044
DI45 : "Reserve 24"; %Reserve 24 1x0045
DI46 : "Reserve 25"; %Reserve 25 1x0046
DI47 : "Reserve 26"; %Reserve 26 1x0047
DI48 : "Reserve 27"; %Reserve 27 1x0048
DI49 : "Status alarm 1"; %Status alarm number 1 1x0049
DI50 : "Status alarm 2"; %Status alarm number 2 1x0050
DI51 : "Status alarm 3"; %Status alarm number 3 1x0051
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM DigitalInput3 NAMED "DI 41-51" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(02); % Modbus command "02h" read discrete input (bit)
DATA[2] := RWORD(40); % Start adress
DATA[4] := RWORD(11); % Number of inputs
ANSWER SIZE 7
DATA[0] = BYTE(Id);
DATA[1] = HEX(02);
DATA[2] = BYTE(2);
DATA[3] -> BYTE(IF (DATA & 1) THEN DI41:= 1; ELSE DI41:= 0; ENDIF;
IF (DATA & 2) THEN DI42:= 1; ELSE DI42:= 0; ENDIF;
IF (DATA & 4) THEN DI43:= 1; ELSE DI43:= 0; ENDIF;
IF (DATA & 8) THEN DI44:= 1; ELSE DI44:= 0; ENDIF;
IF (DATA & 16) THEN DI45:= 1; ELSE DI45:= 0; ENDIF;
IF (DATA & 32) THEN DI46:= 1; ELSE DI46:= 0; ENDIF;
IF (DATA & 64) THEN DI47:= 1; ELSE DI47:= 0; ENDIF;
IF (DATA & 128) THEN DI48:= 1; ELSE DI48:= 0; ENDIF;
);
DATA[4] -> BYTE(IF (DATA & 1) THEN DI49:= 1; ELSE DI49:= 0; ENDIF;
IF (DATA & 2) THEN DI50:= 1; ELSE DI50:= 0; ENDIF;
IF (DATA & 4) THEN DI51:= 1; ELSE DI51:= 0; ENDIF;
);
TIMEOUT 2000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for SWEGON GOLD 04-80 read digital inputs 248-251
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Note! Telegram for reading digital inputs
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2008-01-03 inital version
%
DEVICETYPE SwegonDigital4 NAMED "Swegon DI 4" TYPEID 21211 IS
PARAMETER
Id : "Address";
PUBLIC
DI248 : "Status al. 200"; %Status alarm number 200
DI249 : "Status info 1"; %Status info number 1
DI250 : "Status info 2"; %Status info number 2
DI251 : "Status info 3"; %Status info number 3
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM DigitalInput4 NAMED "DI 248-251" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(02); % Modbus command "02h" read discrete input (bit)
DATA[2] := RWORD(247); % Start adress
DATA[4] := RWORD(4); % Number of inputs
ANSWER SIZE 6
DATA[0] = BYTE(Id);
DATA[1] = HEX(02);
DATA[2] = BYTE(1);
DATA[3] -> BYTE(IF (DATA & 1) THEN DI248 := 1; ELSE DI248 := 0; ENDIF;
IF (DATA & 2) THEN DI249 := 1; ELSE DI249 := 0; ENDIF;
IF (DATA & 4) THEN DI250 := 1; ELSE DI250 := 0; ENDIF;
IF (DATA & 8) THEN DI251 := 1; ELSE DI251 := 0; ENDIF;
);
TIMEOUT 2000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for SWEGON GOLD 04-80 read digital input 348
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Note! Telegram for reading digital inputs
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2008-01-03 inital version
% History: 2008-08-08 Answer size changed from 8 to 6 PW
%
DEVICETYPE SwegonDigital5 NAMED "Swegon DI 5" TYPEID 21212 IS
PARAMETER
Id : "Address";
PUBLIC
DI348 : "Status info 100"; %Status info number 100 1x0348
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM DigitalInput5 NAMED "DI 348" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(02); % Modbus command "02h" read discrete input (bit)
DATA[2] := RWORD(347); % Start adress
DATA[4] := RWORD(1); % Number of inputs
ANSWER SIZE 6
DATA[0] = BYTE(Id);
DATA[1] = HEX(02);
DATA[2] = BYTE(1);
DATA[3] -> BYTE(IF (DATA & 1) THEN DI348 := 1; ELSE DI348 := 0; ENDIF;
);
TIMEOUT 2000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for SWEGON GOLD 04-80 set register value
%
% Settings module: Parity:None, Baud:9600, Mode:RTU
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2010-04-09 inital version
%
DEVICETYPE SwegonSettings NAMED "Swegon settings" TYPEID 21219 IS
PARAMETER
Id : "Address";
% Jag vill ställa börvärde för frånluft.
% Börvärde flöde lågfart tilluft,
% Börvärde flöde högfart tilluft,
% Börvärde flöde lågfart frånluft,
% Börvärde flöde högfart frånluft.
%R001 : "SA Flow Setp.L" ["l/s"]; % 4x0001 SA Low speed airflow setpoint 0-8200l/s
%R002 : "SA Flow Setp.H" ["l/s"]; % 4x0002 SA High speed airflow setpoint 0-8200l/s
%R005 : "EA Flow Setp.L" ["l/s"]; % 4x0005 EA Low speed airflow setpoint 0-8200l/s
%R006 : "EA Flow Setp.H" ["l/s"]; % 4x0006 EA High speed airflow setpoint 0-8200l/s
%R009 : "SA Press Setp.L"["Pa"]; % 4x0009 SA Low speed pressure setpoint 20-750Pa
%R010 : "SA Press Setp.H"["Pa"]; % 4x0010 SA High speed pressure setpoint 20-750Pa
%R013 : "EA Press Setp.L"["Pa"]; % 4x0013 EA Low speed pressure setpoint 20-750Pa
%R014 : "EA Press Setp.H"["Pa"]; % 4x0014 EA High speed pressure setpoint 20-750Pa
R175 : "Operation mode" [""]; % Communication operation mode 0 - 4 PV 5.00
% Setting of unit operation mode from communication.
% 0=Auto operation,
% 1=Communication Stop 1,
% 2=Communication Low speed,
% 3=Communication High speed.
% 4=Communication Stop 2 (New in PV 5.00)
% Summer night cooling, intermittent night heat and
% morning boost functions operates at stop 2.
%R041 : "SA TempSP" ["°C"]; % Supply air temperature setting 10.00-40.00°C
R322 : "Xzone SA TempSP"["°C"]; % Xzone supply air temperature setting 10.00-40.00°C PV 5.00
PUBLIC
PRIVATE
Cnt;
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM Settings1 NAMED "Setvalues" 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; %Ändra villkoret beroende på antal register x
%att ställa. Skriv "Cnt>x"
% Adress=Register-1
IF Cnt=0 THEN DATA := 174; %Register = 175
ELSIF Cnt=1 THEN DATA := 321; %Register = 322
%ELSIF Cnt=2 THEN DATA := 40; %Register = 41
%ELSIF Cnt=3 THEN DATA := 321; %Register = 322
%ELSIF Cnt=4 THEN DATA := 9; %Register = 10
%ELSIF Cnt=5 THEN DATA := 13; %Register = 14
%ELSIF Cnt=6 THEN DATA := 40; %Register = 41
%ELSIF Cnt=7 THEN DATA := 321; %Register = 322
%ELSIF Cnt=8 THEN DATA := 9; %Register = 10
ENDIF;
);
DATA[4] <- RWORD(
IF Cnt=0 THEN
IF R175<0 THEN DATA := 0; % Operation mode 0-4
ELSIF R175>4 THEN DATA := 0;
ELSE DATA := R175;
ENDIF;
ELSIF Cnt=1 THEN
IF R322<10 THEN DATA := 1000; % 10.00-40.00°C
ELSIF R322>40 THEN DATA := 4000;
ELSE DATA := R322*100;
ENDIF;
%ELSIF Cnt=2 THEN
% IF R041<10 THEN DATA := 1000; % 10.00-40.00°C
% ELSIF R041>40 THEN DATA := 4000;
% ELSE DATA := R041*100;
% ENDIF;
%ELSIF Cnt=3 THEN
% IF R322<10 THEN DATA := 1000; % 10.00-40.00°C
% ELSIF R322>40 THEN DATA := 4000;
% ELSE DATA := R322*100;
% ENDIF;
%ELSIF Cnt=4 THEN
% IF R010<20 THEN DATA := 20; % 20-750Pa
% ELSIF R010>750 THEN DATA := 750;
% ELSE DATA := R010;
% ENDIF;
%ELSIF Cnt=5 THEN
% IF R014<20 THEN DATA := 20; % 20-750Pa
% ELSIF R014>750 THEN DATA := 750;
% ELSE DATA := R014;
% ENDIF;
%ELSIF Cnt=6 THEN
% IF R041<10 THEN DATA := 1000; % 10.00-40.00°C
% ELSIF R041>40 THEN DATA := 4000;
% ELSE DATA := R041*100;
% ENDIF;
%ELSIF Cnt=7 THEN
% IF R322<10 THEN DATA := 1000; % 10.00-40.00°C
% ELSIF R322>40 THEN DATA := 4000;
% ELSE DATA := R322*100;
% ENDIF;
%ELSIF Cnt=8 THEN
% IF R010<20 THEN DATA := 20; % 20-750Pa
% ELSIF R010>750 THEN DATA := 750;
% ELSE DATA := R010;
% ENDIF;
ENDIF;
);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = HEX(06);
TIMEOUT 2000
END;
END;
% Modified 100416: Added registers in "Swegon settings"
% Modified 101115: Klarar nu negativa temperaturer
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for SWEGON GOLD 04-80 read input registers 1-20
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Note! Telegram for reading Analog status
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2008-01-03 inital version
% History: 2010-03-30 Updated for Gold 04-80 version 1.05 and newer
%
DEVICETYPE SwegonAnalog1 NAMED "Swegon analog 1" TYPEID 21201 IS
PARAMETER
Id : "Address";
PUBLIC
R1 : "SA Airflow" ["l/s"]; %SA Airflow
R2 : "SA Airflow setp" ["l/s"]; %SA Airflow setpoint
R3 : "EA Airflow" ["l/s"]; %EA Airflow
R4 : "EA Airflow setp" ["l/s"]; %EA Airflow setpoint
R5 : "SA DuctPressure" ["Pa"]; %SA Duct press.
R6 : "SA DuctSetpoint" ["Pa"]; %SA Duct press. setpoint
R7 : "EA DuctPressure" ["Pa"]; %EA Duct press.
R8 : "EA DuctSetpoint" ["Pa"]; %EA Duct press. setpoint
R9 : "SA VAV demand" ["%"]; %SA VAV demand/boost input
R10 : "SA VAV setpoint" ["%"]; %SA VAV demand setpoint
R11 : "EA VAV demand" ["%"]; %EA VAV demand/boost input
R12 : "EA VAV setpoint" ["%"]; %EA VAV demand setpoint
R13 : "SA Fan level" ["%"]; %SA Fan level
R14 : "EA Fan level" ["%"]; %EA Fan level
R15 : "SA Fan effect" ["W"]; %SA Fan effect
R16 : "EA Fan effect" ["W"]; %EA Fan effect
R17 : "SFP" [" "]; %SFP
R18 : "SA FanFrequency" ["Hz"]; %SA Fan Frequency
R19 : "EA FanFrequency" ["Hz"]; %EA Fan Frequency
R20 : "SA Fan Voltage" ["V"]; %SA Fan Voltage
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM AnalogInput1 NAMED "Register 1-20" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(04); % Modbus command "04h" Read registers
DATA[2] := RWORD(0); % Start address register
DATA[4] := RWORD(20); % Number of registers
ANSWER SIZE 45
DATA[0] = BYTE(Id); % ID
DATA[1] = HEX(04); % Modbus command "04h" Read registers
DATA[2] = BYTE(40); % Byte count
DATA[3] -> RWORD(R1 := DATA;); % 0-8200 l/s
DATA[5] -> RWORD(R2 := DATA;); % 0-8200 l/s
DATA[7] -> RWORD(R3 := DATA;); % 0-8200 l/s
DATA[9] -> RWORD(R4 := DATA;); % 0-8200 l/s
DATA[11] -> RWORD(R5 := DATA;); % 20-750 Pa
DATA[13] -> RWORD(R6 := DATA;); % 20-750 Pa
DATA[15] -> RWORD(R7 := DATA;); % 20-750 Pa
DATA[17] -> RWORD(R8 := DATA;); % 20-750 Pa
DATA[19] -> RWORD(R9 := DATA /100;); % 0-100.00 %
DATA[21] -> RWORD(R10 := DATA /100;); % 0-100.00 %
DATA[23] -> RWORD(R11 := DATA /100;); % 0-100.00 %
DATA[25] -> RWORD(R12 := DATA /100;); % 0-100.00 %
DATA[27] -> RWORD(R13 := DATA /100;); % 0-100.00 %
DATA[29] -> RWORD(R14 := DATA /100;); % 0-100.00 %
DATA[31] -> RWORD(R15 := DATA;); % 0-6500 W
DATA[33] -> RWORD(R16 := DATA;); % 0-6500 W
DATA[35] -> RWORD(R17 := DATA / 10;); % 0.0-9.9 ?
DATA[37] -> RWORD(R18 := DATA /100;); % 0-100.00 Hz
DATA[39] -> RWORD(R19 := DATA /100;); % 0-100.00 Hz
DATA[41] -> RWORD(R20 := DATA;); % 0-500 V
TIMEOUT 2000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for SWEGON GOLD 04-80 read input registers 21-40
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Note! Telegram for reading Analog status
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2008-01-03 inital version
%
DEVICETYPE SwegonAnalog2 NAMED "Swegon analog 2" TYPEID 21202 IS
PARAMETER
Id : "Address";
PUBLIC
R21 : "EA Fan Voltage" ["V"]; %EA Fan Voltage
R22 : "SA Fan Current" ["A"]; %SA Fan Current
R23 : "EA Fan Current" ["A"]; %EA Fan Current
R24 : "SA Pressure" ["Pa"]; %SA Inlet Airflow press.
R25 : "EA Pressure" ["Pa"]; %EA Inlet Airflow press.
R26 : "SA TempSetpoint" ["°C"]; %SA Temp setpoint
R27 : "EA TempSetpoint" ["°C"]; %EA Temp setpoint
R28 : "SA Temperature" ["°C"]; %SA Temp
R29 : "EA RoomTemp" ["°C"]; %EA/Room Temp (internal)
R30 : "OutdoorTemp" ["°C"]; %Outdoor Temp (internal)
R31 : "EA RoomTemp Ext" ["°C"]; %EA/Room Temp (external)
R32 : "OutdoorTemp Ext" ["°C"]; %Outdoor Temp (external)
R33 : "Anti frost Temp" ["°C"]; %Anti frost Temp
R34 : "Temp sensor 3" ["°C"]; %Temp sensor 3
R35 : "Temp sensor 4" ["°C"]; %Temp sensor 4
R36 : "Rotary HX level" ["%"]; %Rotary HX level
R37 : "Reheat level" ["%"]; %Reheat level
R38 : "SA Down level" ["%"]; %SA Down regulation level
R39 : "Extra Seq.level" ["%"]; %Extra reg. sequence level
R40 : "Cooling level" ["%"]; %Cooling level
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM AnalogInput2 NAMED "Register 21-40" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(04); % Modbus command "04h" Read registers
DATA[2] := RWORD(20); % Start address register
DATA[4] := RWORD(20); % Number of registers
ANSWER SIZE 45
DATA[0] = BYTE(Id); % ID
DATA[1] = HEX(04); % Modbus command "04h" Read registers
DATA[2] = BYTE(40); % Byte count
DATA[3] -> RWORD(R21 := DATA;); % 0-500 V
DATA[5] -> RWORD(R22 := DATA / 1000;); % 0-30.000 A
DATA[7] -> RWORD(R23 := DATA / 1000;); % 0-30.000 A
DATA[9] -> RWORD(R24 := DATA;); % 0-2000 Pa
DATA[11] -> RWORD(R25 := DATA;); % 0-2000 Pa
DATA[13] -> RWORD(IF (DATA>=32768) THEN R26:=(DATA-65536)/100; ELSE R26:=DATA/100; ENDIF;); %-55.00-125.00°C
DATA[15] -> RWORD(IF (DATA>=32768) THEN R27:=(DATA-65536)/100; ELSE R27:=DATA/100; ENDIF;); %-55.00-125.00°C
DATA[17] -> RWORD(IF (DATA>=32768) THEN R28:=(DATA-65536)/100; ELSE R28:=DATA/100; ENDIF;); %-55.00-125.00°C
DATA[19] -> RWORD(IF (DATA>=32768) THEN R29:=(DATA-65536)/100; ELSE R29:=DATA/100; ENDIF;); %-55.00-125.00°C
DATA[21] -> RWORD(IF (DATA>=32768) THEN R30:=(DATA-65536)/100; ELSE R30:=DATA/100; ENDIF;); %-55.00-125.00°C
DATA[23] -> RWORD(IF (DATA>=32768) THEN R31:=(DATA-65536)/100; ELSE R31:=DATA/100; ENDIF;); %-55.00-125.00°C
DATA[25] -> RWORD(IF (DATA>=32768) THEN R32:=(DATA-65536)/100; ELSE R32:=DATA/100; ENDIF;); %-55.00-125.00°C
DATA[27] -> RWORD(IF (DATA>=32768) THEN R33:=(DATA-65536)/100; ELSE R33:=DATA/100; ENDIF;); %-55.00-125.00°C
DATA[29] -> RWORD(IF (DATA>=32768) THEN R34:=(DATA-65536)/100; ELSE R34:=DATA/100; ENDIF;); %-55.00-125.00°C
DATA[31] -> RWORD(IF (DATA>=32768) THEN R35:=(DATA-65536)/100; ELSE R35:=DATA/100; ENDIF;); %-55.00-125.00°C
DATA[33] -> RWORD(R36 := DATA / 100;); % 0-100.00 %
DATA[35] -> RWORD(R37 := DATA / 100;); % 0-100.00 %
DATA[37] -> RWORD(R38 := DATA / 100;); % 0-100.00 %
DATA[39] -> RWORD(R39 := DATA / 100;); % 0-100.00 %
DATA[41] -> RWORD(R40 := DATA / 100;); % 0-100.00 %
TIMEOUT 2000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for SWEGON GOLD 04-80 read input registers 41-60
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Note! Telegram for reading Analog status
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2008-01-03 inital version
% History: 2008-08-08 Handels negativ value for register 56 (PW)
%
DEVICETYPE SwegonAnalog3 NAMED "Swegon analog 3" TYPEID 21203 IS
PARAMETER
Id : "Address";
PUBLIC
R41 : "Heat boostLevel" ["%"]; %Heating boost level
R42 : "Cool boostLevel" ["%"]; %Cooling boost level
R43 : "HX pressurLevel" ["Pa"]; %HX press. level
R44 : "HX pressurLimit" ["Pa"]; %HX press. alarm limit
R45 : "HX temperature" ["°C"]; %HX Temp
R46 : "Effect redLevel" ["%"]; %Effect reduction level
R47 : "AF SetpointOper" ["°C"]; %Anti frost temp setpoint/oper
R48 : "AF SetpointStop" ["°C"]; %Anti frost temp setpoint/stop
R49 : "AF Alarm limit" ["°C"]; %Anti frost temp alarm limit
R50 : "SA filt p.level" ["Pa"]; %SA filter press. level
R51 : "SA filt p.limit" ["Pa"]; %SA filter press. alarm limit.
R52 : "SA filt p.lev.n" ["Pa"]; %SA filter press. level, new
R53 : "EA filt p.level" ["Pa"]; %EA filter press. level
R54 : "EA filt p.limit" ["Pa"]; %EA filter press. alarm limit.
R55 : "EA filt p.lev.n" ["Pa"]; %EA filter press. level, new
R56 : "Temp displacem." ["°C"]; %Temp displacement
R57 : "Coil type"; %Coil type
R58 : "Cool step time" ["s"]; %Cool step time
R59 : "Cool res.timeR1" ["s"]; %Cool relay 1 restart time
R60 : "Cool res.timeR2" ["s"]; %Cool relay 2 restart time
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM AnalogInput3 NAMED "Register 41-60" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(04); % Modbus command "04h" Read registers
DATA[2] := RWORD(40); % Start address register
DATA[4] := RWORD(20); % Number of registers
ANSWER SIZE 45
DATA[0] = BYTE(Id); % ID
DATA[1] = HEX(04); % Modbus command "04h" Read registers
DATA[2] = BYTE(40); % Byte count
DATA[3] -> RWORD(R41 := DATA / 100;); % 0-100.00 %
DATA[5] -> RWORD(R42 := DATA / 100;); % 0-100.00 %
DATA[7] -> RWORD(R43 := DATA;); % 0-1000 Pa
DATA[9] -> RWORD(R44 := DATA;); % 0-1000 Pa
DATA[11] -> RWORD(R45 := DATA / 100;); % 0-100.00 °C
DATA[13] -> RWORD(R46 := DATA / 100;); % 0-100.00 %
DATA[15] -> RWORD(R47 := DATA / 100;); % 0-40.00 °C
DATA[17] -> RWORD(R48 := DATA / 100;); % 0-40.00 °C
DATA[19] -> RWORD(R49 := DATA / 100;); % 5.00-30.00 °C
DATA[21] -> RWORD(R50 := DATA;); % 50-300 Pa
DATA[23] -> RWORD(R51 := DATA;); % 50-300 Pa
DATA[25] -> RWORD(R52 := DATA;); % 50-300 Pa
DATA[27] -> RWORD(R53 := DATA;); % 50-300 Pa
DATA[29] -> RWORD(R54 := DATA;); % 50-300 Pa
DATA[31] -> RWORD(R55 := DATA;); % 50-300 Pa
DATA[33] -> RWORD(IF (DATA>=32768) THEN R56:=(DATA-65536)/100; ELSE R56:=DATA/100; ENDIF;); % -5.00-5.00 °C
DATA[35] -> RWORD(R57 := DATA;); % 0-20
DATA[37] -> RWORD(R58 := DATA;); % 0-600 s
DATA[39] -> RWORD(R59 := DATA;); % 0-900 s
DATA[41] -> RWORD(R60 := DATA;); % 0-900 s
TIMEOUT 2000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for SWEGON GOLD 04-80 read input registers 61-80
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Note! Telegram for reading Analog status
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2008-01-03 inital version
%
DEVICETYPE SwegonAnalog4 NAMED "Swegon analog 4" TYPEID 21204 IS
PARAMETER
Id : "Address";
PUBLIC
R61 : "P.ver HMI"; %Progv. HMI (OP)
R62 : "P.ver HMI-slave"; %Progv. HMIslave (extra OP)
R63 : "P.ver Main unit"; %Progv. Ctrl (main unit)
R64 : "P.ver SA FC-1"; %Progv. SA FC-1. (SA freq. conv. 1)
R65 : "P.ver SA FC-2"; %Progv. SA FC-2. (SA freq. conv. 2)
R66 : "P.ver EA FC-1"; %Progv. EA FC-1. (EA freq. conv. 1)
R67 : "P.ver EA FC-2"; %Progv. EA FC-2. (EA freq. conv. 2)
R68 : "P.ver HX unit"; %Progv. HX (control unit)
R69 : "Weekday"; %Weekday
R70 : "Low speed time" ["h"]; %Extended low speed op.
R71 : "Low speed time" ["h"]; %Extended low speed op.
R72 : "High speed time" ["m"]; %Extended high speed op.
R73 : "High speed time" ["m"]; %Extended high speed op.
R74 : "SA Fan time" ["days"]; %SA Fan operation time
R75 : "EA Fan time" ["days"]; %EA Fan operation time
R76 : "Cool time" ["days"]; %Cool operation time
R77 : "HX time" ["days"]; %Heat exchange operation time
R78 : "Reheat time" ["days"]; %Reheat operation time
R79 : "Tripped alarm"; %Present tripped alarm
R80 : "Tripped alarm 1"; %Active not tripped alarm no.1
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM AnalogInput4 NAMED "Register 61-80" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(04); % Modbus command "04h" Read registers
DATA[2] := RWORD(60); % Start address register
DATA[4] := RWORD(20); % Number of registers
ANSWER SIZE 45
DATA[0] = BYTE(Id); % ID
DATA[1] = HEX(04); % Modbus command "04h" Read registers
DATA[2] = BYTE(40); % Byte count
DATA[3] -> RWORD(R61 := DATA / 100;); %0-10.00
DATA[5] -> RWORD(R62 := DATA / 100;); %0-10.00
DATA[7] -> RWORD(R63 := DATA / 100;); %0-10.00
DATA[9] -> RWORD(R64 := DATA / 100;); %0-10.00
DATA[11] -> RWORD(R65 := DATA / 100;); %0-10.00
DATA[13] -> RWORD(R66 := DATA / 100;); %0-10.00
DATA[15] -> RWORD(R67 := DATA / 100;); %0-10.00
DATA[17] -> RWORD(R68 := DATA / 100;); %0-10.00
DATA[19] -> RWORD(R69 := DATA;); %0-6
DATA[21] -> RWORD(R70 := DATA;); %0-23 h
DATA[23] -> RWORD(R71 := DATA;); %0-59 h
DATA[25] -> RWORD(R72 := DATA;); %0-23 m
DATA[27] -> RWORD(R73 := DATA;); %0-59 m
DATA[29] -> RWORD(R74 := DATA;); %0-9999 days
DATA[31] -> RWORD(R75 := DATA;); %0-9999 days
DATA[33] -> RWORD(R76 := DATA;); %0-9999 days
DATA[35] -> RWORD(R77 := DATA;); %0-9999 days
DATA[37] -> RWORD(R78 := DATA;); %0-9999 days
DATA[39] -> RWORD(R79 := DATA;); %0-200
DATA[41] -> RWORD(R80 := DATA;); %0-200
TIMEOUT 2000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for SWEGON GOLD 04-80 read input registers 81-100
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Note! Telegram for reading Analog status
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2008-01-03 inital version
%
DEVICETYPE SwegonAnalog5 NAMED "Swegon analog 5" TYPEID 21205 IS
PARAMETER
Id : "Address";
PUBLIC
R81 : "Tripped alarm 2"; %Active not tripped alarm no.2
R82 : "Tripped alarm 3"; %Active not tripped alarm no.3
R83 : "SA Fan size"; %SA Fan size
R84 : "EA Fan size" ; %EA Fan size
R85 : "OperationMode 1"; %Operation mode 1
R86 : "OperationMode 2"; %Operation mode 2
R87 : "OperationManual"; %Operation mode, manual
R88 : "InputStat 1-16"; %Copy of Input Status 1-16.
R89 : "InputStat 17-32"; %Copy of Input Status 17-32.
R90 : "InputStat 33-48"; %Copy of Input Status 33-48.
R91 : "HX regulator" ["%"]; %HX regulator
R92 : "EA Humidity" ["%"]; %EA-humidity
R93 : "EA HumidityTemp" ["°C"]; %EA-humidity Temp
R94 : "EA Dewpoint" ["°C"]; %EA-dewpoint
R95 : "ColdWater temp" ["°C"]; %Chilled water Temp
R96 : "ColdWater setp" ["°C"]; %Chilled water Temp setpoint
R97 : "ColdWaterOutput" ["%"]; %Chilled water output
R98 : "SA DewpointReg" ["°C"]; %SA-dewpoint regulator
R99 : "SA Humidity" ["%"]; %SA-humidity
R100 : "SA HumidityTemp" ["°C"]; %SA-humidity Temp
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM AnalogInput5 NAMED "Register 81-100" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(04); % Modbus command "04h" Read registers
DATA[2] := RWORD(80); % Start address register
DATA[4] := RWORD(20); % Number of registers
ANSWER SIZE 45
DATA[0] = BYTE(Id); % ID
DATA[1] = HEX(04); % Modbus command "04h" Read registers
DATA[2] = BYTE(40); % Byte count
DATA[3] -> RWORD(R81 := DATA;); %0-200
DATA[5] -> RWORD(R82 := DATA;); %0-200
DATA[7] -> RWORD(R83 := DATA;); %04-80
DATA[9] -> RWORD(R84 := DATA;); %04-80
DATA[11] -> RWORD(R85 := DATA;); %0-18
DATA[13] -> RWORD(R86 := DATA;); %0-22
DATA[15] -> RWORD(R87 := DATA;); %0-3
DATA[17] -> RWORD(R88 := DATA;); %0-65535
DATA[19] -> RWORD(R89 := DATA;); %0-65535
DATA[21] -> RWORD(R90 := DATA;); %0-65535
DATA[23] -> RWORD(R91 := DATA / 100;); %0-100.00 %
DATA[25] -> RWORD(R92 := DATA / 100;); %0-100.00 %
DATA[27] -> RWORD(IF (DATA>=32768) THEN R93:=(DATA-65536)/100; ELSE R93:=DATA/100; ENDIF;); %-55.00-125.00°C
DATA[29] -> RWORD(IF (DATA>=32768) THEN R94:=(DATA-65536)/100; ELSE R94:=DATA/100; ENDIF;); %-55.00-125.00°C
DATA[31] -> RWORD(IF (DATA>=32768) THEN R95:=(DATA-65536)/100; ELSE R95:=DATA/100; ENDIF;); %-55.00-125.00°C
DATA[33] -> RWORD(IF (DATA>=32768) THEN R96:=(DATA-65536)/100; ELSE R96:=DATA/100; ENDIF;); %-55.00-125.00°C
DATA[35] -> RWORD(R97 := DATA / 100;); %0-100.00 %
DATA[37] -> RWORD(IF (DATA>=32768) THEN R98:=(DATA-65536)/100; ELSE R98:=DATA/100; ENDIF;); %-55.00-125.00°C
DATA[39] -> RWORD(R99 := DATA / 100;); %0-100.00 %
DATA[41] -> RWORD(IF (DATA>=32768) THEN R100:=(DATA-65536)/100; ELSE R100:=DATA/100; ENDIF;); %-55.00-125.00°C
TIMEOUT 2000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for SWEGON GOLD 04-80 read input registers 101-120
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Note! Telegram for reading Analog status
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2008-01-03 inital version
%
DEVICETYPE SwegonAnalog6 NAMED "Swegon analog 6" TYPEID 21206 IS
PARAMETER
Id : "Address";
PUBLIC
R101 : "SA Dewpoint" ["°C"]; %SA-dewpoint
R102 : "HX Coil Temp" ["°C"]; %Coil HX. Temp
R103 : "HX Plate Temp 1" ["°C"]; %P.HX. Temp 1 (plate )
R104 : "HX Plate Temp 2" ["°C"]; %P.HX. Temp 2 (plate )
R105 : "HX P/C Humidity" ["%"]; %P/C.HX. Humidity (plate/coil)
R106 : "HX R.Efficiency" ["%"]; %R.HX. efficiency (rotary )
R107 : "HX Coil Valve" ["%"]; %C.HX. Valve output (coil HX)
R108 : "HX Plate bypass" ["%"]; %P.HX bypass output
R109 : "SA pref p.level" ["Pa"]; %SA prefilter press. level
R110 : "SA pref p.limit" ["Pa"]; %SA prefilter press. alarm lim
R111 : "SA pref p.lev.n" ["Pa"]; %SA prefilter press. level new
R112 : "EA pref p.level" ["Pa"]; %EA prefilter press. level
R113 : "EA pref p.limit" ["Pa"]; %EA prefilter press. alarm lim
R114 : "EA pref p.lev.n" ["Pa"]; %EA prefilter press. level new
R115 : "XZ reheat level" ["%"]; %Xzone reheat level
R116 : "XZ AF temp" ["°C"]; %Xzone anti frost Temp
R117 : "XZ CoolLevel" ["%"]; %Xzone cooling level
R118 : "XZ CoolStepTime" ["s"]; %Xzone cool step time
R119 : "XZ CoolResTime1" ["s"]; %Xzone cool relay 1 restart time
R120 : "XZ CoolResTime2" ["s"]; %Xzone cool relay 2 restart time
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM AnalogInput6 NAMED "Register101-120" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(04); % Modbus command "04h" Read registers
DATA[2] := RWORD(100); % Start address register
DATA[4] := RWORD(20); % Number of registers
ANSWER SIZE 45
DATA[0] = BYTE(Id); % ID
DATA[1] = HEX(04); % Modbus command "04h" Read registers
DATA[2] = BYTE(40); % Byte count
DATA[3] -> RWORD(IF (DATA>=32768) THEN R101:=(DATA-65536)/100; ELSE R101:=DATA/100; ENDIF;); %-55.00-125.00°C
DATA[5] -> RWORD(IF (DATA>=32768) THEN R102:=(DATA-65536)/100; ELSE R102:=DATA/100; ENDIF;); %-55.00-125.00°C
DATA[7] -> RWORD(IF (DATA>=32768) THEN R103:=(DATA-65536)/100; ELSE R103:=DATA/100; ENDIF;); %-55.00-125.00°C
DATA[9] -> RWORD(IF (DATA>=32768) THEN R104:=(DATA-65536)/100; ELSE R104:=DATA/100; ENDIF;); %-55.00-125.00°C
DATA[11] -> RWORD(R105 := DATA / 100;); %0-100.00 %
DATA[13] -> RWORD(R106 := DATA / 100;); %0-100.00 %
DATA[15] -> RWORD(R107 := DATA / 100;); %0-100.00 %
DATA[17] -> RWORD(R108 := DATA;); %0-100 %
DATA[19] -> RWORD(R109 := DATA;); %50-300 Pa
DATA[21] -> RWORD(R110 := DATA;); %50-300 Pa
DATA[23] -> RWORD(R111 := DATA;); %50-300 Pa
DATA[25] -> RWORD(R112 := DATA;); %50-300 Pa
DATA[27] -> RWORD(R113 := DATA;); %50-300 Pa
DATA[29] -> RWORD(R114 := DATA;); %50-300 Pa
DATA[31] -> RWORD(R115 := DATA / 100;); %0-100.00 %
DATA[33] -> RWORD(IF (DATA>=32768) THEN R116:=(DATA-65536)/100; ELSE R116:=DATA/100; ENDIF;); %-55.00-125.00°C
DATA[35] -> RWORD(R117 := DATA / 100;); %0-100.00 %
DATA[37] -> RWORD(R118 := DATA;); %0-600 s
DATA[39] -> RWORD(R119 := DATA;); %0-900 s
DATA[41] -> RWORD(R120 := DATA;); %0-900 s
TIMEOUT 2000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for SWEGON GOLD 04-80 read input registers 121-136
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Note! Telegram for reading Analog status
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2008-01-03 inital version
%
DEVICETYPE SwegonAnalog7 NAMED "Swegon analog 7" TYPEID 21207 IS
PARAMETER
Id : "Address";
PUBLIC
R121 : "XZ SA TempReg" ["°C"]; %Xzone SA Temp regulator
R122 : "XZ EA TempReg" ["°C"]; %Xzone EA Temp regulator
R123 : "XZ SA Temp" ["°C"]; %Xzone SA Temp
R124 : "XZ EA/Room temp" ["°C"]; %Xzone EA/Room Temp
R125 : "PreHeat temp" ["°C"]; %Pre-heating air Temp
R126 : "PreHeat templev" ["%"]; %Pre-heating level
R127 : "PreHeat AF temp" ["°C"]; %Pre-heating anti frost Temp
R128 : "ReCO2 input" ["%"]; %ReCO2 CO2 input
R129 : "ReCO2 IntDamper" ["%"]; %ReCO2 internal damper outp
R130 : "ReCO2 ExtDamper" ["%"]; %ReCO2 external damper outp
R131 : "ReCO2 OAFlow" ["l/s"]; %ReCO2 outdoor airflow
R132 : "ReCO2 OAF.Setp." ["l/s"]; %ReCO2 outdoor airflow setp.
R133 : "ReCO2 OAPressur" ["Pa"]; %ReCO2 outdoor airflow press.
R134 : "Preheat time" ["days"]; %Preheat operation time
R135 : "XZ Cool time" ["days"]; %Xzone cool operation time
R136 : "XZ Reheat time" ["days"]; %Xzone reheat operation time
%% Added 100330 PW
R137 : "SA-D temp" ["°C"]; %SA-D temp
R138 : "EA-D temp" ["°C"]; %EA-D temp
R139 : "AYC heat temp" ["°C"]; %AYC heat temp
R140 : "AYC heat Setp." ["°C"]; %AYC heat setpoint
%R141 : "AYC heat Valve" ["%"]; %AYC heat valve output
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM AnalogInput7 NAMED "Register121-141" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(04); % Modbus command "04h" Read registers
DATA[2] := RWORD(120); % Start address register
DATA[4] := RWORD(21); % Number of registers 100330
ANSWER SIZE 47
DATA[0] = BYTE(Id); % ID
DATA[1] = HEX(04); % Modbus command "04h" Read registers
DATA[2] = BYTE(42); % Byte count 100330
DATA[3] -> RWORD(IF (DATA>=32768) THEN R121:=(DATA-65536)/100; ELSE R121:=DATA/100; ENDIF;); %-55.00-125.00°C
DATA[5] -> RWORD(IF (DATA>=32768) THEN R122:=(DATA-65536)/100; ELSE R122:=DATA/100; ENDIF;); %-55.00-125.00°C
DATA[7] -> RWORD(IF (DATA>=32768) THEN R123:=(DATA-65536)/100; ELSE R123:=DATA/100; ENDIF;); %-55.00-125.00°C
DATA[9] -> RWORD(IF (DATA>=32768) THEN R124:=(DATA-65536)/100; ELSE R124:=DATA/100; ENDIF;); %-55.00-125.00°C
DATA[11] -> RWORD(IF (DATA>=32768) THEN R125:=(DATA-65536)/100; ELSE R125:=DATA/100; ENDIF;); %-55.00-125.00°C
DATA[13] -> RWORD(R126 := DATA / 100;); %0-100.00 %
DATA[15] -> RWORD(IF (DATA>=32768) THEN R127:=(DATA-65536)/100; ELSE R127:=DATA/100; ENDIF;); %-55.00-125.00°C
DATA[17] -> RWORD(R128 := DATA / 100;); %0-100.00 %
DATA[19] -> RWORD(R129 := DATA / 100;); %0-100.00 %
DATA[21] -> RWORD(R130 := DATA / 100;); %0-100.00 %
DATA[23] -> RWORD(R131 := DATA;); %0-8200 l/s
DATA[25] -> RWORD(R132 := DATA;); %0-8200 l/s
DATA[27] -> RWORD(R133 := DATA;); %0-2000 Pa
DATA[29] -> RWORD(R134 := DATA;); %0-9999 days
DATA[31] -> RWORD(R135 := DATA;); %0-9999 days
DATA[33] -> RWORD(R136 := DATA;); %0-9999 days
% Added 100330
DATA[35] -> RWORD(IF (DATA>=32768) THEN R137:=(DATA-65536)/100; ELSE R137:=DATA/100; ENDIF;); %-55.00-125.00°C PV 5.07
DATA[37] -> RWORD(IF (DATA>=32768) THEN R138:=(DATA-65536)/100; ELSE R138:=DATA/100; ENDIF;); %-55.00-125.00°C PV 5.07
DATA[39] -> RWORD(IF (DATA>=32768) THEN R139:=(DATA-65536)/100; ELSE R139:=DATA/100; ENDIF;); %-55.00-125.00°C PV 5.07
DATA[41] -> RWORD(IF (DATA>=32768) THEN R140:=(DATA-65536)/100; ELSE R140:=DATA/100; ENDIF;); %-55.00-125.00°C PV 5.07
%DATA[43] -> RWORD(IF (DATA>=32768) THEN R141:=(DATA-65536)/100; ELSE R141:=DATA/100; ENDIF;); % 0-100.00% PV 5.07
TIMEOUT 2000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for SWEGON GOLD 04-80 read digital inputs 1-20
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Note! Telegram for reading digital inputs
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2008-01-03 inital version
%
DEVICETYPE SwegonDigital1 NAMED "Swegon DI 1" TYPEID 21208 IS
PARAMETER
Id : "Address";
PUBLIC
DI1 : "Heat relay"; %Heat relay output
DI2 : "Cool relay 1"; %Cool relay output 1
DI3 : "Cool relay 2"; %Cool relay output 2
DI4 : "Fan low speed"; %Low speed relay output
DI5 : "Fan high speed"; %High speed relay output
DI6 : "A-alarm relay"; %A-alarm relay
DI7 : "B-alarm relay"; %B-alarm relay
DI8 : "Operation relay"; %Operation relay output
DI9 : "Damper relay"; %Damper relay output
DI10 : "Ind. Low speed"; %External low speed input
DI11 : "Ind. High speed"; %External high speed input
DI12 : "Ind. Alarm 1"; %External alarm 1 input
DI13 : "Ind. Alarm 2"; %External alarm 2 input
DI14 : "Ind. Fire alarm"; %External fire alarm input.
DI15 : "Ind. Stop input"; %External stop input
DI16 : "DIP Switch 1"; %DIP Switch 1
DI17 : "DIP Switch 2"; %DIP Switch 2
DI18 : "DIP Switch 3"; %DIP Switch 3
DI19 : "DIP Switch 4"; %DIP Switch 4
DI20 : "DIP Switch 5"; %DIP Switch 5
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM DigitalInput1 NAMED "DI 1-20" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(02); % Modbus command "02h" read discrete input (bit)
DATA[2] := RWORD(0); % Start adress
DATA[4] := RWORD(20); % Number of inputs
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = HEX(02);
DATA[2] = BYTE(3);
DATA[3] -> BYTE(IF (DATA & 1) THEN DI1 := 1; ELSE DI1 := 0; ENDIF;
IF (DATA & 2) THEN DI2 := 1; ELSE DI2 := 0; ENDIF;
IF (DATA & 4) THEN DI3 := 1; ELSE DI3 := 0; ENDIF;
IF (DATA & 8) THEN DI4 := 1; ELSE DI4 := 0; ENDIF;
IF (DATA & 16) THEN DI5 := 1; ELSE DI5 := 0; ENDIF;
IF (DATA & 32) THEN DI6 := 1; ELSE DI6 := 0; ENDIF;
IF (DATA & 64) THEN DI7 := 1; ELSE DI7 := 0; ENDIF;
IF (DATA & 128) THEN DI8 := 1; ELSE DI8 := 0; ENDIF;
);
DATA[4] -> BYTE(IF (DATA & 1) THEN DI9 := 1; ELSE DI9 := 0; ENDIF;
IF (DATA & 2) THEN DI10:= 1; ELSE DI10:= 0; ENDIF;
IF (DATA & 4) THEN DI11:= 1; ELSE DI11:= 0; ENDIF;
IF (DATA & 8) THEN DI12:= 1; ELSE DI12:= 0; ENDIF;
IF (DATA & 16) THEN DI13:= 1; ELSE DI13:= 0; ENDIF;
IF (DATA & 32) THEN DI14:= 1; ELSE DI14:= 0; ENDIF;
IF (DATA & 64) THEN DI15:= 1; ELSE DI15:= 0; ENDIF;
IF (DATA & 128) THEN DI16:= 1; ELSE DI16:= 0; ENDIF;
);
DATA[5] -> BYTE(IF (DATA & 1) THEN DI17:= 1; ELSE DI17:= 0; ENDIF;
IF (DATA & 2) THEN DI18:= 1; ELSE DI18:= 0; ENDIF;
IF (DATA & 4) THEN DI19:= 1; ELSE DI19:= 0; ENDIF;
IF (DATA & 8) THEN DI20:= 1; ELSE DI20:= 0; ENDIF;
);
TIMEOUT 2000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for SWEGON GOLD 04-80 read digital inputs 21-40
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Note! Telegram for reading digital inputs
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2008-01-03 inital version
%
DEVICETYPE SwegonDigital2 NAMED "Swegon DI 2" TYPEID 21209 IS
PARAMETER
Id : "Address";
PUBLIC
DI21 : "DIP Switch 6"; %DIP Switch 6
DI22 : "Reserve 1"; %Reserve 1
DI23 : "Reserve 2"; %Reserve 2
DI24 : "Heat exch. pump"; %(C.HX.) HX pump output
DI25 : "Heat exch. rot."; %(R.HX.) Rotation status
DI26 : "Xzone heat rel."; %Xzone heat relay output
DI27 : "Xzone cool R1"; %Xzone cool relay output 1
DI28 : "Xzone cool R2"; %Xzone cool relay output 2
DI29 : "Pre-heat relay"; %Pre-heat relay output
DI30 : "Reserve 9"; %Reserve 9
DI31 : "Reserve 10"; %Reserve 10
DI32 : "Reserve 11"; %Reserve 11
DI33 : "Reserve 12"; %Reserve 12
DI34 : "Reserve 13"; %Reserve 13
DI35 : "Reserve 14"; %Reserve 14
DI36 : "Reserve 15"; %Reserve 15
DI37 : "Reserve 16"; %Reserve 16
DI38 : "Reserve 17"; %Reserve 17
DI39 : "Reserve 18"; %Reserve 18
DI40 : "Reserve 19"; %Reserve 19
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM DigitalInput2 NAMED "DI 21-40" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(02); % Modbus command "02h" read discrete input (bit)
DATA[2] := RWORD(20); % Start adress
DATA[4] := RWORD(20); % Number of inputs
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = HEX(02);
DATA[2] = BYTE(3);
DATA[3] -> BYTE(IF (DATA & 1) THEN DI21:= 1; ELSE DI21:= 0; ENDIF;
IF (DATA & 2) THEN DI22:= 1; ELSE DI22:= 0; ENDIF;
IF (DATA & 4) THEN DI23:= 1; ELSE DI23:= 0; ENDIF;
IF (DATA & 8) THEN DI24:= 1; ELSE DI24:= 0; ENDIF;
IF (DATA & 16) THEN DI25:= 1; ELSE DI25:= 0; ENDIF;
IF (DATA & 32) THEN DI26:= 1; ELSE DI26:= 0; ENDIF;
IF (DATA & 64) THEN DI27:= 1; ELSE DI27:= 0; ENDIF;
IF (DATA & 128) THEN DI28:= 1; ELSE DI28:= 0; ENDIF;
);
DATA[4] -> BYTE(IF (DATA & 1) THEN DI29:= 1; ELSE DI29:= 0; ENDIF;
IF (DATA & 2) THEN DI30:= 1; ELSE DI30:= 0; ENDIF;
IF (DATA & 4) THEN DI31:= 1; ELSE DI31:= 0; ENDIF;
IF (DATA & 8) THEN DI32:= 1; ELSE DI32:= 0; ENDIF;
IF (DATA & 16) THEN DI33:= 1; ELSE DI33:= 0; ENDIF;
IF (DATA & 32) THEN DI34:= 1; ELSE DI34:= 0; ENDIF;
IF (DATA & 64) THEN DI35:= 1; ELSE DI35:= 0; ENDIF;
IF (DATA & 128) THEN DI36:= 1; ELSE DI36:= 0; ENDIF;
);
DATA[5] -> BYTE(IF (DATA & 1) THEN DI37:= 1; ELSE DI37:= 0; ENDIF;
IF (DATA & 2) THEN DI38:= 1; ELSE DI38:= 0; ENDIF;
IF (DATA & 4) THEN DI39:= 1; ELSE DI39:= 0; ENDIF;
IF (DATA & 8) THEN DI40:= 1; ELSE DI40:= 0; ENDIF;
);
TIMEOUT 2000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for SWEGON GOLD 04-80 read digital inputs 41-51
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Note! Telegram for reading digital inputs
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2008-01-03 inital version
%
DEVICETYPE SwegonDigital3 NAMED "Swegon DI 3" TYPEID 21210 IS
PARAMETER
Id : "Address";
PUBLIC
DI41 : "Reserve 20"; %Reserve 20 1x0041
DI42 : "Reserve 21"; %Reserve 21 1x0042
DI43 : "Reserve 22"; %Reserve 22 1x0043
DI44 : "Reserve 23"; %Reserve 23 1x0044
DI45 : "Reserve 24"; %Reserve 24 1x0045
DI46 : "Reserve 25"; %Reserve 25 1x0046
DI47 : "Reserve 26"; %Reserve 26 1x0047
DI48 : "Reserve 27"; %Reserve 27 1x0048
DI49 : "Status alarm 1"; %Status alarm number 1 1x0049
DI50 : "Status alarm 2"; %Status alarm number 2 1x0050
DI51 : "Status alarm 3"; %Status alarm number 3 1x0051
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM DigitalInput3 NAMED "DI 41-51" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(02); % Modbus command "02h" read discrete input (bit)
DATA[2] := RWORD(40); % Start adress
DATA[4] := RWORD(11); % Number of inputs
ANSWER SIZE 7
DATA[0] = BYTE(Id);
DATA[1] = HEX(02);
DATA[2] = BYTE(2);
DATA[3] -> BYTE(IF (DATA & 1) THEN DI41:= 1; ELSE DI41:= 0; ENDIF;
IF (DATA & 2) THEN DI42:= 1; ELSE DI42:= 0; ENDIF;
IF (DATA & 4) THEN DI43:= 1; ELSE DI43:= 0; ENDIF;
IF (DATA & 8) THEN DI44:= 1; ELSE DI44:= 0; ENDIF;
IF (DATA & 16) THEN DI45:= 1; ELSE DI45:= 0; ENDIF;
IF (DATA & 32) THEN DI46:= 1; ELSE DI46:= 0; ENDIF;
IF (DATA & 64) THEN DI47:= 1; ELSE DI47:= 0; ENDIF;
IF (DATA & 128) THEN DI48:= 1; ELSE DI48:= 0; ENDIF;
);
DATA[4] -> BYTE(IF (DATA & 1) THEN DI49:= 1; ELSE DI49:= 0; ENDIF;
IF (DATA & 2) THEN DI50:= 1; ELSE DI50:= 0; ENDIF;
IF (DATA & 4) THEN DI51:= 1; ELSE DI51:= 0; ENDIF;
);
TIMEOUT 2000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for SWEGON GOLD 04-80 read digital inputs 248-251
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Note! Telegram for reading digital inputs
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2008-01-03 inital version
%
DEVICETYPE SwegonDigital4 NAMED "Swegon DI 4" TYPEID 21211 IS
PARAMETER
Id : "Address";
PUBLIC
DI248 : "Status al. 200"; %Status alarm number 200
DI249 : "Status info 1"; %Status info number 1
DI250 : "Status info 2"; %Status info number 2
DI251 : "Status info 3"; %Status info number 3
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM DigitalInput4 NAMED "DI 248-251" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(02); % Modbus command "02h" read discrete input (bit)
DATA[2] := RWORD(247); % Start adress
DATA[4] := RWORD(4); % Number of inputs
ANSWER SIZE 6
DATA[0] = BYTE(Id);
DATA[1] = HEX(02);
DATA[2] = BYTE(1);
DATA[3] -> BYTE(IF (DATA & 1) THEN DI248 := 1; ELSE DI248 := 0; ENDIF;
IF (DATA & 2) THEN DI249 := 1; ELSE DI249 := 0; ENDIF;
IF (DATA & 4) THEN DI250 := 1; ELSE DI250 := 0; ENDIF;
IF (DATA & 8) THEN DI251 := 1; ELSE DI251 := 0; ENDIF;
);
TIMEOUT 2000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for SWEGON GOLD 04-80 read digital input 348
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Note! Telegram for reading digital inputs
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2008-01-03 inital version
% History: 2008-08-08 Answer size changed from 8 to 6 PW
%
DEVICETYPE SwegonDigital5 NAMED "Swegon DI 5" TYPEID 21212 IS
PARAMETER
Id : "Address";
PUBLIC
DI348 : "Status info 100"; %Status info number 100 1x0348
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM DigitalInput5 NAMED "DI 348" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(02); % Modbus command "02h" read discrete input (bit)
DATA[2] := RWORD(347); % Start adress
DATA[4] := RWORD(1); % Number of inputs
ANSWER SIZE 6
DATA[0] = BYTE(Id);
DATA[1] = HEX(02);
DATA[2] = BYTE(1);
DATA[3] -> BYTE(IF (DATA & 1) THEN DI348 := 1; ELSE DI348 := 0; ENDIF;
);
TIMEOUT 2000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for SWEGON GOLD 04-80 set register value
%
% Settings module: Parity:None, Baud:9600, Mode:RTU
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2010-04-09 inital version
%
DEVICETYPE SwegonSettings NAMED "Swegon settings" TYPEID 21219 IS
PARAMETER
Id : "Address";
% Jag vill ställa börvärde för frånluft.
% Börvärde flöde lågfart tilluft,
% Börvärde flöde högfart tilluft,
% Börvärde flöde lågfart frånluft,
% Börvärde flöde högfart frånluft.
%R001 : "SA Flow Setp.L" ["l/s"]; % 4x0001 SA Low speed airflow setpoint 0-8200l/s
%R002 : "SA Flow Setp.H" ["l/s"]; % 4x0002 SA High speed airflow setpoint 0-8200l/s
%R005 : "EA Flow Setp.L" ["l/s"]; % 4x0005 EA Low speed airflow setpoint 0-8200l/s
%R006 : "EA Flow Setp.H" ["l/s"]; % 4x0006 EA High speed airflow setpoint 0-8200l/s
%R009 : "SA Press Setp.L"["Pa"]; % 4x0009 SA Low speed pressure setpoint 20-750Pa
%R010 : "SA Press Setp.H"["Pa"]; % 4x0010 SA High speed pressure setpoint 20-750Pa
%R013 : "EA Press Setp.L"["Pa"]; % 4x0013 EA Low speed pressure setpoint 20-750Pa
%R014 : "EA Press Setp.H"["Pa"]; % 4x0014 EA High speed pressure setpoint 20-750Pa
R175 : "Operation mode" [""]; % Communication operation mode 0 - 4 PV 5.00
% Setting of unit operation mode from communication.
% 0=Auto operation,
% 1=Communication Stop 1,
% 2=Communication Low speed,
% 3=Communication High speed.
% 4=Communication Stop 2 (New in PV 5.00)
% Summer night cooling, intermittent night heat and
% morning boost functions operates at stop 2.
%R041 : "SA TempSP" ["°C"]; % Supply air temperature setting 10.00-40.00°C
R322 : "Xzone SA TempSP"["°C"]; % Xzone supply air temperature setting 10.00-40.00°C PV 5.00
PUBLIC
PRIVATE
Cnt;
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM Settings1 NAMED "Setvalues" 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; %Ändra villkoret beroende på antal register x
%att ställa. Skriv "Cnt>x"
% Adress=Register-1
IF Cnt=0 THEN DATA := 174; %Register = 175
ELSIF Cnt=1 THEN DATA := 321; %Register = 322
%ELSIF Cnt=2 THEN DATA := 40; %Register = 41
%ELSIF Cnt=3 THEN DATA := 321; %Register = 322
%ELSIF Cnt=4 THEN DATA := 9; %Register = 10
%ELSIF Cnt=5 THEN DATA := 13; %Register = 14
%ELSIF Cnt=6 THEN DATA := 40; %Register = 41
%ELSIF Cnt=7 THEN DATA := 321; %Register = 322
%ELSIF Cnt=8 THEN DATA := 9; %Register = 10
ENDIF;
);
DATA[4] <- RWORD(
IF Cnt=0 THEN
IF R175<0 THEN DATA := 0; % Operation mode 0-4
ELSIF R175>4 THEN DATA := 0;
ELSE DATA := R175;
ENDIF;
ELSIF Cnt=1 THEN
IF R322<10 THEN DATA := 1000; % 10.00-40.00°C
ELSIF R322>40 THEN DATA := 4000;
ELSE DATA := R322*100;
ENDIF;
%ELSIF Cnt=2 THEN
% IF R041<10 THEN DATA := 1000; % 10.00-40.00°C
% ELSIF R041>40 THEN DATA := 4000;
% ELSE DATA := R041*100;
% ENDIF;
%ELSIF Cnt=3 THEN
% IF R322<10 THEN DATA := 1000; % 10.00-40.00°C
% ELSIF R322>40 THEN DATA := 4000;
% ELSE DATA := R322*100;
% ENDIF;
%ELSIF Cnt=4 THEN
% IF R010<20 THEN DATA := 20; % 20-750Pa
% ELSIF R010>750 THEN DATA := 750;
% ELSE DATA := R010;
% ENDIF;
%ELSIF Cnt=5 THEN
% IF R014<20 THEN DATA := 20; % 20-750Pa
% ELSIF R014>750 THEN DATA := 750;
% ELSE DATA := R014;
% ENDIF;
%ELSIF Cnt=6 THEN
% IF R041<10 THEN DATA := 1000; % 10.00-40.00°C
% ELSIF R041>40 THEN DATA := 4000;
% ELSE DATA := R041*100;
% ENDIF;
%ELSIF Cnt=7 THEN
% IF R322<10 THEN DATA := 1000; % 10.00-40.00°C
% ELSIF R322>40 THEN DATA := 4000;
% ELSE DATA := R322*100;
% ENDIF;
%ELSIF Cnt=8 THEN
% IF R010<20 THEN DATA := 20; % 20-750Pa
% ELSIF R010>750 THEN DATA := 750;
% ELSE DATA := R010;
% ENDIF;
ENDIF;
);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = HEX(06);
TIMEOUT 2000
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.