FKP Tryckstyrningsomriktare
Detaljer
- Typ
- Drivrutin
- Upplaggd av
- Ove Jansson, Abelko Innovation
- Version
- 1
- Uppdaterad
- 2013-08-27
- Skapad
- 2013-08-27
- Kategori
- Frekvensomformare, Modbus
- Visningar
- 3188
Beskrivning
FKP är en frekvensomvandlare för tryckreglering och varvtalsreglering av 3-fas asynkronmotorer, upp till 2.2kW från Frabil Fracon Gruppen.
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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for FKP (Frabil Fracon Gruppen) read input registers 51-63
%
% Settings module:
% Parity: None
% Baud: 19200
% Mode: RTU
%
% Note! Telegram for reading Analog status
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2010-05-31 inital version
%
DEVICETYPE FKPAnalog1 NAMED "FKP mätsignaler" TYPEID 21201 IS
PARAMETER
Id : "Adress";
PUBLIC
R1 : "SA Airflow" ["l/s"]; %SA Airflow
R2 : "SA Airflow setp" ["l/s"]; %SA Airflow setpoint
R3 : "EA Airflow" ["l/s"]; %EA Airflow
R4 : "EA Airflow setp" ["l/s"]; %EA Airflow setpoint
R5 : "SA DuctPressure" ["Pa"]; %SA Duct press.
R6 : "SA DuctSetpoint" ["Pa"]; %SA Duct press. setpoint
R7 : "EA DuctPressure" ["Pa"]; %EA Duct press.
R8 : "EA DuctSetpoint" ["Pa"]; %EA Duct press. setpoint
R9 : "SA VAV demand" ["%"]; %SA VAV demand/boost input
R10 : "SA VAV setpoint" ["%"]; %SA VAV demand setpoint
R11 : "EA VAV demand" ["%"]; %EA VAV demand/boost input
R12 : "EA VAV setpoint" ["%"]; %EA VAV demand setpoint
R13 : "SA Fan level" ["%"]; %SA Fan level
R14 : "EA Fan level" ["%"]; %EA Fan level
R15 : "SA Fan effect" ["W"]; %SA Fan effect
R16 : "EA Fan effect" ["W"]; %EA Fan effect
R17 : "SFP" [" "]; %SFP
R18 : "SA FanFrequency" ["Hz"]; %SA Fan Frequency
R19 : "EA FanFrequency" ["Hz"]; %EA Fan Frequency
R20 : "SA Fan Voltage" ["V"]; %SA Fan Voltage
PRIVATE
BAUDRATE 19200;
CHECKSUM MODBUS SWAPPED;
TELEGRAM AnalogInput1 NAMED "Register 51-63" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(04); % Modbus command "04h" Read registers
DATA[2] := RWORD(0); % Start address register
DATA[4] := RWORD(20); % Number of registers
ANSWER SIZE 45
DATA[0] = BYTE(Id); % ID
DATA[1] = HEX(04); % Modbus command "04h" Read registers
DATA[2] = BYTE(40); % Byte count
DATA[3] -> RWORD(R1 := DATA;); % 0-8200 l/s
DATA[5] -> RWORD(R2 := DATA;); % 0-8200 l/s
DATA[7] -> RWORD(R3 := DATA;); % 0-8200 l/s
DATA[9] -> RWORD(R4 := DATA;); % 0-8200 l/s
DATA[11] -> RWORD(R5 := DATA;); % 20-750 Pa
DATA[13] -> RWORD(R6 := DATA;); % 20-750 Pa
DATA[15] -> RWORD(R7 := DATA;); % 20-750 Pa
DATA[17] -> RWORD(R8 := DATA;); % 20-750 Pa
DATA[19] -> RWORD(R9 := DATA /100;); % 0-100.00 %
DATA[21] -> RWORD(R10 := DATA /100;); % 0-100.00 %
DATA[23] -> RWORD(R11 := DATA /100;); % 0-100.00 %
DATA[25] -> RWORD(R12 := DATA /100;); % 0-100.00 %
DATA[27] -> RWORD(R13 := DATA /100;); % 0-100.00 %
DATA[29] -> RWORD(R14 := DATA /100;); % 0-100.00 %
DATA[31] -> RWORD(R15 := DATA;); % 0-6500 W
DATA[33] -> RWORD(R16 := DATA;); % 0-6500 W
DATA[35] -> RWORD(R17 := DATA / 10;); % 0.0-9.9 ?
DATA[37] -> RWORD(R18 := DATA /100;); % 0-100.00 Hz
DATA[39] -> RWORD(R19 := DATA /100;); % 0-100.00 Hz
DATA[41] -> RWORD(R20 := DATA;); % 0-500 V
TIMEOUT 1000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for FKP (Frabil Fracon Gruppen) read input registers 64-72
%
% Settings module:
% Parity: None
% Baud: 19200
% Mode: RTU
%
% Note! Telegram for reading Analog status
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2010-05-31 inital version
%
DEVICETYPE FKPFellogg NAMED "FKP Läs fellogg" TYPEID 21201 IS
PARAMETER
Id : "Address";
PUBLIC
R21 : "EA Fan Voltage" ["V"]; %EA Fan Voltage
R22 : "SA Fan Current" ["A"]; %SA Fan Current
R23 : "EA Fan Current" ["A"]; %EA Fan Current
R24 : "SA Pressure" ["Pa"]; %SA Inlet Airflow press.
R25 : "EA Pressure" ["Pa"]; %EA Inlet Airflow press.
R26 : "SA TempSetpoint" ["°C"]; %SA Temp setpoint
R27 : "EA TempSetpoint" ["°C"]; %EA Temp setpoint
R28 : "SA Temperature" ["°C"]; %SA Temp
R29 : "EA RoomTemp" ["°C"]; %EA/Room Temp (internal)
R30 : "OutdoorTemp" ["°C"]; %Outdoor Temp (internal)
R31 : "EA RoomTemp Ext" ["°C"]; %EA/Room Temp (external)
R32 : "OutdoorTemp Ext" ["°C"]; %Outdoor Temp (external)
R33 : "Anti frost Temp" ["°C"]; %Anti frost Temp
R34 : "Temp sensor 3" ["°C"]; %Temp sensor 3
R35 : "Temp sensor 4" ["°C"]; %Temp sensor 4
R36 : "Rotary HX level" ["%"]; %Rotary HX level
R37 : "Reheat level" ["%"]; %Reheat level
R38 : "SA Down level" ["%"]; %SA Down regulation level
R39 : "Extra Seq.level" ["%"]; %Extra reg. sequence level
R40 : "Cooling level" ["%"]; %Cooling level
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM Felinfo NAMED "Läs felinfo." IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(04); % Modbus command "04h" Read registers
DATA[2] := RWORD(20); % Start address register
DATA[4] := RWORD(20); % Number of registers
ANSWER SIZE 45
DATA[0] = BYTE(Id); % ID
DATA[1] = HEX(04); % Modbus command "04h" Read registers
DATA[2] = BYTE(40); % Byte count
DATA[3] -> RWORD(R21 := DATA;); % 0-500 V
DATA[5] -> RWORD(R22 := DATA / 1000;); % 0-30.000 A
DATA[7] -> RWORD(R23 := DATA / 1000;); % 0-30.000 A
DATA[9] -> RWORD(R24 := DATA;); % 0-2000 Pa
DATA[11] -> RWORD(R25 := DATA;); % 0-2000 Pa
DATA[13] -> RWORD(R26 := DATA / 100;); % 5.00-40.00 °C
DATA[15] -> RWORD(R27 := DATA / 100;); % 5.00-40.00 °C
DATA[17] -> RWORD(R28 := DATA / 100;); % 5.00-40.00 °C
DATA[19] -> RWORD(R29 := DATA / 100;); % 5.00-40.00 °C
DATA[21] -> RWORD(R30 := DATA / 100;); % 5.00-40.00 °C
DATA[23] -> RWORD(R31 := DATA / 100;); % 5.00-40.00 °C
DATA[25] -> RWORD(R32 := DATA / 100;); % 5.00-40.00 °C
DATA[27] -> RWORD(R33 := DATA / 100;); % 0-40.00 °C
DATA[29] -> RWORD(R34 := DATA / 100;); % 0-40.00 °C
DATA[31] -> RWORD(R35 := DATA / 100;); % 0-40.00 °C
DATA[33] -> RWORD(R36 := DATA / 100;); % 0-100.00 %
DATA[35] -> RWORD(R37 := DATA / 100;); % 0-100.00 %
DATA[37] -> RWORD(R38 := DATA / 100;); % 0-100.00 %
DATA[39] -> RWORD(R39 := DATA / 100;); % 0-100.00 %
DATA[41] -> RWORD(R40 := DATA / 100;); % 0-100.00 %
TIMEOUT 1000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for FKP (Frabil Fracon Gruppen) read digital inputs 1-4
%
% Settings module:
% Parity: None
% Baud: 19200
% Mode: RTU
%
% Note! Telegram for reading Analog status
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2010-05-31 inital version
%
DEVICETYPE FKP_IOStatus NAMED "FKP I/O status" TYPEID 21201 IS
PARAMETER
Id : "Address";
PUBLIC
DI1 : "Heat relay"; %Heat relay output
DI2 : "Cool relay 1"; %Cool relay output 1
DI3 : "Cool relay 2"; %Cool relay output 2
DI4 : "Fan low speed"; %Low speed relay output
DI5 : "Fan high speed"; %High speed relay output
DI6 : "A-alarm relay"; %A-alarm relay
DI7 : "B-alarm relay"; %B-alarm relay
DI8 : "Operation relay"; %Operation relay output
DI9 : "Damper relay"; %Damper relay output
DI10 : "Ind. Low speed"; %External low speed input
DI11 : "Ind. High speed"; %External high speed input
DI12 : "Ind. Alarm 1"; %External alarm 1 input
DI13 : "Ind. Alarm 2"; %External alarm 2 input
DI14 : "Ind. Fire alarm"; %External fire alarm input.
DI15 : "Ind. Stop input"; %External stop input
DI16 : "DIP Switch 1"; %DIP Switch 1
DI17 : "DIP Switch 2"; %DIP Switch 2
DI18 : "DIP Switch 3"; %DIP Switch 3
DI19 : "DIP Switch 4"; %DIP Switch 4
DI20 : "DIP Switch 5"; %DIP Switch 5
PRIVATE
BAUDRATE 19200;
CHECKSUM MODBUS SWAPPED;
TELEGRAM DigitalInput1 NAMED "Läs I/O status" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(02); % Modbus command "02h" read discrete input (bit)
DATA[2] := RWORD(0); % Start adress
DATA[4] := RWORD(20); % Number of inputs
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = HEX(02);
DATA[2] = BYTE(3);
DATA[3] -> BYTE(IF (DATA & 1) THEN DI1 := 1; ELSE DI1 := 0; ENDIF;
IF (DATA & 2) THEN DI2 := 1; ELSE DI2 := 0; ENDIF;
IF (DATA & 4) THEN DI3 := 1; ELSE DI3 := 0; ENDIF;
IF (DATA & 8) THEN DI4 := 1; ELSE DI4 := 0; ENDIF;
TIMEOUT 2000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for FKP (Frabil Fracon Gruppen) set register values
%
% Settings module:
% Parity: None
% Baud: 19200
% Mode: RTU
%
% Note! Telegram for reading Analog status
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2010-05-31 inital version
%
DEVICETYPE FKPSettings NAMED "FKP ställ reg." TYPEID 21201 IS
PARAMETER
Id : "Address";
% Jag vill ställa börvärde för frånluft.
% Börvärde flöde lågfart tilluft,
% Börvärde flöde högfart tilluft,
% Börvärde flöde lågfart frånluft,
% Börvärde flöde högfart frånluft.
%R001 : "SA Flow Setp.L" ["l/s"]; % 4x0001 SA Low speed airflow setpoint 0-8200l/s
%R002 : "SA Flow Setp.H" ["l/s"]; % 4x0002 SA High speed airflow setpoint 0-8200l/s
%R005 : "EA Flow Setp.L" ["l/s"]; % 4x0005 EA Low speed airflow setpoint 0-8200l/s
%R006 : "EA Flow Setp.H" ["l/s"]; % 4x0006 EA High speed airflow setpoint 0-8200l/s
%R009 : "SA Press Setp.L"["Pa"]; % 4x0009 SA Low speed pressure setpoint 20-750Pa
R010 : "SA Press Setp.H"["Pa"]; % 4x0010 SA High speed pressure setpoint 20-750Pa
%R013 : "EA Press Setp.L"["Pa"]; % 4x0013 EA Low speed pressure setpoint 20-750Pa
R014 : "EA Press Setp.H"["Pa"]; % 4x0014 EA High speed pressure setpoint 20-750Pa
%R175 : "Operation mode" [""]; % Communication operation mode 0 - 4 PV 5.00
% Setting of unit operation mode from communication.
% 0=Auto operation,
% 1=Communication Stop 1,
% 2=Communication Low speed,
% 3=Communication High speed.
% 4=Communication Stop 2 (New in PV 5.00)
% Summer night cooling, intermittent night heat and
% morning boost functions operates at stop 2.
R041 : "SA TempSP" ["°C"]; % Supply air temperature setting 10.00-40.00°C
R322 : "Xzone SA TempSP"["°C"]; % Xzone supply air temperature setting 10.00-40.00°C PV 5.00
PUBLIC
PRIVATE
Cnt;
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM Settings1 NAMED "Reglersignaler" IS
QUESTION
DATA[0] := BYTE(Id);
DATA[1] := HEX(06); %Write singel register
DATA[2] <- RWORD( %Start adress (regnr-1)
IF Cnt>3 THEN Cnt:=0; ENDIF;
%% Adress=Register-1
IF Cnt=0 THEN DATA := 9; %Register = 10
ELSIF Cnt=1 THEN DATA := 13; %Register = 14
ELSIF Cnt=2 THEN DATA := 40; %Register = 41
ELSIF Cnt=3 THEN DATA := 321; %Register = 322
%ELSIF Cnt=4 THEN DATA := 9; %Register = 10
%ELSIF Cnt=5 THEN DATA := 13; %Register = 14
%ELSIF Cnt=6 THEN DATA := 40; %Register = 41
%ELSIF Cnt=7 THEN DATA := 321; %Register = 322
ELSE DATA := 9; %Register = 10
ENDIF;
);
DATA[4] <- RWORD(
IF Cnt=0 THEN
IF R010<20 THEN DATA := 20; % 20-750Pa
ELSIF R010>750 THEN DATA := 750;
ELSE DATA := R010;
ENDIF;
ELSIF Cnt=1 THEN
IF R014<20 THEN DATA := 20; % 20-750Pa
ELSIF R014>750 THEN DATA := 750;
ELSE DATA := R014;
ENDIF;
ELSIF Cnt=2 THEN
IF R041<10 THEN DATA := 1000; % 10.00-40.00°C
ELSIF R041>40 THEN DATA := 4000;
ELSE DATA := R041*100;
ENDIF;
ELSIF Cnt=3 THEN
IF R322<10 THEN DATA := 1000; % 10.00-40.00°C
ELSIF R322>40 THEN DATA := 4000;
ELSE DATA := R322*100;
ENDIF;
%ELSIF Cnt=4 THEN
% IF R010<20 THEN DATA := 20; % 20-750Pa
% ELSIF R010>750 THEN DATA := 750;
% ELSE DATA := R010;
% ENDIF;
%ELSIF Cnt=5 THEN
% IF R014<20 THEN DATA := 20; % 20-750Pa
% ELSIF R014>750 THEN DATA := 750;
% ELSE DATA := R014;
% ENDIF;
%ELSIF Cnt=6 THEN
% IF R041<10 THEN DATA := 1000; % 10.00-40.00°C
% ELSIF R041>40 THEN DATA := 4000;
% ELSE DATA := R041*100;
% ENDIF;
%ELSIF Cnt=7 THEN
% IF R322<10 THEN DATA := 1000; % 10.00-40.00°C
% ELSIF R322>40 THEN DATA := 4000;
% ELSE DATA := R322*100;
% ENDIF;
ELSE
IF R010<20 THEN DATA := 20; % 20-750Pa
ELSIF R010>750 THEN DATA := 750;
ELSE DATA := R010;
ENDIF;
ENDIF;
Cnt := Cnt + 1;
IF Cnt>3 THEN Cnt := 0;
ENDIF;
);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = HEX(06);
TIMEOUT 2000
END;
END;
% Device definition for FKP (Frabil Fracon Gruppen) read input registers 51-63
%
% Settings module:
% Parity: None
% Baud: 19200
% Mode: RTU
%
% Note! Telegram for reading Analog status
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2010-05-31 inital version
%
DEVICETYPE FKPAnalog1 NAMED "FKP mätsignaler" TYPEID 21201 IS
PARAMETER
Id : "Adress";
PUBLIC
R1 : "SA Airflow" ["l/s"]; %SA Airflow
R2 : "SA Airflow setp" ["l/s"]; %SA Airflow setpoint
R3 : "EA Airflow" ["l/s"]; %EA Airflow
R4 : "EA Airflow setp" ["l/s"]; %EA Airflow setpoint
R5 : "SA DuctPressure" ["Pa"]; %SA Duct press.
R6 : "SA DuctSetpoint" ["Pa"]; %SA Duct press. setpoint
R7 : "EA DuctPressure" ["Pa"]; %EA Duct press.
R8 : "EA DuctSetpoint" ["Pa"]; %EA Duct press. setpoint
R9 : "SA VAV demand" ["%"]; %SA VAV demand/boost input
R10 : "SA VAV setpoint" ["%"]; %SA VAV demand setpoint
R11 : "EA VAV demand" ["%"]; %EA VAV demand/boost input
R12 : "EA VAV setpoint" ["%"]; %EA VAV demand setpoint
R13 : "SA Fan level" ["%"]; %SA Fan level
R14 : "EA Fan level" ["%"]; %EA Fan level
R15 : "SA Fan effect" ["W"]; %SA Fan effect
R16 : "EA Fan effect" ["W"]; %EA Fan effect
R17 : "SFP" [" "]; %SFP
R18 : "SA FanFrequency" ["Hz"]; %SA Fan Frequency
R19 : "EA FanFrequency" ["Hz"]; %EA Fan Frequency
R20 : "SA Fan Voltage" ["V"]; %SA Fan Voltage
PRIVATE
BAUDRATE 19200;
CHECKSUM MODBUS SWAPPED;
TELEGRAM AnalogInput1 NAMED "Register 51-63" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(04); % Modbus command "04h" Read registers
DATA[2] := RWORD(0); % Start address register
DATA[4] := RWORD(20); % Number of registers
ANSWER SIZE 45
DATA[0] = BYTE(Id); % ID
DATA[1] = HEX(04); % Modbus command "04h" Read registers
DATA[2] = BYTE(40); % Byte count
DATA[3] -> RWORD(R1 := DATA;); % 0-8200 l/s
DATA[5] -> RWORD(R2 := DATA;); % 0-8200 l/s
DATA[7] -> RWORD(R3 := DATA;); % 0-8200 l/s
DATA[9] -> RWORD(R4 := DATA;); % 0-8200 l/s
DATA[11] -> RWORD(R5 := DATA;); % 20-750 Pa
DATA[13] -> RWORD(R6 := DATA;); % 20-750 Pa
DATA[15] -> RWORD(R7 := DATA;); % 20-750 Pa
DATA[17] -> RWORD(R8 := DATA;); % 20-750 Pa
DATA[19] -> RWORD(R9 := DATA /100;); % 0-100.00 %
DATA[21] -> RWORD(R10 := DATA /100;); % 0-100.00 %
DATA[23] -> RWORD(R11 := DATA /100;); % 0-100.00 %
DATA[25] -> RWORD(R12 := DATA /100;); % 0-100.00 %
DATA[27] -> RWORD(R13 := DATA /100;); % 0-100.00 %
DATA[29] -> RWORD(R14 := DATA /100;); % 0-100.00 %
DATA[31] -> RWORD(R15 := DATA;); % 0-6500 W
DATA[33] -> RWORD(R16 := DATA;); % 0-6500 W
DATA[35] -> RWORD(R17 := DATA / 10;); % 0.0-9.9 ?
DATA[37] -> RWORD(R18 := DATA /100;); % 0-100.00 Hz
DATA[39] -> RWORD(R19 := DATA /100;); % 0-100.00 Hz
DATA[41] -> RWORD(R20 := DATA;); % 0-500 V
TIMEOUT 1000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for FKP (Frabil Fracon Gruppen) read input registers 64-72
%
% Settings module:
% Parity: None
% Baud: 19200
% Mode: RTU
%
% Note! Telegram for reading Analog status
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2010-05-31 inital version
%
DEVICETYPE FKPFellogg NAMED "FKP Läs fellogg" TYPEID 21201 IS
PARAMETER
Id : "Address";
PUBLIC
R21 : "EA Fan Voltage" ["V"]; %EA Fan Voltage
R22 : "SA Fan Current" ["A"]; %SA Fan Current
R23 : "EA Fan Current" ["A"]; %EA Fan Current
R24 : "SA Pressure" ["Pa"]; %SA Inlet Airflow press.
R25 : "EA Pressure" ["Pa"]; %EA Inlet Airflow press.
R26 : "SA TempSetpoint" ["°C"]; %SA Temp setpoint
R27 : "EA TempSetpoint" ["°C"]; %EA Temp setpoint
R28 : "SA Temperature" ["°C"]; %SA Temp
R29 : "EA RoomTemp" ["°C"]; %EA/Room Temp (internal)
R30 : "OutdoorTemp" ["°C"]; %Outdoor Temp (internal)
R31 : "EA RoomTemp Ext" ["°C"]; %EA/Room Temp (external)
R32 : "OutdoorTemp Ext" ["°C"]; %Outdoor Temp (external)
R33 : "Anti frost Temp" ["°C"]; %Anti frost Temp
R34 : "Temp sensor 3" ["°C"]; %Temp sensor 3
R35 : "Temp sensor 4" ["°C"]; %Temp sensor 4
R36 : "Rotary HX level" ["%"]; %Rotary HX level
R37 : "Reheat level" ["%"]; %Reheat level
R38 : "SA Down level" ["%"]; %SA Down regulation level
R39 : "Extra Seq.level" ["%"]; %Extra reg. sequence level
R40 : "Cooling level" ["%"]; %Cooling level
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM Felinfo NAMED "Läs felinfo." IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(04); % Modbus command "04h" Read registers
DATA[2] := RWORD(20); % Start address register
DATA[4] := RWORD(20); % Number of registers
ANSWER SIZE 45
DATA[0] = BYTE(Id); % ID
DATA[1] = HEX(04); % Modbus command "04h" Read registers
DATA[2] = BYTE(40); % Byte count
DATA[3] -> RWORD(R21 := DATA;); % 0-500 V
DATA[5] -> RWORD(R22 := DATA / 1000;); % 0-30.000 A
DATA[7] -> RWORD(R23 := DATA / 1000;); % 0-30.000 A
DATA[9] -> RWORD(R24 := DATA;); % 0-2000 Pa
DATA[11] -> RWORD(R25 := DATA;); % 0-2000 Pa
DATA[13] -> RWORD(R26 := DATA / 100;); % 5.00-40.00 °C
DATA[15] -> RWORD(R27 := DATA / 100;); % 5.00-40.00 °C
DATA[17] -> RWORD(R28 := DATA / 100;); % 5.00-40.00 °C
DATA[19] -> RWORD(R29 := DATA / 100;); % 5.00-40.00 °C
DATA[21] -> RWORD(R30 := DATA / 100;); % 5.00-40.00 °C
DATA[23] -> RWORD(R31 := DATA / 100;); % 5.00-40.00 °C
DATA[25] -> RWORD(R32 := DATA / 100;); % 5.00-40.00 °C
DATA[27] -> RWORD(R33 := DATA / 100;); % 0-40.00 °C
DATA[29] -> RWORD(R34 := DATA / 100;); % 0-40.00 °C
DATA[31] -> RWORD(R35 := DATA / 100;); % 0-40.00 °C
DATA[33] -> RWORD(R36 := DATA / 100;); % 0-100.00 %
DATA[35] -> RWORD(R37 := DATA / 100;); % 0-100.00 %
DATA[37] -> RWORD(R38 := DATA / 100;); % 0-100.00 %
DATA[39] -> RWORD(R39 := DATA / 100;); % 0-100.00 %
DATA[41] -> RWORD(R40 := DATA / 100;); % 0-100.00 %
TIMEOUT 1000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for FKP (Frabil Fracon Gruppen) read digital inputs 1-4
%
% Settings module:
% Parity: None
% Baud: 19200
% Mode: RTU
%
% Note! Telegram for reading Analog status
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2010-05-31 inital version
%
DEVICETYPE FKP_IOStatus NAMED "FKP I/O status" TYPEID 21201 IS
PARAMETER
Id : "Address";
PUBLIC
DI1 : "Heat relay"; %Heat relay output
DI2 : "Cool relay 1"; %Cool relay output 1
DI3 : "Cool relay 2"; %Cool relay output 2
DI4 : "Fan low speed"; %Low speed relay output
DI5 : "Fan high speed"; %High speed relay output
DI6 : "A-alarm relay"; %A-alarm relay
DI7 : "B-alarm relay"; %B-alarm relay
DI8 : "Operation relay"; %Operation relay output
DI9 : "Damper relay"; %Damper relay output
DI10 : "Ind. Low speed"; %External low speed input
DI11 : "Ind. High speed"; %External high speed input
DI12 : "Ind. Alarm 1"; %External alarm 1 input
DI13 : "Ind. Alarm 2"; %External alarm 2 input
DI14 : "Ind. Fire alarm"; %External fire alarm input.
DI15 : "Ind. Stop input"; %External stop input
DI16 : "DIP Switch 1"; %DIP Switch 1
DI17 : "DIP Switch 2"; %DIP Switch 2
DI18 : "DIP Switch 3"; %DIP Switch 3
DI19 : "DIP Switch 4"; %DIP Switch 4
DI20 : "DIP Switch 5"; %DIP Switch 5
PRIVATE
BAUDRATE 19200;
CHECKSUM MODBUS SWAPPED;
TELEGRAM DigitalInput1 NAMED "Läs I/O status" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(02); % Modbus command "02h" read discrete input (bit)
DATA[2] := RWORD(0); % Start adress
DATA[4] := RWORD(20); % Number of inputs
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = HEX(02);
DATA[2] = BYTE(3);
DATA[3] -> BYTE(IF (DATA & 1) THEN DI1 := 1; ELSE DI1 := 0; ENDIF;
IF (DATA & 2) THEN DI2 := 1; ELSE DI2 := 0; ENDIF;
IF (DATA & 4) THEN DI3 := 1; ELSE DI3 := 0; ENDIF;
IF (DATA & 8) THEN DI4 := 1; ELSE DI4 := 0; ENDIF;
TIMEOUT 2000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for FKP (Frabil Fracon Gruppen) set register values
%
% Settings module:
% Parity: None
% Baud: 19200
% Mode: RTU
%
% Note! Telegram for reading Analog status
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2010-05-31 inital version
%
DEVICETYPE FKPSettings NAMED "FKP ställ reg." TYPEID 21201 IS
PARAMETER
Id : "Address";
% Jag vill ställa börvärde för frånluft.
% Börvärde flöde lågfart tilluft,
% Börvärde flöde högfart tilluft,
% Börvärde flöde lågfart frånluft,
% Börvärde flöde högfart frånluft.
%R001 : "SA Flow Setp.L" ["l/s"]; % 4x0001 SA Low speed airflow setpoint 0-8200l/s
%R002 : "SA Flow Setp.H" ["l/s"]; % 4x0002 SA High speed airflow setpoint 0-8200l/s
%R005 : "EA Flow Setp.L" ["l/s"]; % 4x0005 EA Low speed airflow setpoint 0-8200l/s
%R006 : "EA Flow Setp.H" ["l/s"]; % 4x0006 EA High speed airflow setpoint 0-8200l/s
%R009 : "SA Press Setp.L"["Pa"]; % 4x0009 SA Low speed pressure setpoint 20-750Pa
R010 : "SA Press Setp.H"["Pa"]; % 4x0010 SA High speed pressure setpoint 20-750Pa
%R013 : "EA Press Setp.L"["Pa"]; % 4x0013 EA Low speed pressure setpoint 20-750Pa
R014 : "EA Press Setp.H"["Pa"]; % 4x0014 EA High speed pressure setpoint 20-750Pa
%R175 : "Operation mode" [""]; % Communication operation mode 0 - 4 PV 5.00
% Setting of unit operation mode from communication.
% 0=Auto operation,
% 1=Communication Stop 1,
% 2=Communication Low speed,
% 3=Communication High speed.
% 4=Communication Stop 2 (New in PV 5.00)
% Summer night cooling, intermittent night heat and
% morning boost functions operates at stop 2.
R041 : "SA TempSP" ["°C"]; % Supply air temperature setting 10.00-40.00°C
R322 : "Xzone SA TempSP"["°C"]; % Xzone supply air temperature setting 10.00-40.00°C PV 5.00
PUBLIC
PRIVATE
Cnt;
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM Settings1 NAMED "Reglersignaler" IS
QUESTION
DATA[0] := BYTE(Id);
DATA[1] := HEX(06); %Write singel register
DATA[2] <- RWORD( %Start adress (regnr-1)
IF Cnt>3 THEN Cnt:=0; ENDIF;
%% Adress=Register-1
IF Cnt=0 THEN DATA := 9; %Register = 10
ELSIF Cnt=1 THEN DATA := 13; %Register = 14
ELSIF Cnt=2 THEN DATA := 40; %Register = 41
ELSIF Cnt=3 THEN DATA := 321; %Register = 322
%ELSIF Cnt=4 THEN DATA := 9; %Register = 10
%ELSIF Cnt=5 THEN DATA := 13; %Register = 14
%ELSIF Cnt=6 THEN DATA := 40; %Register = 41
%ELSIF Cnt=7 THEN DATA := 321; %Register = 322
ELSE DATA := 9; %Register = 10
ENDIF;
);
DATA[4] <- RWORD(
IF Cnt=0 THEN
IF R010<20 THEN DATA := 20; % 20-750Pa
ELSIF R010>750 THEN DATA := 750;
ELSE DATA := R010;
ENDIF;
ELSIF Cnt=1 THEN
IF R014<20 THEN DATA := 20; % 20-750Pa
ELSIF R014>750 THEN DATA := 750;
ELSE DATA := R014;
ENDIF;
ELSIF Cnt=2 THEN
IF R041<10 THEN DATA := 1000; % 10.00-40.00°C
ELSIF R041>40 THEN DATA := 4000;
ELSE DATA := R041*100;
ENDIF;
ELSIF Cnt=3 THEN
IF R322<10 THEN DATA := 1000; % 10.00-40.00°C
ELSIF R322>40 THEN DATA := 4000;
ELSE DATA := R322*100;
ENDIF;
%ELSIF Cnt=4 THEN
% IF R010<20 THEN DATA := 20; % 20-750Pa
% ELSIF R010>750 THEN DATA := 750;
% ELSE DATA := R010;
% ENDIF;
%ELSIF Cnt=5 THEN
% IF R014<20 THEN DATA := 20; % 20-750Pa
% ELSIF R014>750 THEN DATA := 750;
% ELSE DATA := R014;
% ENDIF;
%ELSIF Cnt=6 THEN
% IF R041<10 THEN DATA := 1000; % 10.00-40.00°C
% ELSIF R041>40 THEN DATA := 4000;
% ELSE DATA := R041*100;
% ENDIF;
%ELSIF Cnt=7 THEN
% IF R322<10 THEN DATA := 1000; % 10.00-40.00°C
% ELSIF R322>40 THEN DATA := 4000;
% ELSE DATA := R322*100;
% ENDIF;
ELSE
IF R010<20 THEN DATA := 20; % 20-750Pa
ELSIF R010>750 THEN DATA := 750;
ELSE DATA := R010;
ENDIF;
ENDIF;
Cnt := Cnt + 1;
IF Cnt>3 THEN Cnt := 0;
ENDIF;
);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = HEX(06);
TIMEOUT 2000
END;
END;
Användarnas noteringar
Du måste vara inloggad för att göra en notering. Bli medlem eller logga in. Vi använder en moderator som godkänner noteringarna innan de visas.