Siemens Climatix
Detaljer
- Typ
- Drivrutin
- Upplaggd av
- Ove Jansson, Abelko Innovation
- Version
- 1
- Uppdaterad
- 2013-05-12
- Skapad
- 2013-04-06
- Kategori
- Modbus, Ventilation
- Visningar
- 2184
Beskrivning
Device definition for Climatix, Digital inputs, Indikation/Alarm inputs, Digital outputs, Analog inputs och Analog settings
Bruksanvisning
Kvittera genom att öka kanalvärdet kopplat till "Kvittering". Om man har en checkbox (kryssruta) för att utföra kvittering går det kanske att koppla en logisk funktion som efter viss timeout ställer tillbaka kvitteringskanalen (och checkboxen). Den timeouten måste anpassas efter skriptets ställda uppdateringstid.
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 Climatrix, Digital inputs
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2010-08-18 inital version
%
DEVICETYPE ClimatrixDigital NAMED "Climatrix Dig.1" TYPEID 21380 IS
PARAMETER
Id : "Adress";
PUBLIC
D1 : "DangerAlarm(A)" ;
D2 : "CriticAlarm(A)" ;
D3 : "LowAlarm(B)" ;
D4 : "WarningAlarm(C)";
D5 : "ManualMode" ;
D6 : "ComTestPuls" ;
D11 : "EmergencyStop" ;
D12 : "Ext.Input1" ;
D13 : "Ext.Input2" ;
D14 : "Summer/Winter" ;
D15 : "Aux.Input" ;
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM DigitalInput NAMED "Läs Status 1-19" 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 (1-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(02);
%DATA[2] = BYTE(3);
DATA[3] -> BYTE(
IF (DATA & 1) THEN D1 := 1; ELSE D1 := 0; ENDIF;
IF (DATA & 2) THEN D2 := 1; ELSE D2 := 0; ENDIF;
IF (DATA & 4) THEN D3 := 1; ELSE D3 := 0; ENDIF;
IF (DATA & 8) THEN D4 := 1; ELSE D4 := 0; ENDIF;
IF (DATA & 16) THEN D5 := 1; ELSE D5 := 0; ENDIF;
IF (DATA & 32) THEN D6 := 1; ELSE D6 := 0; ENDIF;
% IF (DATA & 64) THEN D7 := 1; ELSE D7 := 0; ENDIF;
% IF (DATA & 128) THEN D8 := 1; ELSE D8 := 0; ENDIF;
);
DATA[4] -> BYTE(
% IF (DATA & 1) THEN D9 := 1; ELSE D9 := 0; ENDIF;
% IF (DATA & 2) THEN D10:= 1; ELSE D10:= 0; ENDIF;
IF (DATA & 4) THEN D11:= 1; ELSE D11:= 0; ENDIF;
IF (DATA & 8) THEN D12:= 1; ELSE D12:= 0; ENDIF;
IF (DATA & 16) THEN D13:= 1; ELSE D13:= 0; ENDIF;
IF (DATA & 32) THEN D14:= 1; ELSE D14:= 0; ENDIF;
IF (DATA & 64) THEN D15:= 1; ELSE D15:= 0; ENDIF;
% IF (DATA & 128) THEN D16:= 1; ELSE D16:= 0; ENDIF;
);
%DATA[5] -> BYTE(
% IF (DATA & 1) THEN D17:= 1; ELSE D17:= 0; ENDIF;
% IF (DATA & 2) THEN D18:= 1; ELSE D18:= 0; ENDIF;
% IF (DATA & 4) THEN D19:= 1; ELSE D19:= 0; ENDIF;
% IF (DATA & 8) THEN D20:= 1; ELSE D20:= 0; ENDIF;
% );
TIMEOUT 1000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for Climatrix, Indikation/Alarm inputs
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2010-08-18 initial version
%
DEVICETYPE ClimatrixAlarm NAMED "Climatrix Dig.2" TYPEID 21381 IS
PARAMETER
Id : "Adress";
PUBLIC
AL20 : "OutAirDamper" ;
AL21 : "ExtracAirDamper" ;
AL22 : "FireDamperClose" ;
AL23 : "FireDamperOpen" ;
AL24 : "FireDamperNoMov" ;
%AL25 : "" ;
AL26 : "FanAlarm" ;
AL27 : "SupplyFanAlarm" ;
AL28 : "SupplyFanFeedb." ;
AL29 : "SupplyFanDevia." ;
AL30 : "ExhaustFanAlarm" ;
AL31 : "ExhaustFanFeedb" ;
AL32 : "ExhaustFanDevia" ;
AL33 : "FanOperat.Hours" ;
%AL34 : "" ;
%AL35 : "" ;
AL36 : "CoolDXAlarm" ;
AL37 : "CoolDXFeedb." ;
AL38 : "CoolPumpAlarm" ;
AL39 : "CoolPumpFeedb." ;
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM DigitalAlarm NAMED "Läs Larm 20-39" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(02); % Modbus command "02h" read discrete input (bit)
DATA[2] := RWORD(19); % Start adress (20-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(02);
%DATA[2] = BYTE(3);
DATA[3] -> BYTE(
IF (DATA & 1) THEN AL20:= 1; ELSE AL20:= 0; ENDIF;
IF (DATA & 2) THEN AL21:= 1; ELSE AL21:= 0; ENDIF;
IF (DATA & 4) THEN AL22:= 1; ELSE AL22:= 0; ENDIF;
IF (DATA & 8) THEN AL23:= 1; ELSE AL23:= 0; ENDIF;
IF (DATA & 16) THEN AL24:= 1; ELSE AL24:= 0; ENDIF;
% IF (DATA & 32) THEN AL25:= 1; ELSE AL25:= 0; ENDIF;
IF (DATA & 64) THEN AL26:= 1; ELSE AL26:= 0; ENDIF;
IF (DATA & 128) THEN AL27:= 1; ELSE AL27:= 0; ENDIF;
);
DATA[4] -> BYTE(
IF (DATA & 1) THEN AL28:= 1; ELSE AL28:= 0; ENDIF;
IF (DATA & 2) THEN AL29:= 1; ELSE AL29:= 0; ENDIF;
IF (DATA & 4) THEN AL30:= 1; ELSE AL30:= 0; ENDIF;
IF (DATA & 8) THEN AL31:= 1; ELSE AL31:= 0; ENDIF;
IF (DATA & 16) THEN AL32:= 1; ELSE AL32:= 0; ENDIF;
IF (DATA & 32) THEN AL33:= 1; ELSE AL33:= 0; ENDIF;
% IF (DATA & 64) THEN AL34:= 1; ELSE AL34:= 0; ENDIF;
% IF (DATA & 128) THEN AL35:= 1; ELSE AL35:= 0; ENDIF;
);
DATA[5] -> BYTE(
IF (DATA & 1) THEN AL36:= 1; ELSE AL36:= 0; ENDIF;
IF (DATA & 2) THEN AL37:= 1; ELSE AL37:= 0; ENDIF;
IF (DATA & 4) THEN AL38:= 1; ELSE AL38:= 0; ENDIF;
IF (DATA & 8) THEN AL39:= 1; ELSE AL39:= 0; ENDIF;
);
TIMEOUT 1000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for Climatrix, Indikation/Alarm inputs
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2010-08-18 initial version
%
DEVICETYPE ClimatrixAlarm NAMED "Climatrix Dig.3" TYPEID 21382 IS
PARAMETER
Id : "Adress";
PUBLIC
AL40 : "HeatRecAlarm" ;
AL41 : "HeatRecPumpAlar" ;
AL42 : "HeatRecPumpFeed" ;
AL43 : "HeatRecFrostMon" ;
AL44 : "HeatRecEffAlarm" ;
AL45 : "HeatPumpAlarm" ;
AL46 : "HeatPumpFeedb." ;
AL47 : "HeatFrostMonito" ;
AL48 : "Elec.HeatAlarm" ;
AL49 : "Cool2DXAlarm" ;
AL50 : "Cool2DXFeedb." ;
AL51 : "Cool2PumpAlarm" ;
AL52 : "Cool2PumpFeedb." ;
AL53 : "Heat2PumpAlarm" ;
AL54 : "Heat2PumpFeedb." ;
AL55 : "Heat2FrostMon." ;
AL56 : "Elec.Heat2Alarm" ;
AL57 : "SupplyTempDev." ;
AL58 : "RoomTempDev." ;
%AL59 : "" ;
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM DigitalAlarm NAMED "Läs larm 40-59" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(02); % Modbus command "02h" read discrete input (bit)
DATA[2] := RWORD(39); % Start adress (40-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(02);
%DATA[2] = BYTE(3);
DATA[3] -> BYTE(
IF (DATA & 1) THEN AL40:= 1; ELSE AL40:= 0; ENDIF;
IF (DATA & 2) THEN AL41:= 1; ELSE AL41:= 0; ENDIF;
IF (DATA & 4) THEN AL42:= 1; ELSE AL42:= 0; ENDIF;
IF (DATA & 8) THEN AL43:= 1; ELSE AL43:= 0; ENDIF;
IF (DATA & 16) THEN AL44:= 1; ELSE AL44:= 0; ENDIF;
IF (DATA & 32) THEN AL45:= 1; ELSE AL45:= 0; ENDIF;
IF (DATA & 64) THEN AL46:= 1; ELSE AL46:= 0; ENDIF;
IF (DATA & 128) THEN AL47:= 1; ELSE AL47:= 0; ENDIF;
);
DATA[4] -> BYTE(
IF (DATA & 1) THEN AL48:= 1; ELSE AL48:= 0; ENDIF;
IF (DATA & 2) THEN AL49:= 1; ELSE AL49:= 0; ENDIF;
IF (DATA & 4) THEN AL50:= 1; ELSE AL50:= 0; ENDIF;
IF (DATA & 8) THEN AL51:= 1; ELSE AL51:= 0; ENDIF;
IF (DATA & 16) THEN AL52:= 1; ELSE AL52:= 0; ENDIF;
IF (DATA & 32) THEN AL53:= 1; ELSE AL53:= 0; ENDIF;
IF (DATA & 64) THEN AL54:= 1; ELSE AL54:= 0; ENDIF;
IF (DATA & 128) THEN AL55:= 1; ELSE AL55:= 0; ENDIF;
);
DATA[5] -> BYTE(
IF (DATA & 1) THEN AL56:= 1; ELSE AL56:= 0; ENDIF;
IF (DATA & 2) THEN AL57:= 1; ELSE AL57:= 0; ENDIF;
IF (DATA & 4) THEN AL58:= 1; ELSE AL58:= 0; ENDIF;
% IF (DATA & 8) THEN AL59:= 1; ELSE AL59:= 0; ENDIF;
);
TIMEOUT 1000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for Climatrix, Indikation/Alarm inputs
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2010-08-18 initial version
%
DEVICETYPE ClimatrixAlarm NAMED "Climatrix Dig.4" TYPEID 21383 IS
PARAMETER
Id : "Adress";
PUBLIC
%AL60 : "" ;
%AL61 : "" ;
AL62 : "HumidityFeedb." ;
AL63 : "Humid.PumpAlarm" ;
AL64 : "Humid.PumpFeedb" ;
AL65 : "SupplyHumid.Dev" ;
AL66 : "RoomHumidDev" ;
AL67 : "DewPoint" ;
%AL68 : " ;
%AL69 : " ;
AL70 : "FilterAlarm" ;
AL71 : "SupplyFiltAlarm" ;
AL72 : "ExhaustFilAlarm" ;
AL73 : "FireAlarm" ;
AL74 : "SuppTempFireAla" ;
AL75 : "ExhaTempFireAla" ;
AL76 : "AuxiliaryAlarm" ;
AL77 : "ManualMode" ;
AL78 : "ModbusComAlarm" ;
%AL79 : " ;
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM DigitalAlarm NAMED "Läs larm 60-79" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(02); % Modbus command "02h" read discrete input (bit)
DATA[2] := RWORD(59); % Start adress (50-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(02);
%DATA[2] = BYTE(3);
DATA[3] -> BYTE(
% IF (DATA & 1) THEN AL60:= 1; ELSE AL60:= 0; ENDIF;
% IF (DATA & 2) THEN AL61:= 1; ELSE AL61:= 0; ENDIF;
IF (DATA & 4) THEN AL62:= 1; ELSE AL62:= 0; ENDIF;
IF (DATA & 8) THEN AL63:= 1; ELSE AL63:= 0; ENDIF;
IF (DATA & 16) THEN AL64:= 1; ELSE AL64:= 0; ENDIF;
IF (DATA & 32) THEN AL65:= 1; ELSE AL65:= 0; ENDIF;
IF (DATA & 64) THEN AL66:= 1; ELSE AL66:= 0; ENDIF;
IF (DATA & 128) THEN AL67:= 1; ELSE AL67:= 0; ENDIF;
);
DATA[4] -> BYTE(
% IF (DATA & 1) THEN AL68:= 1; ELSE AL68:= 0; ENDIF;
% IF (DATA & 2) THEN AL69:= 1; ELSE AL69:= 0; ENDIF;
IF (DATA & 4) THEN AL70:= 1; ELSE AL70:= 0; ENDIF;
IF (DATA & 8) THEN AL71:= 1; ELSE AL71:= 0; ENDIF;
IF (DATA & 16) THEN AL72:= 1; ELSE AL72:= 0; ENDIF;
IF (DATA & 32) THEN AL73:= 1; ELSE AL73:= 0; ENDIF;
IF (DATA & 64) THEN AL74:= 1; ELSE AL74:= 0; ENDIF;
IF (DATA & 128) THEN AL75:= 1; ELSE AL75:= 0; ENDIF;
);
DATA[5] -> BYTE(
IF (DATA & 1) THEN AL76:= 1; ELSE AL76:= 0; ENDIF;
IF (DATA & 2) THEN AL77:= 1; ELSE AL77:= 0; ENDIF;
IF (DATA & 4) THEN AL78:= 1; ELSE AL78:= 0; ENDIF;
% IF (DATA & 8) THEN AL79:= 1; ELSE AL79:= 0; ENDIF;
);
TIMEOUT 1000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for Climatrix, Indikation/Alarm inputs
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2010-08-18 initial version
%
DEVICETYPE ClimatrixAlarm NAMED "Climatrix Dig.5" TYPEID 21384 IS
PARAMETER
Id : "Adress";
PUBLIC
AL80 : "OutAirTemp" ;
AL81 : "SupplyAirTemp" ;
AL82 : "HeatFrostTemp" ;
AL83 : "RoomTemp" ;
AL84 : "RoomTemp2" ;
AL85 : "ExhaustAirTemp" ;
AL86 : "ExtractAirTemp" ;
AL87 : "HeatRecSuppTemp" ;
AL88 : "HeatRecWateTemp" ;
AL89 : "SupplyAirTemp2" ;
AL90 : "Heat2FrostTemp" ;
AL91 : "AuxiliaryTemp" ;
AL92 : "OutAirHumidiRel" ;
AL93 : "SupAirHumidiRel" ;
AL94 : "RoomHumidiRelat" ;
AL95 : "SupplyAirFlow" ;
AL96 : "ExhaustAirFlow" ;
AL97 : "SupplyAirPress" ;
AL98 : "ExhaustAirPress" ;
AL99 : "HeatRFrostPress" ;
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM DigitalAlarm NAMED "Läs larm 80-99" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(02); % Modbus command "02h" read discrete input (bit)
DATA[2] := RWORD(79); % Start adress (80-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(02);
%DATA[2] = BYTE(3);
DATA[3] -> BYTE(
IF (DATA & 1) THEN AL80:= 1; ELSE AL80:= 0; ENDIF;
IF (DATA & 2) THEN AL81:= 1; ELSE AL81:= 0; ENDIF;
IF (DATA & 4) THEN AL82:= 1; ELSE AL82:= 0; ENDIF;
IF (DATA & 8) THEN AL83:= 1; ELSE AL83:= 0; ENDIF;
IF (DATA & 16) THEN AL84:= 1; ELSE AL84:= 0; ENDIF;
IF (DATA & 32) THEN AL85:= 1; ELSE AL85:= 0; ENDIF;
IF (DATA & 64) THEN AL86:= 1; ELSE AL86:= 0; ENDIF;
IF (DATA & 128) THEN AL87:= 1; ELSE AL87:= 0; ENDIF;
);
DATA[4] -> BYTE(
IF (DATA & 1) THEN AL88:= 1; ELSE AL88:= 0; ENDIF;
IF (DATA & 2) THEN AL89:= 1; ELSE AL89:= 0; ENDIF;
IF (DATA & 4) THEN AL90:= 1; ELSE AL90:= 0; ENDIF;
IF (DATA & 8) THEN AL91:= 1; ELSE AL91:= 0; ENDIF;
IF (DATA & 16) THEN AL92:= 1; ELSE AL92:= 0; ENDIF;
IF (DATA & 32) THEN AL93:= 1; ELSE AL93:= 0; ENDIF;
IF (DATA & 64) THEN AL94:= 1; ELSE AL94:= 0; ENDIF;
IF (DATA & 128) THEN AL95:= 1; ELSE AL95:= 0; ENDIF;
);
DATA[5] -> BYTE(
IF (DATA & 1) THEN AL96:= 1; ELSE AL96:= 0; ENDIF;
IF (DATA & 2) THEN AL97:= 1; ELSE AL97:= 0; ENDIF;
IF (DATA & 4) THEN AL98:= 1; ELSE AL98:= 0; ENDIF;
IF (DATA & 8) THEN AL99:= 1; ELSE AL99:= 0; ENDIF;
);
TIMEOUT 1000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for Climatrix, Indikation/Alarm inputs
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2010-08-18 initial version
%
DEVICETYPE ClimatrixAlarm NAMED "Climatrix Dig.6" TYPEID 21385 IS
PARAMETER
Id : "Adress";
PUBLIC
AL100 : "OutAirDamper" ; % 1x0100 Air quality
AL101 : "ExtracAirDamper" ; % 1x0101 External setpoint
AL102 : "FireDamperClose" ; % 1x0102 Roomunit 1
AL103 : "FireDamperOpen" ; % 1x0103 Roomunit 2
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM DigitalAlarm NAMED "Läs larm 100-103" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(02); % Modbus command "02h" read discrete input (bit)
DATA[2] := RWORD(99); % Start adress (100-1)
DATA[4] := RWORD(4); % Number of inputs
ANSWER SIZE 6 % ((Number of inputs / 8) + (Rest>0)) + 5
DATA[0] = BYTE(Id);
DATA[1] = HEX(02);
%DATA[2] = BYTE(1);
DATA[3] -> BYTE(
IF (DATA & 1) THEN AL100:= 1; ELSE AL100:= 0; ENDIF;
IF (DATA & 2) THEN AL101:= 1; ELSE AL101:= 0; ENDIF;
IF (DATA & 4) THEN AL102:= 1; ELSE AL102:= 0; ENDIF;
IF (DATA & 8) THEN AL103:= 1; ELSE AL103:= 0; ENDIF;
);
TIMEOUT 1000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for Climatrix Digital outputs
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Kvittera genom att öka kanalvärdet kopplat till "Kvittering".
% Om man har en checkbox (kryssruta) för att utföra kvittering går det kanske
% att koppla en logisk funktion som efter viss timeout ställer tillbaka
% kvitteringskanalen (och checkboxen). Den timeouten måste anpassas efter
% skriptets ställda uppdateringstid.
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2010-08-18 inital version
%
DEVICETYPE ClimatrixDigitalOut NAMED "Climatrix SetDU" TYPEID 21386 IS
PARAMETER
Id : "Adress";
Ack : "Acknowledge" ; % 0x01 Alarm acknowledge Off*On
%DU2 : "EnableComTest" ; % 0x02 Enable communicationtest No*Yes
%DU3 : "ComTestPuls" ; % 0x03 Communicationtest puls 0*1
%DU4 : "FireDamperTest" ; % 0x04 Fire damper test Passive*Active
%DU7 : "EnergyMeterRes."; % 0x07 Energymeeter reset partial Passive*ActiveTVal
%DU11 : "EmergencyStop" ; % 0x11 Emergency stop input Off*On, (I/O)
%DU12 : "ExternalIn1" ; % 0x12 External control input 1 Off*On, (I/O)
%DU13 : "ExternalIn2" ; % 0x13 External control input 2 Off*On, (I/O)
%DU14 : "Summer/Winter" ; % 0x14 Summer/Winter changeover input Winter*Summer,I/O
%DU15 : "FireAlarm" ; % 0x15 Fire alarm input OK*Alarm,I/O
PUBLIC
PRIVATE
Started;
AckMemory;
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>8 THEN Cnt:=0; ENDIF;
DATA := 6; % Digital reg 7
%IF Cnt=0 THEN DATA := 6; % Digital reg 7
%ELSIF Cnt=1 THEN DATA := 6; % Digital reg 7
%ELSIF Cnt=2 THEN DATA := 6; % Digital reg 7
%ELSIF Cnt=3 THEN DATA := 6; % Digital reg 7
%ELSIF Cnt=4 THEN DATA := 6; % Digital reg 7
%ELSIF Cnt=5 THEN DATA := 6; % Digital reg 7
%ELSIF Cnt=6 THEN DATA := 6; % Digital reg 7
%ELSIF Cnt=7 THEN DATA := 6; % Digital reg 7
%ELSIF Cnt=8 THEN DATA := 6; % Digital reg 7
%ENDIF;
);
DATA[4] <- RWORD(
IF Ack THEN DATA:=65280; ELSE DATA:=0; ENDIF;
%IF Cnt=0 THEN IF DO14 THEN DATA:=65280; ELSE DATA:=0; ENDIF;
%ELSIF Cnt=1 THEN IF DO14 THEN DATA:=65280; ELSE DATA:=0; ENDIF;
%ELSIF Cnt=2 THEN IF DO14 THEN DATA:=65280; ELSE DATA:=0; ENDIF;
%ELSIF Cnt=3 THEN IF DO14 THEN DATA:=65280; ELSE DATA:=0; ENDIF;
%ELSIF Cnt=4 THEN IF DO14 THEN DATA:=65280; ELSE DATA:=0; ENDIF;
%ELSIF Cnt=5 THEN IF DO14 THEN DATA:=65280; ELSE DATA:=0; ENDIF;
%ELSIF Cnt=6 THEN IF DO14 THEN DATA:=65280; ELSE DATA:=0; ENDIF;
%ELSIF Cnt=7 THEN IF DO14 THEN DATA:=65280; ELSE DATA:=0; ENDIF;
%ELSIF Cnt=8 THEN IF DO14 THEN DATA:=65280; ELSE DATA:=0; ENDIF;
%ENDIF;
);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = HEX(05);
TIMEOUT 1000
END;
TELEGRAM Acknowledge NAMED "Larmkvittering" IS
QUESTION
DATA[0] := BYTE(Id);
DATA[1] := HEX(05); %Write singel coil
DATA[2] <- RWORD(DATA := 0;); %Start adress (regnr-1)
DATA[4] <- RWORD(IF (Started = 0) THEN
AckMemory := Ack;
Started := 1;
ENDIF;
IF (Ack > AckMemory) THEN
DATA := 65280; % FF00h
ELSE
DATA := 0;
ENDIF;
AckMemory := Ack;
);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = HEX(05);
TIMEOUT 1000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for Climatrix 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 ClimatrixA1 NAMED "Climatrix Reg.1" TYPEID 21387 IS
PARAMETER
Id : "Adress";
PUBLIC
V1 : "Act.OperatMode" ;
V2 : "Act.FanStep" ;
V3 : "Man.OperatStep" ;
V4 : "Man.OperatSt/Te" ;
V5 : "Act.TimePrStep" ;
V6 : "Act.TimePrSt/Te" ;
V7 : "Act.OpmodeExtCt" ;
V8 : "FireDamperState" ;
V9 : "OutAirDamperCom" ;
V10 : "ExtAirDamperCom" ;
V11 : "FireDamperCom" ;
V12 : "SupplyFanCom" ;
V13 : "SupplyFanSignal" ["%"];
V14 : "ExhaustFanCom" ;
V15 : "ExhaustFanSigna" ["%"];
%V16 : "
V17 : "CoolOutSignal" ["%"];
V18 : "CoolPumpCom" ;
V19 : "CoolDXCom" ;
V20 : "HeatRec.Signal" ["%"];
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM AnalogInput NAMED "Läs reg. 17-36" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(04); % Modbus command "04h" Read registers
DATA[2] := RWORD(16); % Start address register (17-1)
DATA[4] := RWORD(20); % Number of registers
ANSWER SIZE 45 % (Number of registers * 2) + 5
DATA[0] = BYTE(Id); % ID
DATA[1] = HEX(04); % Modbus command "04h" Read registers
%DATA[2] = BYTE(40); % Byte count
DATA[3] -> RWORD(V1 := DATA;);
DATA[5] -> RWORD(V2 := DATA;);
DATA[7] -> RWORD(V3 := DATA;);
DATA[9] -> RWORD(V4 := DATA;);
DATA[11] -> RWORD(V5 := DATA;);
DATA[13] -> RWORD(V6 := DATA;);
DATA[15] -> RWORD(V7 := DATA;);
DATA[17] -> RWORD(V8 := DATA;);
DATA[19] -> RWORD(V9 := DATA;);
DATA[21] -> RWORD(V10:= DATA;);
DATA[23] -> RWORD(V11:= DATA;);
DATA[25] -> RWORD(V12:= DATA;);
DATA[27] -> RWORD(V13:= DATA;);
DATA[29] -> RWORD(V14:= DATA;);
DATA[31] -> RWORD(V15:= DATA;);
%DATA[33] -> RWORD(V16:= DATA;);
DATA[35] -> RWORD(V17:= DATA;);
DATA[37] -> RWORD(V18:= DATA;);
DATA[39] -> RWORD(V19:= DATA;);
DATA[41] -> RWORD(V20:= DATA;);
TIMEOUT 1000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for Climatrix 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 ClimatrixA2 NAMED "Climatrix Reg.2" TYPEID 21388 IS
PARAMETER
Id : "Adress";
PUBLIC
V1 : "HeatRec.PumpCom" ;
V2 : "HeatDamperSigna" ["%"];
V3 : "HeatDamperValue" ["%"];
V4 : "HeatSignal" ["%"];
V5 : "HeatPumpCom." ;
V6 : "El.HeatSignal" ["%"];
V7 : "El.HeatCom." ;
V8 : "Cool2Signal" ["%"];
V9 : "Cool2PumpCom." ;
V10 : "Cool2DXCom." ;
V11 : "Heat2Ssignal" ["%"];
V12 : "Heat2PumpCom." ;
V13 : "El.Heat2Signal" ["%"];
V14 : "El.Heat2Com." ;
%V15 : ""
V16 : "HumiditySignal" ["%"];
V17 : "HumidityCom." ;
V18 : "HumidityPumpCom" ;
V19 : "DehumidityValue" ["%"];
%V20 : "" ;
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM AnalogInput NAMED "Läs reg. 37-56" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(04); % Modbus command "04h" Read registers
DATA[2] := RWORD(36); % Start address register (37-1)
DATA[4] := RWORD(20); % Number of registers
ANSWER SIZE 45 % (Number of registers * 2) + 5
DATA[0] = BYTE(Id); % ID
DATA[1] = HEX(04); % Modbus command "04h" Read registers
%DATA[2] = BYTE(40); % Byte count
DATA[3] -> RWORD(V1 := DATA;);
DATA[5] -> RWORD(V2 := DATA;);
DATA[7] -> RWORD(V3 := DATA;);
DATA[9] -> RWORD(V4 := DATA;);
DATA[11] -> RWORD(V5 := DATA;);
DATA[13] -> RWORD(V6 := DATA;);
DATA[15] -> RWORD(V7 := DATA;);
DATA[17] -> RWORD(V8 := DATA;);
DATA[19] -> RWORD(V9 := DATA;);
DATA[21] -> RWORD(V10:= DATA;);
DATA[23] -> RWORD(V11:= DATA;);
DATA[25] -> RWORD(V12:= DATA;);
DATA[27] -> RWORD(V13:= DATA;);
DATA[29] -> RWORD(V14:= DATA;);
%DATA[31] -> RWORD(V15:= DATA;);
DATA[33] -> RWORD(V16:= DATA;);
DATA[35] -> RWORD(V17:= DATA;);
DATA[37] -> RWORD(V18:= DATA;);
DATA[39] -> RWORD(V19:= DATA;);
%DATA[41] -> RWORD(V20:= DATA;);
TIMEOUT 1000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for Climatrix 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 ClimatrixA3 NAMED "Climatrix Reg.3" TYPEID 21389 IS
PARAMETER
Id : "Adress";
PUBLIC
V1 : "AuxOperatMode" ;
V2 : "AuxTimeSwProg" ;
V3 : "AuxAnalogFan" ["%"];
V4 : "AlarmOutput1" ;
V5 : "AlarmOutput2" ;
%V6 : ""
%V7 : ""
V8 : "ActAirQualiComp" ["%"];
V9 : "ActFanCoolValue" ["%"];
V10 : "ActFanHeatValue" ["%"];
V11 : "ActFanCompTemp" ["%"];
V12 : "ActFanCompHumid" ["%"];
V13 : "SummerCompFan" ["%"];
V14 : "WinterCompFan" ["%"];
V15 : "OutAirTemp" ["°C"];
V16 : "SupplyAirTemp" ["°C"];
V17 : "HeatFrostTemp" ["°C"];
V18 : "Act.RoomTemp" ["°C"];
V19 : "ExhaustAirTemp" ["°C"];
%V20 : "" ;
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM AnalogInput NAMED "Läs reg. 57-76" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(04); % Modbus command "04h" Read registers
DATA[2] := RWORD(56); % Start address register (57-1)
DATA[4] := RWORD(20); % Number of registers
ANSWER SIZE 45 % (Number of registers * 2) + 5
DATA[0] = BYTE(Id); % ID
DATA[1] = HEX(04); % Modbus command "04h" Read registers
%DATA[2] = BYTE(40); % Byte count
DATA[3] -> RWORD(V1 := DATA;);
DATA[5] -> RWORD(V2 := DATA;);
DATA[7] -> RWORD(V3 := DATA;);
DATA[9] -> RWORD(V4 := DATA;);
DATA[11] -> RWORD(V5 := DATA;);
%DATA[13] -> RWORD(V6 := DATA;);
%DATA[15] -> RWORD(V7 := DATA;);
DATA[17] -> RWORD(V8 := DATA;);
DATA[19] -> RWORD(V9 := DATA;);
DATA[21] -> RWORD(V10:= DATA;);
DATA[23] -> RWORD(V11:= DATA;);
DATA[25] -> RWORD(V12:= DATA;);
DATA[27] -> RWORD(V13:= DATA;);
DATA[29] -> RWORD(V14:= DATA;);
DATA[31] -> RWORD(IF (DATA>=32768) THEN V15:=(DATA-65536)/10; ELSE V15:=DATA/10; ENDIF;);
DATA[33] -> RWORD(IF (DATA>=32768) THEN V16:=(DATA-65536)/10; ELSE V16:=DATA/10; ENDIF;);
DATA[35] -> RWORD(IF (DATA>=32768) THEN V17:=(DATA-65536)/10; ELSE V17:=DATA/10; ENDIF;);
DATA[37] -> RWORD(IF (DATA>=32768) THEN V18:=(DATA-65536)/10; ELSE V18:=DATA/10; ENDIF;);
DATA[39] -> RWORD(IF (DATA>=32768) THEN V19:=(DATA-65536)/10; ELSE V19:=DATA/10; ENDIF;);
%DATA[41] -> RWORD(V20:= DATA;);
TIMEOUT 1000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for Climatrix 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 ClimatrixA4 NAMED "Climatrix Reg.4" TYPEID 21390 IS
PARAMETER
Id : "Adress";
PUBLIC
V1 : "ExtractAirTemp" ["°C"] ;
V2 : "HeatRSupplyTemp" ["°C"] ;
V3 : "HeatRWaterTemp" ["°C"] ;
V4 : "SupplyAirTemp2" ["°C"] ;
V5 : "Heat2FrostTemp" ["°C"] ;
V6 : "AuxiliaryTemp" ["°C"] ;
%V7 : "" ;
V8 : "OutAirHumRelat" ["%rH"] ;
V9 : "OutAirHumAbsol" ["g/kg"] ;
V10 : "OutAirEnthalpy" ["kJ/kg"];
V11 : "SuppAirHumRel" ["%rH"] ;
V12 : "SuppAirHumAbs" ["g/kg"] ;
V13 : "SuppAirEnthal" ["kJ/kg"];
V14 : "RoomHumidityRel" ["%rH"] ;
V15 : "RoomHumidityAbs" ["g/kg"] ;
V16 : "RoomEnthalpy" ["kJ/kg"];
V17 : "DewPoint" ["°C"] ;
%V18 : "" ;
V19 : "SupplyAirFlow" ["l/s"] ;
V20 : "ExhaustAirFlow" ["l/s"] ;
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM AnalogInput NAMED "Läs reg.77-96" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(04); % Modbus command "04h" Read registers
DATA[2] := RWORD(76); % Start address register (77-1)
DATA[4] := RWORD(20); % Number of registers
ANSWER SIZE 45 % (Number of registers * 2) + 5
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 V1 :=(DATA-65536)/10; ELSE V1 :=DATA/10; ENDIF;);
DATA[5] -> RWORD(IF (DATA>=32768) THEN V2 :=(DATA-65536)/10; ELSE V2 :=DATA/10; ENDIF;);
DATA[7] -> RWORD(IF (DATA>=32768) THEN V3 :=(DATA-65536)/10; ELSE V3 :=DATA/10; ENDIF;);
DATA[9] -> RWORD(IF (DATA>=32768) THEN V4 :=(DATA-65536)/10; ELSE V4 :=DATA/10; ENDIF;);
DATA[11] -> RWORD(IF (DATA>=32768) THEN V5 :=(DATA-65536)/10; ELSE V5 :=DATA/10; ENDIF;);
DATA[13] -> RWORD(IF (DATA>=32768) THEN V6 :=(DATA-65536)/10; ELSE V6 :=DATA/10; ENDIF;);
%DATA[15] -> RWORD(V7 := DATA;);
DATA[17] -> RWORD(V8 := DATA;);
DATA[19] -> RWORD(IF (DATA>=32768) THEN V9 :=(DATA-65536)/10; ELSE V9 :=DATA/10; ENDIF;);
DATA[21] -> RWORD(IF (DATA>=32768) THEN V10:=(DATA-65536)/10; ELSE V10:=DATA/10; ENDIF;);
DATA[23] -> RWORD(V11:= DATA;);
DATA[25] -> RWORD(IF (DATA>=32768) THEN V12:=(DATA-65536)/10; ELSE V12:=DATA/10; ENDIF;);
DATA[27] -> RWORD(IF (DATA>=32768) THEN V13:=(DATA-65536)/10; ELSE V13:=DATA/10; ENDIF;);
DATA[29] -> RWORD(V14:= DATA;);
DATA[31] -> RWORD(IF (DATA>=32768) THEN V15:=(DATA-65536)/10; ELSE V15:=DATA/10; ENDIF;);
DATA[33] -> RWORD(IF (DATA>=32768) THEN V16:=(DATA-65536)/10; ELSE V16:=DATA/10; ENDIF;);
DATA[35] -> RWORD(IF (DATA>=32768) THEN V17:=(DATA-65536)/10; ELSE V17:=DATA/10; ENDIF;);
%DATA[37] -> RWORD(V18:= DATA;);
DATA[39] -> RWORD(V19:= DATA;);
DATA[41] -> RWORD(V20:= DATA;);
TIMEOUT 1000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for Climatrix 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 ClimatrixA5 NAMED "Climatrix Reg.5" TYPEID 21391 IS
PARAMETER
Id : "Adress";
PUBLIC
V1 : "SupAirPressure" ["Pa"] ;
V2 : "ExhAirPressure" ["Pa"] ;
V3 : "HeatRFrostPress" ["Pa"] ;
%V4 : "" ;
V5 : "AirQuality" ["ppm"];
V6 : "ExternSetpoint" ["°C"] ;
%V7 : "" ;
V8 : "MainHeatSetP" ["°C"] ;
V9 : "MainCoolSetP" ["°C"] ;
V10 : "SuppHeatSetP" ["°C"] ;
V11 : "SuppCoolSetP" ["°C"] ;
V12 : "MainHumidiSetP" ["%rH"];
V13 : "MainDehumidSetP" ["%rH"];
V14 : "SuppHumidiSetP" ["%rH"];
V15 : "SuppDehumidSetP" ["%rH"];
V16 : "SuppFanSetP" ["%"] ;
V17 : "ExhaustFanSetP" ["%"] ;
%V18 : " ;
V19 : "SummerCompTemp" ["°C"] ;
V20 : "WinterCompTemp" ["°C"] ;
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM AnalogInput NAMED "Läs reg.97-116" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(04); % Modbus command "04h" Read registers
DATA[2] := RWORD(96); % Start address register (97-1)
DATA[4] := RWORD(20); % Number of registers
ANSWER SIZE 45 % (Number of registers * 2) + 5
DATA[0] = BYTE(Id); % ID
DATA[1] = HEX(04); % Modbus command "04h" Read registers
%DATA[2] = BYTE(40); % Byte count
DATA[3] -> RWORD(V1 := DATA;);
DATA[5] -> RWORD(V2 := DATA;);
DATA[7] -> RWORD(V3 := DATA;);
%DATA[9] -> RWORD(V4 := DATA;);
DATA[11] -> RWORD(V5 := DATA;);
DATA[13] -> RWORD(IF (DATA>=32768) THEN V6 :=(DATA-65536)/10; ELSE V6 :=DATA/10; ENDIF;);
%DATA[15] -> RWORD(V7 := DATA;);
DATA[17] -> RWORD(IF (DATA>=32768) THEN V8 :=(DATA-65536)/10; ELSE V8 :=DATA/10; ENDIF;);
DATA[19] -> RWORD(IF (DATA>=32768) THEN V9 :=(DATA-65536)/10; ELSE V9 :=DATA/10; ENDIF;);
DATA[21] -> RWORD(IF (DATA>=32768) THEN V10:=(DATA-65536)/10; ELSE V10:=DATA/10; ENDIF;);
DATA[23] -> RWORD(IF (DATA>=32768) THEN V11:=(DATA-65536)/10; ELSE V11:=DATA/10; ENDIF;);
DATA[25] -> RWORD(IF (DATA>=32768) THEN V12:=(DATA-65536)/10; ELSE V12:=DATA/10; ENDIF;);
DATA[27] -> RWORD(IF (DATA>=32768) THEN V13:=(DATA-65536)/10; ELSE V13:=DATA/10; ENDIF;);
DATA[29] -> RWORD(IF (DATA>=32768) THEN V14:=(DATA-65536)/10; ELSE V14:=DATA/10; ENDIF;);
DATA[31] -> RWORD(IF (DATA>=32768) THEN V15:=(DATA-65536)/10; ELSE V15:=DATA/10; ENDIF;);
DATA[33] -> RWORD(V16:= DATA;);
DATA[35] -> RWORD(V17:= DATA;);
%DATA[37] -> RWORD(V18:= DATA;);
DATA[39] -> RWORD(IF (DATA>=32768) THEN V19:=(DATA-65536)/10; ELSE V19:=DATA/10; ENDIF;);
DATA[41] -> RWORD(IF (DATA>=32768) THEN V20:=(DATA-65536)/10; ELSE V20:=DATA/10; ENDIF;);
TIMEOUT 1000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for Climatrix 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 ClimatrixA6 NAMED "Climatrix Reg.6" TYPEID 21392 IS
PARAMETER
Id : "Adress";
PUBLIC
V1 : "HeatRec.PumpCom" ;
V2 : "HeatDamperSigna" ["%"];
%V3 : "" ;
V4 : "HeatDamperValue" ["%"];
V5 : "HeatSignal" ["%"];
V6 : "HeatPumpCom." ;
V7 : "El.HeatSignal" ["%"];
V8 : "El.HeatCom." ;
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM AnalogInput NAMED "Läs reg 117-124" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(04); % Modbus command "04h" Read registers
DATA[2] := RWORD(116); % Start address register (117-1)
DATA[4] := RWORD(8); % Number of registers
ANSWER SIZE 21 % (Number of registers * 2) + 5
DATA[0] = BYTE(Id); % ID
DATA[1] = HEX(04); % Modbus command "04h" Read registers
%DATA[2] = BYTE(16); % Byte count
DATA[3] -> RWORD(V1 := DATA;);
DATA[5] -> RWORD(V2 := DATA;);
%DATA[7] -> RWORD(V3 := DATA;);
DATA[9] -> RWORD(V4 :=DATA/10;);
DATA[11] -> RWORD(V5 :=DATA/10;);
DATA[13] -> RWORD(V6 :=DATA/10;);
DATA[15] -> RWORD(V7 :=DATA/10;);
DATA[17] -> RWORD(V8 :=DATA/10;);
TIMEOUT 1000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for Climatrix 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 ClimatrixA7 NAMED "Climatrix Reg.7" TYPEID 21393 IS
PARAMETER
Id : "Adress";
PUBLIC
V1 : "HeatRec.PumpCom" ;
V2 : "HeatDamperSigna" ["K/°C"];
V3 : "HeatDamperValue" ["°C"] ;
V4 : "HeatSignal" ["°C"] ;
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM AnalogInput NAMED "Läs reg.200-203" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(04); % Modbus command "04h" Read registers
DATA[2] := RWORD(199); % Start address register (200-1)
DATA[4] := RWORD(4); % Number of registers
ANSWER SIZE 13 % (Number of registers * 2) + 5
DATA[0] = BYTE(Id); % ID
DATA[1] = HEX(04); % Modbus command "04h" Read registers
%DATA[2] = BYTE(8); % Byte count
DATA[3] -> RWORD(V1 := DATA;);
DATA[5] -> RWORD(IF (DATA>=32768) THEN V2:=(DATA-65536)/10; ELSE V2:=DATA/10; ENDIF;);
DATA[7] -> RWORD(IF (DATA>=32768) THEN V3:=(DATA-65536)/10; ELSE V3:=DATA/10; ENDIF;);
DATA[9] -> RWORD(IF (DATA>=32768) THEN V4:=(DATA-65536)/10; ELSE V4:=DATA/10; ENDIF;);
TIMEOUT 1000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for Climatrix Analog settings
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2010-08-18 inital version
%
DEVICETYPE ClimatrixSet NAMED "Climatrix Ställ" TYPEID 21294 IS
PARAMETER
Id : "Adress";
S20 : "ComfortTempSetP" ["°C"] ; % 4x0020 Comfort temperature setpoint -+ °C (factor 10)
PUBLIC
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)
IF Cnt>8 THEN Cnt:=0; ENDIF;
%% Adress=Register-1
IF Cnt=0 THEN DATA := 19; % S20
ELSIF Cnt=1 THEN DATA := 19; % S20
ELSIF Cnt=2 THEN DATA := 19; % S20
ELSIF Cnt=3 THEN DATA := 19; % S20
ELSIF Cnt=4 THEN DATA := 19; % S20
ELSIF Cnt=5 THEN DATA := 19; % S20
ELSIF Cnt=6 THEN DATA := 19; % S20
ELSIF Cnt=7 THEN DATA := 19; % S20
ELSE DATA := 19; % S20
ENDIF;
);
DATA[4] <- RWORD(
IF Cnt=0 THEN
IF S20<10 THEN DATA := 100; % S20 Comfort temperature setpoint 1/10
ELSIF S20>30 THEN DATA := 300;
ELSE DATA := S20;
ENDIF;
ELSIF Cnt=1 THEN
IF S20<10 THEN DATA := 100; % S20 Comfort temperature setpoint 1/10
ELSIF S20>30 THEN DATA := 300;
ELSE DATA := S20;
ENDIF;
ELSIF Cnt=2 THEN
IF S20<10 THEN DATA := 100; % S20 Comfort temperature setpoint 1/10
ELSIF S20>30 THEN DATA := 300;
ELSE DATA := S20;
ENDIF;
ELSIF Cnt=3 THEN
IF S20<10 THEN DATA := 100; % S20 Comfort temperature setpoint 1/10
ELSIF S20>30 THEN DATA := 300;
ELSE DATA := S20;
ENDIF;
ELSIF Cnt=4 THEN
IF S20<10 THEN DATA := 100; % S20 Comfort temperature setpoint 1/10
ELSIF S20>30 THEN DATA := 300;
ELSE DATA := S20;
ENDIF;
ELSIF Cnt=5 THEN
IF S20<10 THEN DATA := 100; % S20 Comfort temperature setpoint 1/10
ELSIF S20>30 THEN DATA := 300;
ELSE DATA := S20;
ENDIF;
ELSIF Cnt=6 THEN
IF S20<10 THEN DATA := 100; % S20 Comfort temperature setpoint 1/10
ELSIF S20>30 THEN DATA := 300;
ELSE DATA := S20;
ENDIF;
ELSIF Cnt=7 THEN
IF S20<10 THEN DATA := 100; % S20 Comfort temperature setpoint 1/10
ELSIF S20>30 THEN DATA := 300;
ELSE DATA := S20;
ENDIF;
ELSE
IF S20<10 THEN DATA := 100; % S20 Comfort temperature setpoint 1/10
ELSIF S20>30 THEN DATA := 300;
ELSE DATA := S20;
ENDIF;
ENDIF;
Cnt := Cnt + 1;
IF Cnt>8 THEN Cnt := 0;
ENDIF;
);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = HEX(06);
TIMEOUT 1000
END;
END;
% Device definition for Climatrix, Digital inputs
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2010-08-18 inital version
%
DEVICETYPE ClimatrixDigital NAMED "Climatrix Dig.1" TYPEID 21380 IS
PARAMETER
Id : "Adress";
PUBLIC
D1 : "DangerAlarm(A)" ;
D2 : "CriticAlarm(A)" ;
D3 : "LowAlarm(B)" ;
D4 : "WarningAlarm(C)";
D5 : "ManualMode" ;
D6 : "ComTestPuls" ;
D11 : "EmergencyStop" ;
D12 : "Ext.Input1" ;
D13 : "Ext.Input2" ;
D14 : "Summer/Winter" ;
D15 : "Aux.Input" ;
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM DigitalInput NAMED "Läs Status 1-19" 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 (1-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(02);
%DATA[2] = BYTE(3);
DATA[3] -> BYTE(
IF (DATA & 1) THEN D1 := 1; ELSE D1 := 0; ENDIF;
IF (DATA & 2) THEN D2 := 1; ELSE D2 := 0; ENDIF;
IF (DATA & 4) THEN D3 := 1; ELSE D3 := 0; ENDIF;
IF (DATA & 8) THEN D4 := 1; ELSE D4 := 0; ENDIF;
IF (DATA & 16) THEN D5 := 1; ELSE D5 := 0; ENDIF;
IF (DATA & 32) THEN D6 := 1; ELSE D6 := 0; ENDIF;
% IF (DATA & 64) THEN D7 := 1; ELSE D7 := 0; ENDIF;
% IF (DATA & 128) THEN D8 := 1; ELSE D8 := 0; ENDIF;
);
DATA[4] -> BYTE(
% IF (DATA & 1) THEN D9 := 1; ELSE D9 := 0; ENDIF;
% IF (DATA & 2) THEN D10:= 1; ELSE D10:= 0; ENDIF;
IF (DATA & 4) THEN D11:= 1; ELSE D11:= 0; ENDIF;
IF (DATA & 8) THEN D12:= 1; ELSE D12:= 0; ENDIF;
IF (DATA & 16) THEN D13:= 1; ELSE D13:= 0; ENDIF;
IF (DATA & 32) THEN D14:= 1; ELSE D14:= 0; ENDIF;
IF (DATA & 64) THEN D15:= 1; ELSE D15:= 0; ENDIF;
% IF (DATA & 128) THEN D16:= 1; ELSE D16:= 0; ENDIF;
);
%DATA[5] -> BYTE(
% IF (DATA & 1) THEN D17:= 1; ELSE D17:= 0; ENDIF;
% IF (DATA & 2) THEN D18:= 1; ELSE D18:= 0; ENDIF;
% IF (DATA & 4) THEN D19:= 1; ELSE D19:= 0; ENDIF;
% IF (DATA & 8) THEN D20:= 1; ELSE D20:= 0; ENDIF;
% );
TIMEOUT 1000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for Climatrix, Indikation/Alarm inputs
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2010-08-18 initial version
%
DEVICETYPE ClimatrixAlarm NAMED "Climatrix Dig.2" TYPEID 21381 IS
PARAMETER
Id : "Adress";
PUBLIC
AL20 : "OutAirDamper" ;
AL21 : "ExtracAirDamper" ;
AL22 : "FireDamperClose" ;
AL23 : "FireDamperOpen" ;
AL24 : "FireDamperNoMov" ;
%AL25 : "" ;
AL26 : "FanAlarm" ;
AL27 : "SupplyFanAlarm" ;
AL28 : "SupplyFanFeedb." ;
AL29 : "SupplyFanDevia." ;
AL30 : "ExhaustFanAlarm" ;
AL31 : "ExhaustFanFeedb" ;
AL32 : "ExhaustFanDevia" ;
AL33 : "FanOperat.Hours" ;
%AL34 : "" ;
%AL35 : "" ;
AL36 : "CoolDXAlarm" ;
AL37 : "CoolDXFeedb." ;
AL38 : "CoolPumpAlarm" ;
AL39 : "CoolPumpFeedb." ;
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM DigitalAlarm NAMED "Läs Larm 20-39" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(02); % Modbus command "02h" read discrete input (bit)
DATA[2] := RWORD(19); % Start adress (20-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(02);
%DATA[2] = BYTE(3);
DATA[3] -> BYTE(
IF (DATA & 1) THEN AL20:= 1; ELSE AL20:= 0; ENDIF;
IF (DATA & 2) THEN AL21:= 1; ELSE AL21:= 0; ENDIF;
IF (DATA & 4) THEN AL22:= 1; ELSE AL22:= 0; ENDIF;
IF (DATA & 8) THEN AL23:= 1; ELSE AL23:= 0; ENDIF;
IF (DATA & 16) THEN AL24:= 1; ELSE AL24:= 0; ENDIF;
% IF (DATA & 32) THEN AL25:= 1; ELSE AL25:= 0; ENDIF;
IF (DATA & 64) THEN AL26:= 1; ELSE AL26:= 0; ENDIF;
IF (DATA & 128) THEN AL27:= 1; ELSE AL27:= 0; ENDIF;
);
DATA[4] -> BYTE(
IF (DATA & 1) THEN AL28:= 1; ELSE AL28:= 0; ENDIF;
IF (DATA & 2) THEN AL29:= 1; ELSE AL29:= 0; ENDIF;
IF (DATA & 4) THEN AL30:= 1; ELSE AL30:= 0; ENDIF;
IF (DATA & 8) THEN AL31:= 1; ELSE AL31:= 0; ENDIF;
IF (DATA & 16) THEN AL32:= 1; ELSE AL32:= 0; ENDIF;
IF (DATA & 32) THEN AL33:= 1; ELSE AL33:= 0; ENDIF;
% IF (DATA & 64) THEN AL34:= 1; ELSE AL34:= 0; ENDIF;
% IF (DATA & 128) THEN AL35:= 1; ELSE AL35:= 0; ENDIF;
);
DATA[5] -> BYTE(
IF (DATA & 1) THEN AL36:= 1; ELSE AL36:= 0; ENDIF;
IF (DATA & 2) THEN AL37:= 1; ELSE AL37:= 0; ENDIF;
IF (DATA & 4) THEN AL38:= 1; ELSE AL38:= 0; ENDIF;
IF (DATA & 8) THEN AL39:= 1; ELSE AL39:= 0; ENDIF;
);
TIMEOUT 1000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for Climatrix, Indikation/Alarm inputs
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2010-08-18 initial version
%
DEVICETYPE ClimatrixAlarm NAMED "Climatrix Dig.3" TYPEID 21382 IS
PARAMETER
Id : "Adress";
PUBLIC
AL40 : "HeatRecAlarm" ;
AL41 : "HeatRecPumpAlar" ;
AL42 : "HeatRecPumpFeed" ;
AL43 : "HeatRecFrostMon" ;
AL44 : "HeatRecEffAlarm" ;
AL45 : "HeatPumpAlarm" ;
AL46 : "HeatPumpFeedb." ;
AL47 : "HeatFrostMonito" ;
AL48 : "Elec.HeatAlarm" ;
AL49 : "Cool2DXAlarm" ;
AL50 : "Cool2DXFeedb." ;
AL51 : "Cool2PumpAlarm" ;
AL52 : "Cool2PumpFeedb." ;
AL53 : "Heat2PumpAlarm" ;
AL54 : "Heat2PumpFeedb." ;
AL55 : "Heat2FrostMon." ;
AL56 : "Elec.Heat2Alarm" ;
AL57 : "SupplyTempDev." ;
AL58 : "RoomTempDev." ;
%AL59 : "" ;
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM DigitalAlarm NAMED "Läs larm 40-59" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(02); % Modbus command "02h" read discrete input (bit)
DATA[2] := RWORD(39); % Start adress (40-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(02);
%DATA[2] = BYTE(3);
DATA[3] -> BYTE(
IF (DATA & 1) THEN AL40:= 1; ELSE AL40:= 0; ENDIF;
IF (DATA & 2) THEN AL41:= 1; ELSE AL41:= 0; ENDIF;
IF (DATA & 4) THEN AL42:= 1; ELSE AL42:= 0; ENDIF;
IF (DATA & 8) THEN AL43:= 1; ELSE AL43:= 0; ENDIF;
IF (DATA & 16) THEN AL44:= 1; ELSE AL44:= 0; ENDIF;
IF (DATA & 32) THEN AL45:= 1; ELSE AL45:= 0; ENDIF;
IF (DATA & 64) THEN AL46:= 1; ELSE AL46:= 0; ENDIF;
IF (DATA & 128) THEN AL47:= 1; ELSE AL47:= 0; ENDIF;
);
DATA[4] -> BYTE(
IF (DATA & 1) THEN AL48:= 1; ELSE AL48:= 0; ENDIF;
IF (DATA & 2) THEN AL49:= 1; ELSE AL49:= 0; ENDIF;
IF (DATA & 4) THEN AL50:= 1; ELSE AL50:= 0; ENDIF;
IF (DATA & 8) THEN AL51:= 1; ELSE AL51:= 0; ENDIF;
IF (DATA & 16) THEN AL52:= 1; ELSE AL52:= 0; ENDIF;
IF (DATA & 32) THEN AL53:= 1; ELSE AL53:= 0; ENDIF;
IF (DATA & 64) THEN AL54:= 1; ELSE AL54:= 0; ENDIF;
IF (DATA & 128) THEN AL55:= 1; ELSE AL55:= 0; ENDIF;
);
DATA[5] -> BYTE(
IF (DATA & 1) THEN AL56:= 1; ELSE AL56:= 0; ENDIF;
IF (DATA & 2) THEN AL57:= 1; ELSE AL57:= 0; ENDIF;
IF (DATA & 4) THEN AL58:= 1; ELSE AL58:= 0; ENDIF;
% IF (DATA & 8) THEN AL59:= 1; ELSE AL59:= 0; ENDIF;
);
TIMEOUT 1000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for Climatrix, Indikation/Alarm inputs
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2010-08-18 initial version
%
DEVICETYPE ClimatrixAlarm NAMED "Climatrix Dig.4" TYPEID 21383 IS
PARAMETER
Id : "Adress";
PUBLIC
%AL60 : "" ;
%AL61 : "" ;
AL62 : "HumidityFeedb." ;
AL63 : "Humid.PumpAlarm" ;
AL64 : "Humid.PumpFeedb" ;
AL65 : "SupplyHumid.Dev" ;
AL66 : "RoomHumidDev" ;
AL67 : "DewPoint" ;
%AL68 : " ;
%AL69 : " ;
AL70 : "FilterAlarm" ;
AL71 : "SupplyFiltAlarm" ;
AL72 : "ExhaustFilAlarm" ;
AL73 : "FireAlarm" ;
AL74 : "SuppTempFireAla" ;
AL75 : "ExhaTempFireAla" ;
AL76 : "AuxiliaryAlarm" ;
AL77 : "ManualMode" ;
AL78 : "ModbusComAlarm" ;
%AL79 : " ;
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM DigitalAlarm NAMED "Läs larm 60-79" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(02); % Modbus command "02h" read discrete input (bit)
DATA[2] := RWORD(59); % Start adress (50-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(02);
%DATA[2] = BYTE(3);
DATA[3] -> BYTE(
% IF (DATA & 1) THEN AL60:= 1; ELSE AL60:= 0; ENDIF;
% IF (DATA & 2) THEN AL61:= 1; ELSE AL61:= 0; ENDIF;
IF (DATA & 4) THEN AL62:= 1; ELSE AL62:= 0; ENDIF;
IF (DATA & 8) THEN AL63:= 1; ELSE AL63:= 0; ENDIF;
IF (DATA & 16) THEN AL64:= 1; ELSE AL64:= 0; ENDIF;
IF (DATA & 32) THEN AL65:= 1; ELSE AL65:= 0; ENDIF;
IF (DATA & 64) THEN AL66:= 1; ELSE AL66:= 0; ENDIF;
IF (DATA & 128) THEN AL67:= 1; ELSE AL67:= 0; ENDIF;
);
DATA[4] -> BYTE(
% IF (DATA & 1) THEN AL68:= 1; ELSE AL68:= 0; ENDIF;
% IF (DATA & 2) THEN AL69:= 1; ELSE AL69:= 0; ENDIF;
IF (DATA & 4) THEN AL70:= 1; ELSE AL70:= 0; ENDIF;
IF (DATA & 8) THEN AL71:= 1; ELSE AL71:= 0; ENDIF;
IF (DATA & 16) THEN AL72:= 1; ELSE AL72:= 0; ENDIF;
IF (DATA & 32) THEN AL73:= 1; ELSE AL73:= 0; ENDIF;
IF (DATA & 64) THEN AL74:= 1; ELSE AL74:= 0; ENDIF;
IF (DATA & 128) THEN AL75:= 1; ELSE AL75:= 0; ENDIF;
);
DATA[5] -> BYTE(
IF (DATA & 1) THEN AL76:= 1; ELSE AL76:= 0; ENDIF;
IF (DATA & 2) THEN AL77:= 1; ELSE AL77:= 0; ENDIF;
IF (DATA & 4) THEN AL78:= 1; ELSE AL78:= 0; ENDIF;
% IF (DATA & 8) THEN AL79:= 1; ELSE AL79:= 0; ENDIF;
);
TIMEOUT 1000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for Climatrix, Indikation/Alarm inputs
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2010-08-18 initial version
%
DEVICETYPE ClimatrixAlarm NAMED "Climatrix Dig.5" TYPEID 21384 IS
PARAMETER
Id : "Adress";
PUBLIC
AL80 : "OutAirTemp" ;
AL81 : "SupplyAirTemp" ;
AL82 : "HeatFrostTemp" ;
AL83 : "RoomTemp" ;
AL84 : "RoomTemp2" ;
AL85 : "ExhaustAirTemp" ;
AL86 : "ExtractAirTemp" ;
AL87 : "HeatRecSuppTemp" ;
AL88 : "HeatRecWateTemp" ;
AL89 : "SupplyAirTemp2" ;
AL90 : "Heat2FrostTemp" ;
AL91 : "AuxiliaryTemp" ;
AL92 : "OutAirHumidiRel" ;
AL93 : "SupAirHumidiRel" ;
AL94 : "RoomHumidiRelat" ;
AL95 : "SupplyAirFlow" ;
AL96 : "ExhaustAirFlow" ;
AL97 : "SupplyAirPress" ;
AL98 : "ExhaustAirPress" ;
AL99 : "HeatRFrostPress" ;
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM DigitalAlarm NAMED "Läs larm 80-99" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(02); % Modbus command "02h" read discrete input (bit)
DATA[2] := RWORD(79); % Start adress (80-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(02);
%DATA[2] = BYTE(3);
DATA[3] -> BYTE(
IF (DATA & 1) THEN AL80:= 1; ELSE AL80:= 0; ENDIF;
IF (DATA & 2) THEN AL81:= 1; ELSE AL81:= 0; ENDIF;
IF (DATA & 4) THEN AL82:= 1; ELSE AL82:= 0; ENDIF;
IF (DATA & 8) THEN AL83:= 1; ELSE AL83:= 0; ENDIF;
IF (DATA & 16) THEN AL84:= 1; ELSE AL84:= 0; ENDIF;
IF (DATA & 32) THEN AL85:= 1; ELSE AL85:= 0; ENDIF;
IF (DATA & 64) THEN AL86:= 1; ELSE AL86:= 0; ENDIF;
IF (DATA & 128) THEN AL87:= 1; ELSE AL87:= 0; ENDIF;
);
DATA[4] -> BYTE(
IF (DATA & 1) THEN AL88:= 1; ELSE AL88:= 0; ENDIF;
IF (DATA & 2) THEN AL89:= 1; ELSE AL89:= 0; ENDIF;
IF (DATA & 4) THEN AL90:= 1; ELSE AL90:= 0; ENDIF;
IF (DATA & 8) THEN AL91:= 1; ELSE AL91:= 0; ENDIF;
IF (DATA & 16) THEN AL92:= 1; ELSE AL92:= 0; ENDIF;
IF (DATA & 32) THEN AL93:= 1; ELSE AL93:= 0; ENDIF;
IF (DATA & 64) THEN AL94:= 1; ELSE AL94:= 0; ENDIF;
IF (DATA & 128) THEN AL95:= 1; ELSE AL95:= 0; ENDIF;
);
DATA[5] -> BYTE(
IF (DATA & 1) THEN AL96:= 1; ELSE AL96:= 0; ENDIF;
IF (DATA & 2) THEN AL97:= 1; ELSE AL97:= 0; ENDIF;
IF (DATA & 4) THEN AL98:= 1; ELSE AL98:= 0; ENDIF;
IF (DATA & 8) THEN AL99:= 1; ELSE AL99:= 0; ENDIF;
);
TIMEOUT 1000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for Climatrix, Indikation/Alarm inputs
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2010-08-18 initial version
%
DEVICETYPE ClimatrixAlarm NAMED "Climatrix Dig.6" TYPEID 21385 IS
PARAMETER
Id : "Adress";
PUBLIC
AL100 : "OutAirDamper" ; % 1x0100 Air quality
AL101 : "ExtracAirDamper" ; % 1x0101 External setpoint
AL102 : "FireDamperClose" ; % 1x0102 Roomunit 1
AL103 : "FireDamperOpen" ; % 1x0103 Roomunit 2
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM DigitalAlarm NAMED "Läs larm 100-103" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(02); % Modbus command "02h" read discrete input (bit)
DATA[2] := RWORD(99); % Start adress (100-1)
DATA[4] := RWORD(4); % Number of inputs
ANSWER SIZE 6 % ((Number of inputs / 8) + (Rest>0)) + 5
DATA[0] = BYTE(Id);
DATA[1] = HEX(02);
%DATA[2] = BYTE(1);
DATA[3] -> BYTE(
IF (DATA & 1) THEN AL100:= 1; ELSE AL100:= 0; ENDIF;
IF (DATA & 2) THEN AL101:= 1; ELSE AL101:= 0; ENDIF;
IF (DATA & 4) THEN AL102:= 1; ELSE AL102:= 0; ENDIF;
IF (DATA & 8) THEN AL103:= 1; ELSE AL103:= 0; ENDIF;
);
TIMEOUT 1000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for Climatrix Digital outputs
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Kvittera genom att öka kanalvärdet kopplat till "Kvittering".
% Om man har en checkbox (kryssruta) för att utföra kvittering går det kanske
% att koppla en logisk funktion som efter viss timeout ställer tillbaka
% kvitteringskanalen (och checkboxen). Den timeouten måste anpassas efter
% skriptets ställda uppdateringstid.
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2010-08-18 inital version
%
DEVICETYPE ClimatrixDigitalOut NAMED "Climatrix SetDU" TYPEID 21386 IS
PARAMETER
Id : "Adress";
Ack : "Acknowledge" ; % 0x01 Alarm acknowledge Off*On
%DU2 : "EnableComTest" ; % 0x02 Enable communicationtest No*Yes
%DU3 : "ComTestPuls" ; % 0x03 Communicationtest puls 0*1
%DU4 : "FireDamperTest" ; % 0x04 Fire damper test Passive*Active
%DU7 : "EnergyMeterRes."; % 0x07 Energymeeter reset partial Passive*ActiveTVal
%DU11 : "EmergencyStop" ; % 0x11 Emergency stop input Off*On, (I/O)
%DU12 : "ExternalIn1" ; % 0x12 External control input 1 Off*On, (I/O)
%DU13 : "ExternalIn2" ; % 0x13 External control input 2 Off*On, (I/O)
%DU14 : "Summer/Winter" ; % 0x14 Summer/Winter changeover input Winter*Summer,I/O
%DU15 : "FireAlarm" ; % 0x15 Fire alarm input OK*Alarm,I/O
PUBLIC
PRIVATE
Started;
AckMemory;
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>8 THEN Cnt:=0; ENDIF;
DATA := 6; % Digital reg 7
%IF Cnt=0 THEN DATA := 6; % Digital reg 7
%ELSIF Cnt=1 THEN DATA := 6; % Digital reg 7
%ELSIF Cnt=2 THEN DATA := 6; % Digital reg 7
%ELSIF Cnt=3 THEN DATA := 6; % Digital reg 7
%ELSIF Cnt=4 THEN DATA := 6; % Digital reg 7
%ELSIF Cnt=5 THEN DATA := 6; % Digital reg 7
%ELSIF Cnt=6 THEN DATA := 6; % Digital reg 7
%ELSIF Cnt=7 THEN DATA := 6; % Digital reg 7
%ELSIF Cnt=8 THEN DATA := 6; % Digital reg 7
%ENDIF;
);
DATA[4] <- RWORD(
IF Ack THEN DATA:=65280; ELSE DATA:=0; ENDIF;
%IF Cnt=0 THEN IF DO14 THEN DATA:=65280; ELSE DATA:=0; ENDIF;
%ELSIF Cnt=1 THEN IF DO14 THEN DATA:=65280; ELSE DATA:=0; ENDIF;
%ELSIF Cnt=2 THEN IF DO14 THEN DATA:=65280; ELSE DATA:=0; ENDIF;
%ELSIF Cnt=3 THEN IF DO14 THEN DATA:=65280; ELSE DATA:=0; ENDIF;
%ELSIF Cnt=4 THEN IF DO14 THEN DATA:=65280; ELSE DATA:=0; ENDIF;
%ELSIF Cnt=5 THEN IF DO14 THEN DATA:=65280; ELSE DATA:=0; ENDIF;
%ELSIF Cnt=6 THEN IF DO14 THEN DATA:=65280; ELSE DATA:=0; ENDIF;
%ELSIF Cnt=7 THEN IF DO14 THEN DATA:=65280; ELSE DATA:=0; ENDIF;
%ELSIF Cnt=8 THEN IF DO14 THEN DATA:=65280; ELSE DATA:=0; ENDIF;
%ENDIF;
);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = HEX(05);
TIMEOUT 1000
END;
TELEGRAM Acknowledge NAMED "Larmkvittering" IS
QUESTION
DATA[0] := BYTE(Id);
DATA[1] := HEX(05); %Write singel coil
DATA[2] <- RWORD(DATA := 0;); %Start adress (regnr-1)
DATA[4] <- RWORD(IF (Started = 0) THEN
AckMemory := Ack;
Started := 1;
ENDIF;
IF (Ack > AckMemory) THEN
DATA := 65280; % FF00h
ELSE
DATA := 0;
ENDIF;
AckMemory := Ack;
);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = HEX(05);
TIMEOUT 1000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for Climatrix 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 ClimatrixA1 NAMED "Climatrix Reg.1" TYPEID 21387 IS
PARAMETER
Id : "Adress";
PUBLIC
V1 : "Act.OperatMode" ;
V2 : "Act.FanStep" ;
V3 : "Man.OperatStep" ;
V4 : "Man.OperatSt/Te" ;
V5 : "Act.TimePrStep" ;
V6 : "Act.TimePrSt/Te" ;
V7 : "Act.OpmodeExtCt" ;
V8 : "FireDamperState" ;
V9 : "OutAirDamperCom" ;
V10 : "ExtAirDamperCom" ;
V11 : "FireDamperCom" ;
V12 : "SupplyFanCom" ;
V13 : "SupplyFanSignal" ["%"];
V14 : "ExhaustFanCom" ;
V15 : "ExhaustFanSigna" ["%"];
%V16 : "
V17 : "CoolOutSignal" ["%"];
V18 : "CoolPumpCom" ;
V19 : "CoolDXCom" ;
V20 : "HeatRec.Signal" ["%"];
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM AnalogInput NAMED "Läs reg. 17-36" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(04); % Modbus command "04h" Read registers
DATA[2] := RWORD(16); % Start address register (17-1)
DATA[4] := RWORD(20); % Number of registers
ANSWER SIZE 45 % (Number of registers * 2) + 5
DATA[0] = BYTE(Id); % ID
DATA[1] = HEX(04); % Modbus command "04h" Read registers
%DATA[2] = BYTE(40); % Byte count
DATA[3] -> RWORD(V1 := DATA;);
DATA[5] -> RWORD(V2 := DATA;);
DATA[7] -> RWORD(V3 := DATA;);
DATA[9] -> RWORD(V4 := DATA;);
DATA[11] -> RWORD(V5 := DATA;);
DATA[13] -> RWORD(V6 := DATA;);
DATA[15] -> RWORD(V7 := DATA;);
DATA[17] -> RWORD(V8 := DATA;);
DATA[19] -> RWORD(V9 := DATA;);
DATA[21] -> RWORD(V10:= DATA;);
DATA[23] -> RWORD(V11:= DATA;);
DATA[25] -> RWORD(V12:= DATA;);
DATA[27] -> RWORD(V13:= DATA;);
DATA[29] -> RWORD(V14:= DATA;);
DATA[31] -> RWORD(V15:= DATA;);
%DATA[33] -> RWORD(V16:= DATA;);
DATA[35] -> RWORD(V17:= DATA;);
DATA[37] -> RWORD(V18:= DATA;);
DATA[39] -> RWORD(V19:= DATA;);
DATA[41] -> RWORD(V20:= DATA;);
TIMEOUT 1000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for Climatrix 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 ClimatrixA2 NAMED "Climatrix Reg.2" TYPEID 21388 IS
PARAMETER
Id : "Adress";
PUBLIC
V1 : "HeatRec.PumpCom" ;
V2 : "HeatDamperSigna" ["%"];
V3 : "HeatDamperValue" ["%"];
V4 : "HeatSignal" ["%"];
V5 : "HeatPumpCom." ;
V6 : "El.HeatSignal" ["%"];
V7 : "El.HeatCom." ;
V8 : "Cool2Signal" ["%"];
V9 : "Cool2PumpCom." ;
V10 : "Cool2DXCom." ;
V11 : "Heat2Ssignal" ["%"];
V12 : "Heat2PumpCom." ;
V13 : "El.Heat2Signal" ["%"];
V14 : "El.Heat2Com." ;
%V15 : ""
V16 : "HumiditySignal" ["%"];
V17 : "HumidityCom." ;
V18 : "HumidityPumpCom" ;
V19 : "DehumidityValue" ["%"];
%V20 : "" ;
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM AnalogInput NAMED "Läs reg. 37-56" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(04); % Modbus command "04h" Read registers
DATA[2] := RWORD(36); % Start address register (37-1)
DATA[4] := RWORD(20); % Number of registers
ANSWER SIZE 45 % (Number of registers * 2) + 5
DATA[0] = BYTE(Id); % ID
DATA[1] = HEX(04); % Modbus command "04h" Read registers
%DATA[2] = BYTE(40); % Byte count
DATA[3] -> RWORD(V1 := DATA;);
DATA[5] -> RWORD(V2 := DATA;);
DATA[7] -> RWORD(V3 := DATA;);
DATA[9] -> RWORD(V4 := DATA;);
DATA[11] -> RWORD(V5 := DATA;);
DATA[13] -> RWORD(V6 := DATA;);
DATA[15] -> RWORD(V7 := DATA;);
DATA[17] -> RWORD(V8 := DATA;);
DATA[19] -> RWORD(V9 := DATA;);
DATA[21] -> RWORD(V10:= DATA;);
DATA[23] -> RWORD(V11:= DATA;);
DATA[25] -> RWORD(V12:= DATA;);
DATA[27] -> RWORD(V13:= DATA;);
DATA[29] -> RWORD(V14:= DATA;);
%DATA[31] -> RWORD(V15:= DATA;);
DATA[33] -> RWORD(V16:= DATA;);
DATA[35] -> RWORD(V17:= DATA;);
DATA[37] -> RWORD(V18:= DATA;);
DATA[39] -> RWORD(V19:= DATA;);
%DATA[41] -> RWORD(V20:= DATA;);
TIMEOUT 1000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for Climatrix 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 ClimatrixA3 NAMED "Climatrix Reg.3" TYPEID 21389 IS
PARAMETER
Id : "Adress";
PUBLIC
V1 : "AuxOperatMode" ;
V2 : "AuxTimeSwProg" ;
V3 : "AuxAnalogFan" ["%"];
V4 : "AlarmOutput1" ;
V5 : "AlarmOutput2" ;
%V6 : ""
%V7 : ""
V8 : "ActAirQualiComp" ["%"];
V9 : "ActFanCoolValue" ["%"];
V10 : "ActFanHeatValue" ["%"];
V11 : "ActFanCompTemp" ["%"];
V12 : "ActFanCompHumid" ["%"];
V13 : "SummerCompFan" ["%"];
V14 : "WinterCompFan" ["%"];
V15 : "OutAirTemp" ["°C"];
V16 : "SupplyAirTemp" ["°C"];
V17 : "HeatFrostTemp" ["°C"];
V18 : "Act.RoomTemp" ["°C"];
V19 : "ExhaustAirTemp" ["°C"];
%V20 : "" ;
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM AnalogInput NAMED "Läs reg. 57-76" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(04); % Modbus command "04h" Read registers
DATA[2] := RWORD(56); % Start address register (57-1)
DATA[4] := RWORD(20); % Number of registers
ANSWER SIZE 45 % (Number of registers * 2) + 5
DATA[0] = BYTE(Id); % ID
DATA[1] = HEX(04); % Modbus command "04h" Read registers
%DATA[2] = BYTE(40); % Byte count
DATA[3] -> RWORD(V1 := DATA;);
DATA[5] -> RWORD(V2 := DATA;);
DATA[7] -> RWORD(V3 := DATA;);
DATA[9] -> RWORD(V4 := DATA;);
DATA[11] -> RWORD(V5 := DATA;);
%DATA[13] -> RWORD(V6 := DATA;);
%DATA[15] -> RWORD(V7 := DATA;);
DATA[17] -> RWORD(V8 := DATA;);
DATA[19] -> RWORD(V9 := DATA;);
DATA[21] -> RWORD(V10:= DATA;);
DATA[23] -> RWORD(V11:= DATA;);
DATA[25] -> RWORD(V12:= DATA;);
DATA[27] -> RWORD(V13:= DATA;);
DATA[29] -> RWORD(V14:= DATA;);
DATA[31] -> RWORD(IF (DATA>=32768) THEN V15:=(DATA-65536)/10; ELSE V15:=DATA/10; ENDIF;);
DATA[33] -> RWORD(IF (DATA>=32768) THEN V16:=(DATA-65536)/10; ELSE V16:=DATA/10; ENDIF;);
DATA[35] -> RWORD(IF (DATA>=32768) THEN V17:=(DATA-65536)/10; ELSE V17:=DATA/10; ENDIF;);
DATA[37] -> RWORD(IF (DATA>=32768) THEN V18:=(DATA-65536)/10; ELSE V18:=DATA/10; ENDIF;);
DATA[39] -> RWORD(IF (DATA>=32768) THEN V19:=(DATA-65536)/10; ELSE V19:=DATA/10; ENDIF;);
%DATA[41] -> RWORD(V20:= DATA;);
TIMEOUT 1000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for Climatrix 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 ClimatrixA4 NAMED "Climatrix Reg.4" TYPEID 21390 IS
PARAMETER
Id : "Adress";
PUBLIC
V1 : "ExtractAirTemp" ["°C"] ;
V2 : "HeatRSupplyTemp" ["°C"] ;
V3 : "HeatRWaterTemp" ["°C"] ;
V4 : "SupplyAirTemp2" ["°C"] ;
V5 : "Heat2FrostTemp" ["°C"] ;
V6 : "AuxiliaryTemp" ["°C"] ;
%V7 : "" ;
V8 : "OutAirHumRelat" ["%rH"] ;
V9 : "OutAirHumAbsol" ["g/kg"] ;
V10 : "OutAirEnthalpy" ["kJ/kg"];
V11 : "SuppAirHumRel" ["%rH"] ;
V12 : "SuppAirHumAbs" ["g/kg"] ;
V13 : "SuppAirEnthal" ["kJ/kg"];
V14 : "RoomHumidityRel" ["%rH"] ;
V15 : "RoomHumidityAbs" ["g/kg"] ;
V16 : "RoomEnthalpy" ["kJ/kg"];
V17 : "DewPoint" ["°C"] ;
%V18 : "" ;
V19 : "SupplyAirFlow" ["l/s"] ;
V20 : "ExhaustAirFlow" ["l/s"] ;
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM AnalogInput NAMED "Läs reg.77-96" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(04); % Modbus command "04h" Read registers
DATA[2] := RWORD(76); % Start address register (77-1)
DATA[4] := RWORD(20); % Number of registers
ANSWER SIZE 45 % (Number of registers * 2) + 5
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 V1 :=(DATA-65536)/10; ELSE V1 :=DATA/10; ENDIF;);
DATA[5] -> RWORD(IF (DATA>=32768) THEN V2 :=(DATA-65536)/10; ELSE V2 :=DATA/10; ENDIF;);
DATA[7] -> RWORD(IF (DATA>=32768) THEN V3 :=(DATA-65536)/10; ELSE V3 :=DATA/10; ENDIF;);
DATA[9] -> RWORD(IF (DATA>=32768) THEN V4 :=(DATA-65536)/10; ELSE V4 :=DATA/10; ENDIF;);
DATA[11] -> RWORD(IF (DATA>=32768) THEN V5 :=(DATA-65536)/10; ELSE V5 :=DATA/10; ENDIF;);
DATA[13] -> RWORD(IF (DATA>=32768) THEN V6 :=(DATA-65536)/10; ELSE V6 :=DATA/10; ENDIF;);
%DATA[15] -> RWORD(V7 := DATA;);
DATA[17] -> RWORD(V8 := DATA;);
DATA[19] -> RWORD(IF (DATA>=32768) THEN V9 :=(DATA-65536)/10; ELSE V9 :=DATA/10; ENDIF;);
DATA[21] -> RWORD(IF (DATA>=32768) THEN V10:=(DATA-65536)/10; ELSE V10:=DATA/10; ENDIF;);
DATA[23] -> RWORD(V11:= DATA;);
DATA[25] -> RWORD(IF (DATA>=32768) THEN V12:=(DATA-65536)/10; ELSE V12:=DATA/10; ENDIF;);
DATA[27] -> RWORD(IF (DATA>=32768) THEN V13:=(DATA-65536)/10; ELSE V13:=DATA/10; ENDIF;);
DATA[29] -> RWORD(V14:= DATA;);
DATA[31] -> RWORD(IF (DATA>=32768) THEN V15:=(DATA-65536)/10; ELSE V15:=DATA/10; ENDIF;);
DATA[33] -> RWORD(IF (DATA>=32768) THEN V16:=(DATA-65536)/10; ELSE V16:=DATA/10; ENDIF;);
DATA[35] -> RWORD(IF (DATA>=32768) THEN V17:=(DATA-65536)/10; ELSE V17:=DATA/10; ENDIF;);
%DATA[37] -> RWORD(V18:= DATA;);
DATA[39] -> RWORD(V19:= DATA;);
DATA[41] -> RWORD(V20:= DATA;);
TIMEOUT 1000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for Climatrix 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 ClimatrixA5 NAMED "Climatrix Reg.5" TYPEID 21391 IS
PARAMETER
Id : "Adress";
PUBLIC
V1 : "SupAirPressure" ["Pa"] ;
V2 : "ExhAirPressure" ["Pa"] ;
V3 : "HeatRFrostPress" ["Pa"] ;
%V4 : "" ;
V5 : "AirQuality" ["ppm"];
V6 : "ExternSetpoint" ["°C"] ;
%V7 : "" ;
V8 : "MainHeatSetP" ["°C"] ;
V9 : "MainCoolSetP" ["°C"] ;
V10 : "SuppHeatSetP" ["°C"] ;
V11 : "SuppCoolSetP" ["°C"] ;
V12 : "MainHumidiSetP" ["%rH"];
V13 : "MainDehumidSetP" ["%rH"];
V14 : "SuppHumidiSetP" ["%rH"];
V15 : "SuppDehumidSetP" ["%rH"];
V16 : "SuppFanSetP" ["%"] ;
V17 : "ExhaustFanSetP" ["%"] ;
%V18 : " ;
V19 : "SummerCompTemp" ["°C"] ;
V20 : "WinterCompTemp" ["°C"] ;
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM AnalogInput NAMED "Läs reg.97-116" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(04); % Modbus command "04h" Read registers
DATA[2] := RWORD(96); % Start address register (97-1)
DATA[4] := RWORD(20); % Number of registers
ANSWER SIZE 45 % (Number of registers * 2) + 5
DATA[0] = BYTE(Id); % ID
DATA[1] = HEX(04); % Modbus command "04h" Read registers
%DATA[2] = BYTE(40); % Byte count
DATA[3] -> RWORD(V1 := DATA;);
DATA[5] -> RWORD(V2 := DATA;);
DATA[7] -> RWORD(V3 := DATA;);
%DATA[9] -> RWORD(V4 := DATA;);
DATA[11] -> RWORD(V5 := DATA;);
DATA[13] -> RWORD(IF (DATA>=32768) THEN V6 :=(DATA-65536)/10; ELSE V6 :=DATA/10; ENDIF;);
%DATA[15] -> RWORD(V7 := DATA;);
DATA[17] -> RWORD(IF (DATA>=32768) THEN V8 :=(DATA-65536)/10; ELSE V8 :=DATA/10; ENDIF;);
DATA[19] -> RWORD(IF (DATA>=32768) THEN V9 :=(DATA-65536)/10; ELSE V9 :=DATA/10; ENDIF;);
DATA[21] -> RWORD(IF (DATA>=32768) THEN V10:=(DATA-65536)/10; ELSE V10:=DATA/10; ENDIF;);
DATA[23] -> RWORD(IF (DATA>=32768) THEN V11:=(DATA-65536)/10; ELSE V11:=DATA/10; ENDIF;);
DATA[25] -> RWORD(IF (DATA>=32768) THEN V12:=(DATA-65536)/10; ELSE V12:=DATA/10; ENDIF;);
DATA[27] -> RWORD(IF (DATA>=32768) THEN V13:=(DATA-65536)/10; ELSE V13:=DATA/10; ENDIF;);
DATA[29] -> RWORD(IF (DATA>=32768) THEN V14:=(DATA-65536)/10; ELSE V14:=DATA/10; ENDIF;);
DATA[31] -> RWORD(IF (DATA>=32768) THEN V15:=(DATA-65536)/10; ELSE V15:=DATA/10; ENDIF;);
DATA[33] -> RWORD(V16:= DATA;);
DATA[35] -> RWORD(V17:= DATA;);
%DATA[37] -> RWORD(V18:= DATA;);
DATA[39] -> RWORD(IF (DATA>=32768) THEN V19:=(DATA-65536)/10; ELSE V19:=DATA/10; ENDIF;);
DATA[41] -> RWORD(IF (DATA>=32768) THEN V20:=(DATA-65536)/10; ELSE V20:=DATA/10; ENDIF;);
TIMEOUT 1000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for Climatrix 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 ClimatrixA6 NAMED "Climatrix Reg.6" TYPEID 21392 IS
PARAMETER
Id : "Adress";
PUBLIC
V1 : "HeatRec.PumpCom" ;
V2 : "HeatDamperSigna" ["%"];
%V3 : "" ;
V4 : "HeatDamperValue" ["%"];
V5 : "HeatSignal" ["%"];
V6 : "HeatPumpCom." ;
V7 : "El.HeatSignal" ["%"];
V8 : "El.HeatCom." ;
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM AnalogInput NAMED "Läs reg 117-124" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(04); % Modbus command "04h" Read registers
DATA[2] := RWORD(116); % Start address register (117-1)
DATA[4] := RWORD(8); % Number of registers
ANSWER SIZE 21 % (Number of registers * 2) + 5
DATA[0] = BYTE(Id); % ID
DATA[1] = HEX(04); % Modbus command "04h" Read registers
%DATA[2] = BYTE(16); % Byte count
DATA[3] -> RWORD(V1 := DATA;);
DATA[5] -> RWORD(V2 := DATA;);
%DATA[7] -> RWORD(V3 := DATA;);
DATA[9] -> RWORD(V4 :=DATA/10;);
DATA[11] -> RWORD(V5 :=DATA/10;);
DATA[13] -> RWORD(V6 :=DATA/10;);
DATA[15] -> RWORD(V7 :=DATA/10;);
DATA[17] -> RWORD(V8 :=DATA/10;);
TIMEOUT 1000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for Climatrix 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 ClimatrixA7 NAMED "Climatrix Reg.7" TYPEID 21393 IS
PARAMETER
Id : "Adress";
PUBLIC
V1 : "HeatRec.PumpCom" ;
V2 : "HeatDamperSigna" ["K/°C"];
V3 : "HeatDamperValue" ["°C"] ;
V4 : "HeatSignal" ["°C"] ;
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM AnalogInput NAMED "Läs reg.200-203" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(04); % Modbus command "04h" Read registers
DATA[2] := RWORD(199); % Start address register (200-1)
DATA[4] := RWORD(4); % Number of registers
ANSWER SIZE 13 % (Number of registers * 2) + 5
DATA[0] = BYTE(Id); % ID
DATA[1] = HEX(04); % Modbus command "04h" Read registers
%DATA[2] = BYTE(8); % Byte count
DATA[3] -> RWORD(V1 := DATA;);
DATA[5] -> RWORD(IF (DATA>=32768) THEN V2:=(DATA-65536)/10; ELSE V2:=DATA/10; ENDIF;);
DATA[7] -> RWORD(IF (DATA>=32768) THEN V3:=(DATA-65536)/10; ELSE V3:=DATA/10; ENDIF;);
DATA[9] -> RWORD(IF (DATA>=32768) THEN V4:=(DATA-65536)/10; ELSE V4:=DATA/10; ENDIF;);
TIMEOUT 1000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for Climatrix Analog settings
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2010-08-18 inital version
%
DEVICETYPE ClimatrixSet NAMED "Climatrix Ställ" TYPEID 21294 IS
PARAMETER
Id : "Adress";
S20 : "ComfortTempSetP" ["°C"] ; % 4x0020 Comfort temperature setpoint -+ °C (factor 10)
PUBLIC
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)
IF Cnt>8 THEN Cnt:=0; ENDIF;
%% Adress=Register-1
IF Cnt=0 THEN DATA := 19; % S20
ELSIF Cnt=1 THEN DATA := 19; % S20
ELSIF Cnt=2 THEN DATA := 19; % S20
ELSIF Cnt=3 THEN DATA := 19; % S20
ELSIF Cnt=4 THEN DATA := 19; % S20
ELSIF Cnt=5 THEN DATA := 19; % S20
ELSIF Cnt=6 THEN DATA := 19; % S20
ELSIF Cnt=7 THEN DATA := 19; % S20
ELSE DATA := 19; % S20
ENDIF;
);
DATA[4] <- RWORD(
IF Cnt=0 THEN
IF S20<10 THEN DATA := 100; % S20 Comfort temperature setpoint 1/10
ELSIF S20>30 THEN DATA := 300;
ELSE DATA := S20;
ENDIF;
ELSIF Cnt=1 THEN
IF S20<10 THEN DATA := 100; % S20 Comfort temperature setpoint 1/10
ELSIF S20>30 THEN DATA := 300;
ELSE DATA := S20;
ENDIF;
ELSIF Cnt=2 THEN
IF S20<10 THEN DATA := 100; % S20 Comfort temperature setpoint 1/10
ELSIF S20>30 THEN DATA := 300;
ELSE DATA := S20;
ENDIF;
ELSIF Cnt=3 THEN
IF S20<10 THEN DATA := 100; % S20 Comfort temperature setpoint 1/10
ELSIF S20>30 THEN DATA := 300;
ELSE DATA := S20;
ENDIF;
ELSIF Cnt=4 THEN
IF S20<10 THEN DATA := 100; % S20 Comfort temperature setpoint 1/10
ELSIF S20>30 THEN DATA := 300;
ELSE DATA := S20;
ENDIF;
ELSIF Cnt=5 THEN
IF S20<10 THEN DATA := 100; % S20 Comfort temperature setpoint 1/10
ELSIF S20>30 THEN DATA := 300;
ELSE DATA := S20;
ENDIF;
ELSIF Cnt=6 THEN
IF S20<10 THEN DATA := 100; % S20 Comfort temperature setpoint 1/10
ELSIF S20>30 THEN DATA := 300;
ELSE DATA := S20;
ENDIF;
ELSIF Cnt=7 THEN
IF S20<10 THEN DATA := 100; % S20 Comfort temperature setpoint 1/10
ELSIF S20>30 THEN DATA := 300;
ELSE DATA := S20;
ENDIF;
ELSE
IF S20<10 THEN DATA := 100; % S20 Comfort temperature setpoint 1/10
ELSIF S20>30 THEN DATA := 300;
ELSE DATA := S20;
ENDIF;
ENDIF;
Cnt := Cnt + 1;
IF Cnt>8 THEN Cnt := 0;
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.