Regin CORRIGO FC3/FC5 Regulatorer
Detaljer
- Typ
- Drivrutin
- Upplaggd av
- Ove Jansson, Abelko Innovation
- Version
- 1
- Uppdaterad
- 2013-08-28
- Skapad
- 2013-08-28
- Kategori
- Modbus, Övrig utrustning, Ventilation
- Visningar
- 2711
Beskrivning
Drivrutin baserad på Användar- & Installationshandbok Reglercentral Corrigo FC3 & FC5 2007
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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% History:
% 100201 Fixat beräkning av negativa temperaturer
% 100408 Fixat tryckmätning skall ha en faktor 5 (1/0.2) istället för 1/10.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for CORRIGO FC3/FC5 Analog inputs/outputs
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Note! Telegram for reading Analog status AI and AO
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2007-12-17 inital version
%
DEVICETYPE CorrigoAnalog NAMED "Corrigo AI/AU" TYPEID 21180 IS
PARAMETER
Id : "Adress";
PUBLIC
%NoOfFans : "Antal fläktar";
AI1 : "Utetemperatur" ["°C"];
AI2 : "Tryck 1" ["Pa"];
AI3 : "Tryck 2" ["Pa"];
AI4 : "Tryck 3" ["Pa"];
AI5 : "Tryck 4" ["Pa"];
AI6 : "Tryck 5" ["Pa"];
AI7 : "Temp 1" ["°C"];
AI8 : "Temp 2" ["°C"];
AO1 : "AU Fläkt 1" ["V"];
AO2 : "AU Fläkt 2" ["V"];
AO3 : "AU Fläkt 3" ["V"];
AO4 : "AU Fläkt 4" ["V"];
AO5 : "AU Fläkt 5" ["V"];
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM AnalogInput NAMED "Analog status" 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 2 (-1)
DATA[4] := RWORD(14); % Number of registers
ANSWER SIZE 33
DATA[0] = BYTE(Id); % ID
DATA[1] = HEX(04); % Modbus command "04h" Read registers
DATA[2] = BYTE(28); % Byte count
DATA[3] -> RWORD(NoOfFans := DATA;); % Number of active Fans
DATA[5] -> RWORD(IF (DATA>=32768) THEN AI1 :=(DATA-65536)/10; ELSE AI1 :=DATA/10; ENDIF;); % Outdoor temp (°C)
DATA[7] -> RWORD(AI2 := DATA / 0.2;); % Pressure 1 (Pa)
DATA[9] -> RWORD(AI3 := DATA / 0.2;); % Pressure 2 (Pa)
DATA[11] -> RWORD(AI4 := DATA / 0.2;); % Pressure 3 (Pa)
DATA[13] -> RWORD(AI5 := DATA / 0.2;); % Pressure 4 (Pa)
DATA[15] -> RWORD(AI6 := DATA / 0.2;); % Pressure 5 (Pa)
DATA[17] -> RWORD(IF (DATA>=32768) THEN AI7 :=(DATA-65536)/10; ELSE AI7 :=DATA/10; ENDIF;); % Temp 1 (°C)
DATA[19] -> RWORD(IF (DATA>=32768) THEN AI8 :=(DATA-65536)/10; ELSE AI8 :=DATA/10; ENDIF;); % Temp 1 (°C)
DATA[21] -> RWORD(AO1 := DATA / 10;); % Fan 1 output (V)
DATA[23] -> RWORD(AO2 := DATA / 10;); % Fan 2 output (V)
DATA[25] -> RWORD(AO3 := DATA / 10;); % Fan 3 output (V)
DATA[27] -> RWORD(AO4 := DATA / 10;); % Fan 4 output (V)
DATA[29] -> RWORD(AO5 := DATA / 10;); % Fan 5 output (V)
TIMEOUT 2000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for CORRIGO FC3/FC5, Digtal inputs
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Note! Telegram for reading Digital status DI and DO
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2007-12-17 inital version
%
DEVICETYPE CorrigoDigital NAMED "Corrigo DI/DU" TYPEID 21181 IS
PARAMETER
Id : "Adress";
PUBLIC
DI1 : "DI Forcerat BV";
DI2 : "DI Ext.stopp 1";
DI3 : "DI Ext.stopp 2";
DI4 : "DI Ext.stopp 3";
DI5 : "DI Ext.stopp 4";
DI6 : "DI Ext.stopp 5";
DO1 : "DU SummaLarm";
DO2 : "DU Larm Fläkt1";
DO3 : "DU Larm Fläkt2";
DO4 : "DU Larm Fläkt3";
DO5 : "DU Larm Fläkt4";
DO6 : "DU Larm Fläkt5";
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM DigitalInput NAMED "Digital status" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(02); % Modbus command "02h" read discrete input (bit)
DATA[2] := RWORD(1); % Start adress
DATA[4] := RWORD(12); % 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 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 DO1 := 1; ELSE DO1 := 0; ENDIF;
IF (DATA & 128) THEN DO2 := 1; ELSE DO2 := 0; ENDIF;
);
DATA[4] -> BYTE(IF (DATA & 1) THEN DO3 := 1; ELSE DO3 := 0; ENDIF;
IF (DATA & 2) THEN DO4 := 1; ELSE DO4 := 0; ENDIF;
IF (DATA & 4) THEN DO5 := 1; ELSE DO5 := 0; ENDIF;
IF (DATA & 8) THEN DO6 := 1; ELSE DO6 := 0; ENDIF;
);
TIMEOUT 2000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for CORRIGO FC3/FC5, Alarm inputs
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Note! Telegram for reading Alarm inputs
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2007-12-17 inital version
%
DEVICETYPE CorrigoAlarm NAMED "Corrigo Larm" TYPEID 21182 IS
PARAMETER
Id : "Adress";
PUBLIC
AReg1 : "Larm Reg. 1";
AReg2 : "Larm Reg. 2";
AReg3 : "Larm Reg. 3";
AReg4 : "Larm Reg. 4";
AReg5 : "Larm Reg. 5";
ASens0 : "Larm Giv.TempUt";
ASens1 : "Larm Giv.Tryck1";
ASens2 : "Larm Giv.Tryck2";
ASens3 : "Larm Giv.Tryck3";
ASens4 : "Larm Giv.Tryck4";
ASens5 : "Larm Giv.Tryck5";
AStop1 : "Larm Ext.Stopp1";
AStop2 : "Larm Ext.Stopp2";
AStop3 : "Larm Ext.Stopp3";
AStop4 : "Larm Ext.Stopp4";
AStop5 : "Larm Ext.Stopp5";
ALSens1 : "Larm Giv.Logg1";
ALSens2 : "Larm Giv.Logg2";
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM DigitalAlarm NAMED "Larm status" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(02); % Modbus command "02h" read discrete input (bit)
DATA[2] := RWORD(50); % Start adress
DATA[4] := RWORD(18); % 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 AReg1 := 1; ELSE AReg1 := 0; ENDIF;
IF (DATA & 2) THEN AReg2 := 1; ELSE AReg2 := 0; ENDIF;
IF (DATA & 4) THEN AReg3 := 1; ELSE AReg3 := 0; ENDIF;
IF (DATA & 8) THEN AReg4 := 1; ELSE AReg4 := 0; ENDIF;
IF (DATA & 16) THEN AReg5 := 1; ELSE AReg5 := 0; ENDIF;
IF (DATA & 32) THEN ASens0 := 1; ELSE ASens0 := 0; ENDIF;
IF (DATA & 64) THEN ASens1 := 1; ELSE ASens1 := 0; ENDIF;
IF (DATA & 128) THEN ASens2 := 1; ELSE ASens2 := 0; ENDIF;
);
DATA[4] -> BYTE(IF (DATA & 1) THEN ASens3 := 1; ELSE ASens3 := 0; ENDIF;
IF (DATA & 2) THEN ASens4 := 1; ELSE ASens4 := 0; ENDIF;
IF (DATA & 4) THEN ASens5 := 1; ELSE ASens5 := 0; ENDIF;
IF (DATA & 8) THEN AStop1 := 1; ELSE AStop1 := 0; ENDIF;
IF (DATA & 16) THEN AStop2 := 1; ELSE AStop2 := 0; ENDIF;
IF (DATA & 32) THEN AStop3 := 1; ELSE AStop3 := 0; ENDIF;
IF (DATA & 64) THEN AStop4 := 1; ELSE AStop4 := 0; ENDIF;
IF (DATA & 128) THEN AStop5 := 1; ELSE AStop5 := 0; ENDIF;
);
DATA[5] -> BYTE(IF (DATA & 1) THEN ALSens1 := 1; ELSE ALSens1 := 0; ENDIF;
IF (DATA & 2) THEN ALSens2 := 1; ELSE ALSens2 := 0; ENDIF;
);
TIMEOUT 2000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for CORRIGO FC3/FC5 Selected inputs
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Note! Telegram for reading Selected inputs in several telegrams
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2007-12-20 inital version
%
DEVICETYPE CorrigoSelect NAMED "Corrigo valbar" TYPEID 21183 IS
PARAMETER
Id : "Adress";
PUBLIC
%NoOfFans : "Antal fläktar";
AI1 : "Utetemperatur" ["°C"];
%AI2 : "Tryck 1" ["Pa"];
%AI3 : "Tryck 2" ["Pa"];
%AI4 : "Tryck 3" ["Pa"];
%AI5 : "Tryck 4" ["Pa"];
%AI6 : "Tryck 5" ["Pa"];
%AI7 : "Temp 1" ["°C"];
%AI8 : "Temp 2" ["°C"];
%AO1 : "AU Fläkt 1" ["V"];
%AO2 : "AU Fläkt 2" ["V"];
%AO3 : "AU Fläkt 3" ["V"];
%AO4 : "AU Fläkt 4" ["V"];
%AO5 : "AU Fläkt 5" ["V"];
DI1 : "DI Forcerat BV";
%DI2 : "DI Ext.stopp 1";
%DI3 : "DI Ext.stopp 2";
%DI4 : "DI Ext.stopp 3";
%DI5 : "DI Ext.stopp 4";
%DI6 : "DI Ext.stopp 5";
%DO1 : "DU SummaLarm";
%DO2 : "DU Larm Fläkt1";
%DO3 : "DU Larm Fläkt2";
%DO4 : "DU Larm Fläkt3";
%DO5 : "DU Larm Fläkt4";
%DO6 : "DU Larm Fläkt5";
AReg1 : "Larm Reg. 1";
%AReg2 : "Larm Reg. 2";
%AReg3 : "Larm Reg. 3";
%AReg4 : "Larm Reg. 4";
%AReg5 : "Larm Reg. 5";
%ASens0 : "Larm Giv.TempUt";
%ASens1 : "Larm Giv.Tryck1";
%ASens2 : "Larm Giv.Tryck2";
%ASens3 : "Larm Giv.Tryck3";
%ASens4 : "Larm Giv.Tryck4";
%ASens5 : "Larm Giv.Tryck5";
%AStop1 : "Larm Ext.Stopp1";
%AStop2 : "Larm Ext.Stopp2";
%AStop3 : "Larm Ext.Stopp3";
%AStop4 : "Larm Ext.Stopp4";
%AStop5 : "Larm Ext.Stopp5";
%ALSens1 : "Larm Giv.Logg1";
%ALSens2 : "Larm Giv.Logg2";
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM AnalogSelect NAMED "Analog valbar" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(04); % Modbus command "04h" Read registers
DATA[2] := RWORD(1); % Start address register 2 (-1)
DATA[4] := RWORD(13); % Number of registers
ANSWER SIZE 31
DATA[0] = BYTE(Id); % ID
DATA[1] = HEX(04); % Modbus command "04h" Read registers
DATA[2] = BYTE(26); % Byte count
DATA[3] -> RWORD(IF (DATA>=32768) THEN AI1 :=(DATA-65536)/10; ELSE AI1 :=DATA/10; ENDIF;); % Outdoor temp (°C)
%DATA[5] -> RWORD(AI2 := DATA / 10;); % Pressure 1 (Pa)
%DATA[7] -> RWORD(AI3 := DATA / 10;); % Pressure 2 (Pa)
%DATA[9] -> RWORD(AI4 := DATA / 10;); % Pressure 3 (Pa)
%DATA[11] -> RWORD(AI5 := DATA / 10;); % Pressure 4 (Pa)
%DATA[13] -> RWORD(AI6 := DATA / 10;); % Pressure 5 (Pa)
%DATA[15] -> RWORD(IF (DATA>=32768) THEN AI7 :=(DATA-65536)/10; ELSE AI7 :=DATA/10; ENDIF;); % Temp 1 (°C)
%DATA[17] -> RWORD(IF (DATA>=32768) THEN AI8 :=(DATA-65536)/10; ELSE AI8 :=DATA/10; ENDIF;); % Temp 1 (°C)
%DATA[19] -> RWORD(AO1 := DATA / 10;); % Fan 1 output (V)
%DATA[21] -> RWORD(AO2 := DATA / 10;); % Fan 2 output (V)
%DATA[23] -> RWORD(AO3 := DATA / 10;); % Fan 3 output (V)
%DATA[25] -> RWORD(AO4 := DATA / 10;); % Fan 4 output (V)
%DATA[27] -> RWORD(AO5 := DATA / 10;); % Fan 5 output (V)
TIMEOUT 2000
END;
TELEGRAM DigitalSelect NAMED "Digital valbar" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(02); % Modbus command "02h" read discrete input (bit)
DATA[2] := RWORD(1); % Start adress
DATA[4] := RWORD(12); % 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 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 DO1 := 1; ELSE DO1 := 0; ENDIF;
% IF (DATA & 128) THEN DO2 := 1; ELSE DO2 := 0; ENDIF;
);
%DATA[4] -> BYTE(IF (DATA & 1) THEN DO3 := 1; ELSE DO3 := 0; ENDIF;
% IF (DATA & 2) THEN DO4 := 1; ELSE DO4 := 0; ENDIF;
% IF (DATA & 4) THEN DO5 := 1; ELSE DO5 := 0; ENDIF;
% IF (DATA & 8) THEN DO6 := 1; ELSE DO6 := 0; ENDIF;
% );
TIMEOUT 2000
END;
TELEGRAM AlarmSelect NAMED "Larm valbar" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(02); % Modbus command "02h" read discrete input (bit)
DATA[2] := RWORD(50); % Start adress
DATA[4] := RWORD(18); % 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 AReg1 := 1; ELSE AReg1 := 0; ENDIF;
% IF (DATA & 2) THEN AReg2 := 1; ELSE AReg2 := 0; ENDIF;
% IF (DATA & 4) THEN AReg3 := 1; ELSE AReg3 := 0; ENDIF;
% IF (DATA & 8) THEN AReg4 := 1; ELSE AReg4 := 0; ENDIF;
% IF (DATA & 16) THEN AReg5 := 1; ELSE AReg5 := 0; ENDIF;
% IF (DATA & 32) THEN ASens0 := 1; ELSE ASens0 := 0; ENDIF;
% IF (DATA & 64) THEN ASens1 := 1; ELSE ASens1 := 0; ENDIF;
% IF (DATA & 128) THEN ASens2 := 1; ELSE ASens2 := 0; ENDIF;
);
%DATA[4] -> BYTE(IF (DATA & 1) THEN ASens3 := 1; ELSE ASens3 := 0; ENDIF;
% IF (DATA & 2) THEN ASens4 := 1; ELSE ASens4 := 0; ENDIF;
% IF (DATA & 4) THEN ASens5 := 1; ELSE ASens5 := 0; ENDIF;
% IF (DATA & 8) THEN AStop1 := 1; ELSE AStop1 := 0; ENDIF;
% IF (DATA & 16) THEN AStop2 := 1; ELSE AStop2 := 0; ENDIF;
% IF (DATA & 32) THEN AStop3 := 1; ELSE AStop3 := 0; ENDIF;
% IF (DATA & 64) THEN AStop4 := 1; ELSE AStop4 := 0; ENDIF;
% IF (DATA & 128) THEN AStop5 := 1; ELSE AStop5 := 0; ENDIF;
% );
%
%DATA[5] -> BYTE(IF (DATA & 1) THEN ALSens1 := 1; ELSE ALSens1 := 0; ENDIF;
% IF (DATA & 2) THEN ALSens2 := 1; ELSE ALSens2 := 0; ENDIF;
% );
TIMEOUT 2000
END;
END;
% History:
% 100201 Fixat beräkning av negativa temperaturer
% 100408 Fixat tryckmätning skall ha en faktor 5 (1/0.2) istället för 1/10.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for CORRIGO FC3/FC5 Analog inputs/outputs
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Note! Telegram for reading Analog status AI and AO
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2007-12-17 inital version
%
DEVICETYPE CorrigoAnalog NAMED "Corrigo AI/AU" TYPEID 21180 IS
PARAMETER
Id : "Adress";
PUBLIC
%NoOfFans : "Antal fläktar";
AI1 : "Utetemperatur" ["°C"];
AI2 : "Tryck 1" ["Pa"];
AI3 : "Tryck 2" ["Pa"];
AI4 : "Tryck 3" ["Pa"];
AI5 : "Tryck 4" ["Pa"];
AI6 : "Tryck 5" ["Pa"];
AI7 : "Temp 1" ["°C"];
AI8 : "Temp 2" ["°C"];
AO1 : "AU Fläkt 1" ["V"];
AO2 : "AU Fläkt 2" ["V"];
AO3 : "AU Fläkt 3" ["V"];
AO4 : "AU Fläkt 4" ["V"];
AO5 : "AU Fläkt 5" ["V"];
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM AnalogInput NAMED "Analog status" 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 2 (-1)
DATA[4] := RWORD(14); % Number of registers
ANSWER SIZE 33
DATA[0] = BYTE(Id); % ID
DATA[1] = HEX(04); % Modbus command "04h" Read registers
DATA[2] = BYTE(28); % Byte count
DATA[3] -> RWORD(NoOfFans := DATA;); % Number of active Fans
DATA[5] -> RWORD(IF (DATA>=32768) THEN AI1 :=(DATA-65536)/10; ELSE AI1 :=DATA/10; ENDIF;); % Outdoor temp (°C)
DATA[7] -> RWORD(AI2 := DATA / 0.2;); % Pressure 1 (Pa)
DATA[9] -> RWORD(AI3 := DATA / 0.2;); % Pressure 2 (Pa)
DATA[11] -> RWORD(AI4 := DATA / 0.2;); % Pressure 3 (Pa)
DATA[13] -> RWORD(AI5 := DATA / 0.2;); % Pressure 4 (Pa)
DATA[15] -> RWORD(AI6 := DATA / 0.2;); % Pressure 5 (Pa)
DATA[17] -> RWORD(IF (DATA>=32768) THEN AI7 :=(DATA-65536)/10; ELSE AI7 :=DATA/10; ENDIF;); % Temp 1 (°C)
DATA[19] -> RWORD(IF (DATA>=32768) THEN AI8 :=(DATA-65536)/10; ELSE AI8 :=DATA/10; ENDIF;); % Temp 1 (°C)
DATA[21] -> RWORD(AO1 := DATA / 10;); % Fan 1 output (V)
DATA[23] -> RWORD(AO2 := DATA / 10;); % Fan 2 output (V)
DATA[25] -> RWORD(AO3 := DATA / 10;); % Fan 3 output (V)
DATA[27] -> RWORD(AO4 := DATA / 10;); % Fan 4 output (V)
DATA[29] -> RWORD(AO5 := DATA / 10;); % Fan 5 output (V)
TIMEOUT 2000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for CORRIGO FC3/FC5, Digtal inputs
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Note! Telegram for reading Digital status DI and DO
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2007-12-17 inital version
%
DEVICETYPE CorrigoDigital NAMED "Corrigo DI/DU" TYPEID 21181 IS
PARAMETER
Id : "Adress";
PUBLIC
DI1 : "DI Forcerat BV";
DI2 : "DI Ext.stopp 1";
DI3 : "DI Ext.stopp 2";
DI4 : "DI Ext.stopp 3";
DI5 : "DI Ext.stopp 4";
DI6 : "DI Ext.stopp 5";
DO1 : "DU SummaLarm";
DO2 : "DU Larm Fläkt1";
DO3 : "DU Larm Fläkt2";
DO4 : "DU Larm Fläkt3";
DO5 : "DU Larm Fläkt4";
DO6 : "DU Larm Fläkt5";
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM DigitalInput NAMED "Digital status" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(02); % Modbus command "02h" read discrete input (bit)
DATA[2] := RWORD(1); % Start adress
DATA[4] := RWORD(12); % 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 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 DO1 := 1; ELSE DO1 := 0; ENDIF;
IF (DATA & 128) THEN DO2 := 1; ELSE DO2 := 0; ENDIF;
);
DATA[4] -> BYTE(IF (DATA & 1) THEN DO3 := 1; ELSE DO3 := 0; ENDIF;
IF (DATA & 2) THEN DO4 := 1; ELSE DO4 := 0; ENDIF;
IF (DATA & 4) THEN DO5 := 1; ELSE DO5 := 0; ENDIF;
IF (DATA & 8) THEN DO6 := 1; ELSE DO6 := 0; ENDIF;
);
TIMEOUT 2000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for CORRIGO FC3/FC5, Alarm inputs
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Note! Telegram for reading Alarm inputs
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2007-12-17 inital version
%
DEVICETYPE CorrigoAlarm NAMED "Corrigo Larm" TYPEID 21182 IS
PARAMETER
Id : "Adress";
PUBLIC
AReg1 : "Larm Reg. 1";
AReg2 : "Larm Reg. 2";
AReg3 : "Larm Reg. 3";
AReg4 : "Larm Reg. 4";
AReg5 : "Larm Reg. 5";
ASens0 : "Larm Giv.TempUt";
ASens1 : "Larm Giv.Tryck1";
ASens2 : "Larm Giv.Tryck2";
ASens3 : "Larm Giv.Tryck3";
ASens4 : "Larm Giv.Tryck4";
ASens5 : "Larm Giv.Tryck5";
AStop1 : "Larm Ext.Stopp1";
AStop2 : "Larm Ext.Stopp2";
AStop3 : "Larm Ext.Stopp3";
AStop4 : "Larm Ext.Stopp4";
AStop5 : "Larm Ext.Stopp5";
ALSens1 : "Larm Giv.Logg1";
ALSens2 : "Larm Giv.Logg2";
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM DigitalAlarm NAMED "Larm status" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(02); % Modbus command "02h" read discrete input (bit)
DATA[2] := RWORD(50); % Start adress
DATA[4] := RWORD(18); % 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 AReg1 := 1; ELSE AReg1 := 0; ENDIF;
IF (DATA & 2) THEN AReg2 := 1; ELSE AReg2 := 0; ENDIF;
IF (DATA & 4) THEN AReg3 := 1; ELSE AReg3 := 0; ENDIF;
IF (DATA & 8) THEN AReg4 := 1; ELSE AReg4 := 0; ENDIF;
IF (DATA & 16) THEN AReg5 := 1; ELSE AReg5 := 0; ENDIF;
IF (DATA & 32) THEN ASens0 := 1; ELSE ASens0 := 0; ENDIF;
IF (DATA & 64) THEN ASens1 := 1; ELSE ASens1 := 0; ENDIF;
IF (DATA & 128) THEN ASens2 := 1; ELSE ASens2 := 0; ENDIF;
);
DATA[4] -> BYTE(IF (DATA & 1) THEN ASens3 := 1; ELSE ASens3 := 0; ENDIF;
IF (DATA & 2) THEN ASens4 := 1; ELSE ASens4 := 0; ENDIF;
IF (DATA & 4) THEN ASens5 := 1; ELSE ASens5 := 0; ENDIF;
IF (DATA & 8) THEN AStop1 := 1; ELSE AStop1 := 0; ENDIF;
IF (DATA & 16) THEN AStop2 := 1; ELSE AStop2 := 0; ENDIF;
IF (DATA & 32) THEN AStop3 := 1; ELSE AStop3 := 0; ENDIF;
IF (DATA & 64) THEN AStop4 := 1; ELSE AStop4 := 0; ENDIF;
IF (DATA & 128) THEN AStop5 := 1; ELSE AStop5 := 0; ENDIF;
);
DATA[5] -> BYTE(IF (DATA & 1) THEN ALSens1 := 1; ELSE ALSens1 := 0; ENDIF;
IF (DATA & 2) THEN ALSens2 := 1; ELSE ALSens2 := 0; ENDIF;
);
TIMEOUT 2000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for CORRIGO FC3/FC5 Selected inputs
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Note! Telegram for reading Selected inputs in several telegrams
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2007-12-20 inital version
%
DEVICETYPE CorrigoSelect NAMED "Corrigo valbar" TYPEID 21183 IS
PARAMETER
Id : "Adress";
PUBLIC
%NoOfFans : "Antal fläktar";
AI1 : "Utetemperatur" ["°C"];
%AI2 : "Tryck 1" ["Pa"];
%AI3 : "Tryck 2" ["Pa"];
%AI4 : "Tryck 3" ["Pa"];
%AI5 : "Tryck 4" ["Pa"];
%AI6 : "Tryck 5" ["Pa"];
%AI7 : "Temp 1" ["°C"];
%AI8 : "Temp 2" ["°C"];
%AO1 : "AU Fläkt 1" ["V"];
%AO2 : "AU Fläkt 2" ["V"];
%AO3 : "AU Fläkt 3" ["V"];
%AO4 : "AU Fläkt 4" ["V"];
%AO5 : "AU Fläkt 5" ["V"];
DI1 : "DI Forcerat BV";
%DI2 : "DI Ext.stopp 1";
%DI3 : "DI Ext.stopp 2";
%DI4 : "DI Ext.stopp 3";
%DI5 : "DI Ext.stopp 4";
%DI6 : "DI Ext.stopp 5";
%DO1 : "DU SummaLarm";
%DO2 : "DU Larm Fläkt1";
%DO3 : "DU Larm Fläkt2";
%DO4 : "DU Larm Fläkt3";
%DO5 : "DU Larm Fläkt4";
%DO6 : "DU Larm Fläkt5";
AReg1 : "Larm Reg. 1";
%AReg2 : "Larm Reg. 2";
%AReg3 : "Larm Reg. 3";
%AReg4 : "Larm Reg. 4";
%AReg5 : "Larm Reg. 5";
%ASens0 : "Larm Giv.TempUt";
%ASens1 : "Larm Giv.Tryck1";
%ASens2 : "Larm Giv.Tryck2";
%ASens3 : "Larm Giv.Tryck3";
%ASens4 : "Larm Giv.Tryck4";
%ASens5 : "Larm Giv.Tryck5";
%AStop1 : "Larm Ext.Stopp1";
%AStop2 : "Larm Ext.Stopp2";
%AStop3 : "Larm Ext.Stopp3";
%AStop4 : "Larm Ext.Stopp4";
%AStop5 : "Larm Ext.Stopp5";
%ALSens1 : "Larm Giv.Logg1";
%ALSens2 : "Larm Giv.Logg2";
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM AnalogSelect NAMED "Analog valbar" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(04); % Modbus command "04h" Read registers
DATA[2] := RWORD(1); % Start address register 2 (-1)
DATA[4] := RWORD(13); % Number of registers
ANSWER SIZE 31
DATA[0] = BYTE(Id); % ID
DATA[1] = HEX(04); % Modbus command "04h" Read registers
DATA[2] = BYTE(26); % Byte count
DATA[3] -> RWORD(IF (DATA>=32768) THEN AI1 :=(DATA-65536)/10; ELSE AI1 :=DATA/10; ENDIF;); % Outdoor temp (°C)
%DATA[5] -> RWORD(AI2 := DATA / 10;); % Pressure 1 (Pa)
%DATA[7] -> RWORD(AI3 := DATA / 10;); % Pressure 2 (Pa)
%DATA[9] -> RWORD(AI4 := DATA / 10;); % Pressure 3 (Pa)
%DATA[11] -> RWORD(AI5 := DATA / 10;); % Pressure 4 (Pa)
%DATA[13] -> RWORD(AI6 := DATA / 10;); % Pressure 5 (Pa)
%DATA[15] -> RWORD(IF (DATA>=32768) THEN AI7 :=(DATA-65536)/10; ELSE AI7 :=DATA/10; ENDIF;); % Temp 1 (°C)
%DATA[17] -> RWORD(IF (DATA>=32768) THEN AI8 :=(DATA-65536)/10; ELSE AI8 :=DATA/10; ENDIF;); % Temp 1 (°C)
%DATA[19] -> RWORD(AO1 := DATA / 10;); % Fan 1 output (V)
%DATA[21] -> RWORD(AO2 := DATA / 10;); % Fan 2 output (V)
%DATA[23] -> RWORD(AO3 := DATA / 10;); % Fan 3 output (V)
%DATA[25] -> RWORD(AO4 := DATA / 10;); % Fan 4 output (V)
%DATA[27] -> RWORD(AO5 := DATA / 10;); % Fan 5 output (V)
TIMEOUT 2000
END;
TELEGRAM DigitalSelect NAMED "Digital valbar" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(02); % Modbus command "02h" read discrete input (bit)
DATA[2] := RWORD(1); % Start adress
DATA[4] := RWORD(12); % 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 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 DO1 := 1; ELSE DO1 := 0; ENDIF;
% IF (DATA & 128) THEN DO2 := 1; ELSE DO2 := 0; ENDIF;
);
%DATA[4] -> BYTE(IF (DATA & 1) THEN DO3 := 1; ELSE DO3 := 0; ENDIF;
% IF (DATA & 2) THEN DO4 := 1; ELSE DO4 := 0; ENDIF;
% IF (DATA & 4) THEN DO5 := 1; ELSE DO5 := 0; ENDIF;
% IF (DATA & 8) THEN DO6 := 1; ELSE DO6 := 0; ENDIF;
% );
TIMEOUT 2000
END;
TELEGRAM AlarmSelect NAMED "Larm valbar" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(02); % Modbus command "02h" read discrete input (bit)
DATA[2] := RWORD(50); % Start adress
DATA[4] := RWORD(18); % 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 AReg1 := 1; ELSE AReg1 := 0; ENDIF;
% IF (DATA & 2) THEN AReg2 := 1; ELSE AReg2 := 0; ENDIF;
% IF (DATA & 4) THEN AReg3 := 1; ELSE AReg3 := 0; ENDIF;
% IF (DATA & 8) THEN AReg4 := 1; ELSE AReg4 := 0; ENDIF;
% IF (DATA & 16) THEN AReg5 := 1; ELSE AReg5 := 0; ENDIF;
% IF (DATA & 32) THEN ASens0 := 1; ELSE ASens0 := 0; ENDIF;
% IF (DATA & 64) THEN ASens1 := 1; ELSE ASens1 := 0; ENDIF;
% IF (DATA & 128) THEN ASens2 := 1; ELSE ASens2 := 0; ENDIF;
);
%DATA[4] -> BYTE(IF (DATA & 1) THEN ASens3 := 1; ELSE ASens3 := 0; ENDIF;
% IF (DATA & 2) THEN ASens4 := 1; ELSE ASens4 := 0; ENDIF;
% IF (DATA & 4) THEN ASens5 := 1; ELSE ASens5 := 0; ENDIF;
% IF (DATA & 8) THEN AStop1 := 1; ELSE AStop1 := 0; ENDIF;
% IF (DATA & 16) THEN AStop2 := 1; ELSE AStop2 := 0; ENDIF;
% IF (DATA & 32) THEN AStop3 := 1; ELSE AStop3 := 0; ENDIF;
% IF (DATA & 64) THEN AStop4 := 1; ELSE AStop4 := 0; ENDIF;
% IF (DATA & 128) THEN AStop5 := 1; ELSE AStop5 := 0; ENDIF;
% );
%
%DATA[5] -> BYTE(IF (DATA & 1) THEN ALSens1 := 1; ELSE ALSens1 := 0; ENDIF;
% IF (DATA & 2) THEN ALSens2 := 1; ELSE ALSens2 := 0; ENDIF;
% );
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.