SWEGON GOLD 04-80
Detaljer
- Typ
- Drivrutin
- Upplaggd av
- Ove Jansson, Abelko Innovation
- Version
- 1
- Uppdaterad
- 2013-08-28
- Skapad
- 2013-08-28
- Kategori
- Modbus, Ventilation
- Visningar
- 2281
Beskrivning
Device definition for SWEGON GOLD 04-80
Bruksanvisning
Hur man installerar typdefinitionerna och driftsätter modulerna finns beskrivet i användarmanualen, kapitel 18.7.
Juridisk information
Alla skript tillhandahålls i befintligt skick och all användning sker på eget ansvar. Felaktig använding kan leda till skadad eller förstörd utrustning.
Skript kod
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Modified 100616: Selected for alarm reading
%
% 0x0001 Alarm reset 0-1 Resets tripped alarms.
%
% 1x0006 A-alarm. 0-1 Status for relay output.
% 1x0007 B-alarm. 0-1 Status for relay output
%
% 1x0049 Alarm number 1 0-1 Status if alarm number 1 is active.
% 1x0050 Alarm number 2 0-1 Status if alarm number 2 is active.
% 1x0051 Alarm number 3 0-1 Status if alarm number 3 is active.
% ..
% 1x0248 Alarm number 200 0-1 Status if alarm number 200 is active.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for SWEGON GOLD 04-80 read digital inputs 1-20
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Note! Telegram for reading digital inputs
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2008-01-03 inital version
%
DEVICETYPE SwegonDigital1 NAMED "Swegon Larm" TYPEID 21208 IS
PARAMETER
Id : "Adress";
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-larm"; %A-alarm relay
DI7 : "B-larm"; %B-alarm relay
%DI8 : "Operation relay"; %Operation relay output
%DI9 : "Damper relay"; %Damper relay output
%DI10 : "Ind. Low speed"; %External low speed input
%DI11 : "Ind. High speed"; %External high speed input
%DI12 : "Ind. Alarm 1"; %External alarm 1 input
%DI13 : "Ind. Alarm 2"; %External alarm 2 input
%DI14 : "Ind. Fire alarm"; %External fire alarm input.
%DI15 : "Ind. Stop input"; %External stop input
%DI16 : "DIP Switch 1"; %DIP Switch 1
%DI17 : "DIP Switch 2"; %DIP Switch 2
%DI18 : "DIP Switch 3"; %DIP Switch 3
%DI19 : "DIP Switch 4"; %DIP Switch 4
%DI20 : "DIP Switch 5"; %DIP Switch 5
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM DigitalInput1 NAMED "Summalarm A/B" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(02); % Modbus command "02h" read discrete input (bit)
DATA[2] := RWORD(0); % Start adress
DATA[4] := RWORD(20); % Number of inputs
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = HEX(02);
DATA[2] = BYTE(3);
DATA[3] -> BYTE(
% IF (DATA & 1) THEN DI1 := 1; ELSE DI1 := 0; ENDIF;
% IF (DATA & 2) THEN DI2 := 1; ELSE DI2 := 0; ENDIF;
% IF (DATA & 4) THEN DI3 := 1; ELSE DI3 := 0; ENDIF;
% IF (DATA & 8) THEN DI4 := 1; ELSE DI4 := 0; ENDIF;
% IF (DATA & 16) THEN DI5 := 1; ELSE DI5 := 0; ENDIF;
IF (DATA & 32) THEN DI6 := 1; ELSE DI6 := 0; ENDIF;
IF (DATA & 64) THEN DI7 := 1; ELSE DI7 := 0; ENDIF;
% IF (DATA & 128) THEN DI8 := 1; ELSE DI8 := 0; ENDIF;
);
%DATA[4] -> BYTE(IF (DATA & 1) THEN DI9 := 1; ELSE DI9 := 0; ENDIF;
% IF (DATA & 2) THEN DI10:= 1; ELSE DI10:= 0; ENDIF;
% IF (DATA & 4) THEN DI11:= 1; ELSE DI11:= 0; ENDIF;
% IF (DATA & 8) THEN DI12:= 1; ELSE DI12:= 0; ENDIF;
% IF (DATA & 16) THEN DI13:= 1; ELSE DI13:= 0; ENDIF;
% IF (DATA & 32) THEN DI14:= 1; ELSE DI14:= 0; ENDIF;
% IF (DATA & 64) THEN DI15:= 1; ELSE DI15:= 0; ENDIF;
% IF (DATA & 128) THEN DI16:= 1; ELSE DI16:= 0; ENDIF;
% );
%DATA[5] -> BYTE(IF (DATA & 1) THEN DI17:= 1; ELSE DI17:= 0; ENDIF;
% IF (DATA & 2) THEN DI18:= 1; ELSE DI18:= 0; ENDIF;
% IF (DATA & 4) THEN DI19:= 1; ELSE DI19:= 0; ENDIF;
% IF (DATA & 8) THEN DI20:= 1; ELSE DI20:= 0; ENDIF;
% );
TIMEOUT 2000
END;
END;
% Modified 100616: Selected for alarm reading
%
% 0x0001 Alarm reset 0-1 Resets tripped alarms.
%
% 1x0006 A-alarm. 0-1 Status for relay output.
% 1x0007 B-alarm. 0-1 Status for relay output
%
% 1x0049 Alarm number 1 0-1 Status if alarm number 1 is active.
% 1x0050 Alarm number 2 0-1 Status if alarm number 2 is active.
% 1x0051 Alarm number 3 0-1 Status if alarm number 3 is active.
% ..
% 1x0248 Alarm number 200 0-1 Status if alarm number 200 is active.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for SWEGON GOLD 04-80 read digital inputs 1-20
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Note! Telegram for reading digital inputs
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2008-01-03 inital version
%
DEVICETYPE SwegonDigital1 NAMED "Swegon Larm" TYPEID 21208 IS
PARAMETER
Id : "Adress";
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-larm"; %A-alarm relay
DI7 : "B-larm"; %B-alarm relay
%DI8 : "Operation relay"; %Operation relay output
%DI9 : "Damper relay"; %Damper relay output
%DI10 : "Ind. Low speed"; %External low speed input
%DI11 : "Ind. High speed"; %External high speed input
%DI12 : "Ind. Alarm 1"; %External alarm 1 input
%DI13 : "Ind. Alarm 2"; %External alarm 2 input
%DI14 : "Ind. Fire alarm"; %External fire alarm input.
%DI15 : "Ind. Stop input"; %External stop input
%DI16 : "DIP Switch 1"; %DIP Switch 1
%DI17 : "DIP Switch 2"; %DIP Switch 2
%DI18 : "DIP Switch 3"; %DIP Switch 3
%DI19 : "DIP Switch 4"; %DIP Switch 4
%DI20 : "DIP Switch 5"; %DIP Switch 5
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM DigitalInput1 NAMED "Summalarm A/B" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(02); % Modbus command "02h" read discrete input (bit)
DATA[2] := RWORD(0); % Start adress
DATA[4] := RWORD(20); % Number of inputs
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = HEX(02);
DATA[2] = BYTE(3);
DATA[3] -> BYTE(
% IF (DATA & 1) THEN DI1 := 1; ELSE DI1 := 0; ENDIF;
% IF (DATA & 2) THEN DI2 := 1; ELSE DI2 := 0; ENDIF;
% IF (DATA & 4) THEN DI3 := 1; ELSE DI3 := 0; ENDIF;
% IF (DATA & 8) THEN DI4 := 1; ELSE DI4 := 0; ENDIF;
% IF (DATA & 16) THEN DI5 := 1; ELSE DI5 := 0; ENDIF;
IF (DATA & 32) THEN DI6 := 1; ELSE DI6 := 0; ENDIF;
IF (DATA & 64) THEN DI7 := 1; ELSE DI7 := 0; ENDIF;
% IF (DATA & 128) THEN DI8 := 1; ELSE DI8 := 0; ENDIF;
);
%DATA[4] -> BYTE(IF (DATA & 1) THEN DI9 := 1; ELSE DI9 := 0; ENDIF;
% IF (DATA & 2) THEN DI10:= 1; ELSE DI10:= 0; ENDIF;
% IF (DATA & 4) THEN DI11:= 1; ELSE DI11:= 0; ENDIF;
% IF (DATA & 8) THEN DI12:= 1; ELSE DI12:= 0; ENDIF;
% IF (DATA & 16) THEN DI13:= 1; ELSE DI13:= 0; ENDIF;
% IF (DATA & 32) THEN DI14:= 1; ELSE DI14:= 0; ENDIF;
% IF (DATA & 64) THEN DI15:= 1; ELSE DI15:= 0; ENDIF;
% IF (DATA & 128) THEN DI16:= 1; ELSE DI16:= 0; ENDIF;
% );
%DATA[5] -> BYTE(IF (DATA & 1) THEN DI17:= 1; ELSE DI17:= 0; ENDIF;
% IF (DATA & 2) THEN DI18:= 1; ELSE DI18:= 0; ENDIF;
% IF (DATA & 4) THEN DI19:= 1; ELSE DI19:= 0; ENDIF;
% IF (DATA & 8) THEN DI20:= 1; ELSE DI20:= 0; ENDIF;
% );
TIMEOUT 2000
END;
END;
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.