Regin EXO Compact 2011
Detaljer
- Typ
- Drivrutin
- Upplaggd av
- Ove Jansson, Abelko Innovation
- Version
- 1
- Uppdaterad
- 2013-08-28
- Skapad
- 2013-08-28
- Kategori
- Kyla, Modbus, Övrig utrustning, Värme, Ventilation
- Visningar
- 2843
Beskrivning
Device definition for REGIN EXO Compact
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 REGIN EXO Compact Analog inputs/outputs
%
% Från: Freddie van Doorn
%
% ; Input & Holding Register types (Type)
% ; 0: no decoding or manuf. spec. format
% ; 1: One index variable to LSB of one register
% ; 2: Two index variables to LSB & MSB of one register
% ; 3: Integer variable to one register. No scaling
% ; 4: Real variable to one register. Scale and Offset used
% ; 5:
% ; 6: Real variable to two registers (IEEE)
% ; 7: Real variable in BPac to one register. Scale and Offset used
% ; Example: #305 DPacLn(TimeDp) ModVaraddr(TimeDp.Posts(0).T1) 7 100 *
% ( No :X Ldn :I Cell :X Type :R Scale :R Offs )
% ;----- Input Status Registers ----------------------------------------------------
% #0 DPacLn(StdObjs1) ModVaraddr(InputOutput.START_P1) * * * ;Pumpstart
% #1 DPacLn(StdObjs1) ModVaraddr(InputOutput.DRIFTSVAR_P1) * * * ;Driftsvar pump
% #2 DPacLn(StdObjs1) ModVaraddr(InputOutput.LARM_FF4_NC) * * * ;Fellarm FF4
% #3 DPacLn(StdObjs1) ModVaraddr(InputOutput.SERVICEOMK) * * * ;Serviceomkopplare
% #4 DPacLn(StdObjs1) ModVaraddr(InputOutput.DigIn4) * * * ;Reserv
% #5 DPacLn(StdObjs1) ModVaraddr(StdObjs1.SumAlarm_AAlarm) * * * ;Summalarm A
% #6 DPacLn(StdObjs1) ModVaraddr(StdObjs1.SumAlarm_BAlarm) * * * ;Summalarm B
% ;----- Coil Status Registers -----------------------------------------------------
% ;----- Input Registers -----------------------------------------------------------
% #200 DPacLn(InputOutput) ModVaraddr(InputOutput.GT12) 4 10 * ;Temp.givare GT12
% #201 DPacLn(InputOutput) ModVaraddr(InputOutput.GT11) 4 10 * ;Temp.givare GT11
% #202 DPacLn(InputOutput) ModVaraddr(InputOutput.GT41) 4 10 * ;Temp.givare GT41
% #203 DPacLn(InputOutput) ModVaraddr(InputOutput.SV21) 4 10 * ;Ställdon SV21
% ;----- Holding Registers ---------------------------------------------------------
% #300 DPacLn(StdObjs1) ModVaraddr(StdObjs1.Reg_SV21_SetP) 4 10 * ;Börvärde GT11
% #301 DPacLn(StdObjs1) ModVaraddr(StdObjs1.Kurva_RAD_X1) 4 10 * ;Kurva X
% #302 DPacLn(StdObjs1) ModVaraddr(StdObjs1.Kurva_RAD_X2) 4 10 * ;
% #303 DPacLn(StdObjs1) ModVaraddr(StdObjs1.Kurva_RAD_X3) 4 10 * ;
% #304 DPacLn(StdObjs1) ModVaraddr(StdObjs1.Kurva_RAD_X4) 4 10 * ;
% #305 DPacLn(StdObjs1) ModVaraddr(StdObjs1.Kurva_RAD_X5) 4 10 * ;
% #306 DPacLn(StdObjs1) ModVaraddr(StdObjs1.Kurva_RAD_X6) 4 10 * ;
% #307 DPacLn(StdObjs1) ModVaraddr(StdObjs1.Kurva_RAD_X7) 4 10 * ;
% #308 DPacLn(StdObjs1) ModVaraddr(StdObjs1.Kurva_RAD_X8) 4 10 * ;
% #309 DPacLn(StdObjs1) ModVaraddr(StdObjs1.Kurva_RAD_Y1) 4 10 * ;Kurva Y
% #310 DPacLn(StdObjs1) ModVaraddr(StdObjs1.Kurva_RAD_Y2) 4 10 * ;
% #311 DPacLn(StdObjs1) ModVaraddr(StdObjs1.Kurva_RAD_Y3) 4 10 * ;
% #312 DPacLn(StdObjs1) ModVaraddr(StdObjs1.Kurva_RAD_Y4) 4 10 * ;
% #313 DPacLn(StdObjs1) ModVaraddr(StdObjs1.Kurva_RAD_Y5) 4 10 * ;
% #314 DPacLn(StdObjs1) ModVaraddr(StdObjs1.Kurva_RAD_Y6) 4 10 * ;
% #315 DPacLn(StdObjs1) ModVaraddr(StdObjs1.Kurva_RAD_Y7) 4 10 * ;
% #316 DPacLn(StdObjs1) ModVaraddr(StdObjs1.Kurva_RAD_Y8) 4 10 * ;
% #317 DPacLn(StdObjs1) ModVaraddr(StdObjs1.P1_StartTemp) 4 10 * ;Starttemp. pump
% #318 DPacLn(StdObjs1) ModVaraddr(StdObjs1.P1_Hysteresis) 4 10 * ;Hysteres pump
% #319 DPacLn(StdObjs1) ModVaraddr(AlarmS.AlaSResetEx) 4 1 * ;Nollställa larmer
% ;----- End -----------------------------------------------------------------------
% #320 255 * * * *% Settings module:
%
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2008-10-23 initial version
%
DEVICETYPE ReginAnalog NAMED "Regin analog" TYPEID 21260 IS
PARAMETER
Id : "Adress";
PUBLIC
V0 : "Temp.givareGT12" ["°C"];
V1 : "Temp.givareGT11" ["°C"];
V2 : "Temp.givareGT41" ["°C"];
V3 : "Ställdon SV21" ["%"];
V00 : "Börvärde GT11" ["°C"];
V01 : "Kurva X1" ;
V02 : "Kurva X2" ;
V03 : "Kurva X3" ;
V04 : "Kurva X4" ;
V05 : "Kurva X5" ;
V06 : "Kurva X6" ;
V07 : "Kurva X7" ;
V08 : "Kurva X8" ;
V09 : "Kurva Y1" ;
V10 : "Kurva Y2" ;
V11 : "Kurva Y3" ;
V12 : "Kurva Y4" ;
V13 : "Kurva Y5" ;
V14 : "Kurva Y6" ;
V15 : "Kurva Y7" ;
V16 : "Kurva Y8" ;
V17 : "Starttemp pump" ["°C"];
V18 : "Hysteres pump"
V19 : "Nollställa larm"
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM AnalogInput NAMED "Läs analog" 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(4); % Number of registers
ANSWER SIZE 13 % 5 + (2 * Number of registers)
DATA[0] = BYTE(Id); % ID
DATA[1] = HEX(04); % Modbus command "04h" Read registers
%DATA[2] = BYTE(8); % Byte count
DATA[3] -> RWORD(IF (DATA>=32768) THEN V0:=(DATA-65536)/10; ELSE V0:=DATA/10; ENDIF;); % 10*
DATA[5] -> RWORD(IF (DATA>=32768) THEN V1:=(DATA-65536)/10; ELSE V1:=DATA/10; ENDIF;); % 10*
DATA[7] -> RWORD(IF (DATA>=32768) THEN V2:=(DATA-65536)/10; ELSE V2:=DATA/10; ENDIF;); % 10*
DATA[9] -> RWORD(IF (DATA>=32768) THEN V3:=(DATA-65536)/10; ELSE V3:=DATA/10; ENDIF;); % 10*
TIMEOUT 2000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for REGIN EXO Compact settings
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2008-10-23 initial version
%
DEVICETYPE ReginOutput NAMED "Regin ställ" TYPEID 21261 IS
PARAMETER
Id :"Adress";
S0 :"Börvärde GT11" ["°C"];
S2 :"Starttemp pump" ["°C"];
S3 :"Hysteres pump" ;
PUBLIC
V1 :"Börvärde Reg1"["°C"];
V2 :"Börvärde Reg2"["°C"];
%V1 :"Läst BV Reg1"["°C"];
%V2 :"Läst BV Reg2"["°C"];
V00 : "Börvärde GT11" ["°C"];
V01 : "Kurva X1" ;
V02 : "Kurva X2" ;
V03 : "Kurva X3" ;
V04 : "Kurva X4" ;
V05 : "Kurva X5" ;
V06 : "Kurva X6" ;
V07 : "Kurva X7" ;
V08 : "Kurva X8" ;
V09 : "Kurva Y1" ;
V10 : "Kurva Y2" ;
V11 : "Kurva Y3" ;
V12 : "Kurva Y4" ;
V13 : "Kurva Y5" ;
V14 : "Kurva Y6" ;
V15 : "Kurva Y7" ;
V16 : "Kurva Y8" ;
V17 : "Starttemp pump" ["°C"];
V18 : "Hysteres pump" ;
V19 : "Nollställa larm" ;
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM WriteSet NAMED "Ställ register" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(06); % Modbus command "0x06" write singel register
DATA[2] <- RWORD( % Register address
IF Cnt>8 THEN Cnt:=0; ENDIF;
IF Cnt=0 THEN DATA:=79; %40080 Fast börvärde, T1 framledning 10*
ELSIF Cnt=1 THEN DATA:=79;
ELSIF Cnt=2 THEN DATA:=79;
ELSIF Cnt=3 THEN DATA:=79;
ELSIF Cnt=4 THEN DATA:=79;
ELSIF Cnt=5 THEN DATA:=79;
ELSIF Cnt=6 THEN DATA:=79;
ELSIF Cnt=7 THEN DATA:=79;
ELSIF Cnt=8 THEN DATA:=79;
ENDIF;
);
DATA[4] <- RWORD( % Register value
IF Cnt=0 THEN DATA:=(S80*10); %40080 Fast börvärde, T1 framledning 10*
ELSIF Cnt=1 THEN DATA:=(S80*10);
ELSIF Cnt=2 THEN DATA:=(S80*10);
ELSIF Cnt=3 THEN DATA:=(S80*10);
ELSIF Cnt=4 THEN DATA:=(S80*10);
ELSIF Cnt=5 THEN DATA:=(S80*10);
ELSIF Cnt=6 THEN DATA:=(S80*10);
ELSIF Cnt=7 THEN DATA:=(S80*10);
ELSIF Cnt=8 THEN DATA:=(S80*10);
ENDIF;
Cnt:=Cnt+1;
);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = HEX(06);
TIMEOUT 1000
END;
TELEGRAM WriteSet NAMED "Ställ värden" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(10); % Modbus command "0x10" write multiple registers
DATA[2] := RWORD(0); % start register
DATA[4] := RWORD(3); % number of registers to write
DATA[6] := BYTE(6); % number of bytes
DATA[7] <- RWORD(DATA := S1*10;
V1 := S1;
);
DATA[9] <- RWORD(DATA := S2*10;
V2 := S2;
);
DATA[11]<- RWORD(DATA :=(S3>0););
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = HEX(10);
%DATA[2] = RWORD(0); % start register
%DATA[4] = RWORD(3); % number of registers to write
TIMEOUT 2000
END;
% TELEGRAM ReadSet NAMED "Läs värden" IS
%
% QUESTION
% DATA[0] := BYTE(Id); % Modbus unit address
% DATA[1] := HEX(03); % Modbus command "3h" Read holding registers
% DATA[2] := RWORD(0); % Start address register
% DATA[4] := RWORD(2); % Number of registers
%
% ANSWER SIZE 9
% DATA[0] = BYTE(Id); % ID
% DATA[1] = HEX(03); % Modbus command "03h" Read holding registers
% DATA[2] = BYTE(4); % Byte count
% DATA[3] -> RWORD(V1 := DATA / 10;);
% DATA[5] -> RWORD(V2 := DATA / 10;);
%
% TIMEOUT 2000
%
% END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for REGIN EXO Compact settings
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2008-10-23 initial version
%
DEVICETYPE ReginOutput NAMED "Regin ställ" TYPEID 21261 IS
PARAMETER
Id :"Adress";
S1 :"Börvärde Reg1"["°C"];
S2 :"Börvärde Reg2"["°C"];
S3 :"Larmåterställ";
PUBLIC
V1 :"Börvärde Reg1"["°C"];
V2 :"Börvärde Reg2"["°C"];
%V1 :"Läst BV Reg1"["°C"];
%V2 :"Läst BV Reg2"["°C"];
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM WriteSet NAMED "Ställ värden" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(10); % Modbus command "0x10" write multiple registers
DATA[2] := RWORD(0); % start register
DATA[4] := RWORD(3); % number of registers to write
DATA[6] := BYTE(6); % number of bytes
DATA[7] <- RWORD(DATA := S1*10;
V1 := S1;
);
DATA[9] <- RWORD(DATA := S2*10;
V2 := S2;
);
DATA[11]<- RWORD(DATA :=(S3>0););
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = HEX(10);
%DATA[2] = RWORD(0); % start register
%DATA[4] = RWORD(3); % number of registers to write
TIMEOUT 2000
END;
% TELEGRAM ReadSet NAMED "Läs värden" IS
%
% QUESTION
% DATA[0] := BYTE(Id); % Modbus unit address
% DATA[1] := HEX(03); % Modbus command "3h" Read holding registers
% DATA[2] := RWORD(0); % Start address register
% DATA[4] := RWORD(2); % Number of registers
%
% ANSWER SIZE 9
% DATA[0] = BYTE(Id); % ID
% DATA[1] = HEX(03); % Modbus command "03h" Read holding registers
% DATA[2] = BYTE(4); % Byte count
% DATA[3] -> RWORD(V1 := DATA / 10;);
% DATA[5] -> RWORD(V2 := DATA / 10;);
%
% TIMEOUT 2000
%
% END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for REGIN EXO Compact Digital inputs/outputs
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2008-10-23 initial version
%
DEVICETYPE ReginDigital NAMED "Regin DI/DU" TYPEID 21262 IS
PARAMETER
Id : "Adress";
PUBLIC
DI0 : "Pumpstart";
DI1 : "Driftsvar pump";
DI2 : "Fellarm FF4";
DI3 : "Serviceomkopplare";
DI4 : "Reserv";
DI5 : "Summalarm A";
DI6 : "Summalarm B";
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(0); % Start adress
DATA[4] := RWORD(7); % Number of inputs
ANSWER SIZE 6
DATA[0] = BYTE(Id);
DATA[1] = HEX(02);
DATA[2] = BYTE(2);
DATA[3] -> BYTE(IF (DATA & 1) THEN DI0 := 1; ELSE DI1 := 0; ENDIF;
IF (DATA & 2) THEN DI1 := 1; ELSE DI2 := 0; ENDIF;
IF (DATA & 4) THEN DI2 := 1; ELSE DI3 := 0; ENDIF;
IF (DATA & 8) THEN DI3 := 1; ELSE DI4 := 0; ENDIF;
IF (DATA & 16) THEN DI4 := 1; ELSE DI5 := 0; ENDIF;
IF (DATA & 32) THEN DI5 := 1; ELSE DI6 := 0; ENDIF;
IF (DATA & 64) THEN DI6 := 1; ELSE DI7 := 0; ENDIF;
);
TIMEOUT 2000
END;
TELEGRAM Analogset1 NAMED "Kvittering larm" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(10); % Modbus command "0x10" write multiple registers
DATA[2] := RWORD(19); % start register
DATA[4] := RWORD(1); % number of registers to write
DATA[6] := BYTE(2); % number of bytes
DATA[7] <- RWORD(DATA := 1;
);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = HEX(10);
%DATA[2] = RWORD(19); % start register
%DATA[4] = RWORD(1);
TIMEOUT 2000
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 1022 Operating mode R/W Holding register
% Brine pump Bitfält 0x0C 0 = Intermittent, 1 = Cont, 2 = 10 days cont.
% Level monitor Bitfält 0xC0 0 = Off, 1 = On (NC), 2 = On (NO)
% Heating medium pump A Bitfält 0x03 0 = Intermittent, 1 = Cont, 2 = Economy
% Quickstart Compressors Bit 0x10 0 = (normal), 1 = quick start
% Reset alarm Bit 0x20 0 = (normal), 1 = reset alarm
TELEGRAM SendAcknowledge NAMED "Kvittera larm" IS
QUESTION
DATA[0] := BYTE(Id);
DATA[1] := HEX(06); %Write singel register
DATA[2] := RWORD(1021+(N*100)); %Adress 1022 = Operating mode
DATA[4] <- RWORD(
DATA := OperatingMode | 32; % Set RESET bit
% Tysta telegrammet efter sändning
SilenceSend := 5;
);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = HEX(06);
TIMEOUT 1000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GROUP SendAckGroup OF MAX 9 DEVICE TYPEID 21283
SELECT ALL SORT BY N
ITERATOR SendAck
ALIAS
BEGIN
IF (Started) THEN
IF (MAck <> Ack) THEN
SEND SendAcknowledge;
MAck := Ack;
ENDIF;
IF (SilenceSend > 0) THEN
SilenceSend := SilenceSend - 1;
SILENCE SendAcknowledge;
ENDIF;
ELSE
SILENCE SendAcknowledge;
MAck := Ack;
Started := 1;
ENDIF;
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ROUTINE Acknowledge
BEGIN
CALL SendAckGroup.SendAck;
END;
% Device definition for REGIN EXO Compact Analog inputs/outputs
%
% Från: Freddie van Doorn
%
% ; Input & Holding Register types (Type)
% ; 0: no decoding or manuf. spec. format
% ; 1: One index variable to LSB of one register
% ; 2: Two index variables to LSB & MSB of one register
% ; 3: Integer variable to one register. No scaling
% ; 4: Real variable to one register. Scale and Offset used
% ; 5:
% ; 6: Real variable to two registers (IEEE)
% ; 7: Real variable in BPac to one register. Scale and Offset used
% ; Example: #305 DPacLn(TimeDp) ModVaraddr(TimeDp.Posts(0).T1) 7 100 *
% ( No :X Ldn :I Cell :X Type :R Scale :R Offs )
% ;----- Input Status Registers ----------------------------------------------------
% #0 DPacLn(StdObjs1) ModVaraddr(InputOutput.START_P1) * * * ;Pumpstart
% #1 DPacLn(StdObjs1) ModVaraddr(InputOutput.DRIFTSVAR_P1) * * * ;Driftsvar pump
% #2 DPacLn(StdObjs1) ModVaraddr(InputOutput.LARM_FF4_NC) * * * ;Fellarm FF4
% #3 DPacLn(StdObjs1) ModVaraddr(InputOutput.SERVICEOMK) * * * ;Serviceomkopplare
% #4 DPacLn(StdObjs1) ModVaraddr(InputOutput.DigIn4) * * * ;Reserv
% #5 DPacLn(StdObjs1) ModVaraddr(StdObjs1.SumAlarm_AAlarm) * * * ;Summalarm A
% #6 DPacLn(StdObjs1) ModVaraddr(StdObjs1.SumAlarm_BAlarm) * * * ;Summalarm B
% ;----- Coil Status Registers -----------------------------------------------------
% ;----- Input Registers -----------------------------------------------------------
% #200 DPacLn(InputOutput) ModVaraddr(InputOutput.GT12) 4 10 * ;Temp.givare GT12
% #201 DPacLn(InputOutput) ModVaraddr(InputOutput.GT11) 4 10 * ;Temp.givare GT11
% #202 DPacLn(InputOutput) ModVaraddr(InputOutput.GT41) 4 10 * ;Temp.givare GT41
% #203 DPacLn(InputOutput) ModVaraddr(InputOutput.SV21) 4 10 * ;Ställdon SV21
% ;----- Holding Registers ---------------------------------------------------------
% #300 DPacLn(StdObjs1) ModVaraddr(StdObjs1.Reg_SV21_SetP) 4 10 * ;Börvärde GT11
% #301 DPacLn(StdObjs1) ModVaraddr(StdObjs1.Kurva_RAD_X1) 4 10 * ;Kurva X
% #302 DPacLn(StdObjs1) ModVaraddr(StdObjs1.Kurva_RAD_X2) 4 10 * ;
% #303 DPacLn(StdObjs1) ModVaraddr(StdObjs1.Kurva_RAD_X3) 4 10 * ;
% #304 DPacLn(StdObjs1) ModVaraddr(StdObjs1.Kurva_RAD_X4) 4 10 * ;
% #305 DPacLn(StdObjs1) ModVaraddr(StdObjs1.Kurva_RAD_X5) 4 10 * ;
% #306 DPacLn(StdObjs1) ModVaraddr(StdObjs1.Kurva_RAD_X6) 4 10 * ;
% #307 DPacLn(StdObjs1) ModVaraddr(StdObjs1.Kurva_RAD_X7) 4 10 * ;
% #308 DPacLn(StdObjs1) ModVaraddr(StdObjs1.Kurva_RAD_X8) 4 10 * ;
% #309 DPacLn(StdObjs1) ModVaraddr(StdObjs1.Kurva_RAD_Y1) 4 10 * ;Kurva Y
% #310 DPacLn(StdObjs1) ModVaraddr(StdObjs1.Kurva_RAD_Y2) 4 10 * ;
% #311 DPacLn(StdObjs1) ModVaraddr(StdObjs1.Kurva_RAD_Y3) 4 10 * ;
% #312 DPacLn(StdObjs1) ModVaraddr(StdObjs1.Kurva_RAD_Y4) 4 10 * ;
% #313 DPacLn(StdObjs1) ModVaraddr(StdObjs1.Kurva_RAD_Y5) 4 10 * ;
% #314 DPacLn(StdObjs1) ModVaraddr(StdObjs1.Kurva_RAD_Y6) 4 10 * ;
% #315 DPacLn(StdObjs1) ModVaraddr(StdObjs1.Kurva_RAD_Y7) 4 10 * ;
% #316 DPacLn(StdObjs1) ModVaraddr(StdObjs1.Kurva_RAD_Y8) 4 10 * ;
% #317 DPacLn(StdObjs1) ModVaraddr(StdObjs1.P1_StartTemp) 4 10 * ;Starttemp. pump
% #318 DPacLn(StdObjs1) ModVaraddr(StdObjs1.P1_Hysteresis) 4 10 * ;Hysteres pump
% #319 DPacLn(StdObjs1) ModVaraddr(AlarmS.AlaSResetEx) 4 1 * ;Nollställa larmer
% ;----- End -----------------------------------------------------------------------
% #320 255 * * * *% Settings module:
%
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2008-10-23 initial version
%
DEVICETYPE ReginAnalog NAMED "Regin analog" TYPEID 21260 IS
PARAMETER
Id : "Adress";
PUBLIC
V0 : "Temp.givareGT12" ["°C"];
V1 : "Temp.givareGT11" ["°C"];
V2 : "Temp.givareGT41" ["°C"];
V3 : "Ställdon SV21" ["%"];
V00 : "Börvärde GT11" ["°C"];
V01 : "Kurva X1" ;
V02 : "Kurva X2" ;
V03 : "Kurva X3" ;
V04 : "Kurva X4" ;
V05 : "Kurva X5" ;
V06 : "Kurva X6" ;
V07 : "Kurva X7" ;
V08 : "Kurva X8" ;
V09 : "Kurva Y1" ;
V10 : "Kurva Y2" ;
V11 : "Kurva Y3" ;
V12 : "Kurva Y4" ;
V13 : "Kurva Y5" ;
V14 : "Kurva Y6" ;
V15 : "Kurva Y7" ;
V16 : "Kurva Y8" ;
V17 : "Starttemp pump" ["°C"];
V18 : "Hysteres pump"
V19 : "Nollställa larm"
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM AnalogInput NAMED "Läs analog" 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(4); % Number of registers
ANSWER SIZE 13 % 5 + (2 * Number of registers)
DATA[0] = BYTE(Id); % ID
DATA[1] = HEX(04); % Modbus command "04h" Read registers
%DATA[2] = BYTE(8); % Byte count
DATA[3] -> RWORD(IF (DATA>=32768) THEN V0:=(DATA-65536)/10; ELSE V0:=DATA/10; ENDIF;); % 10*
DATA[5] -> RWORD(IF (DATA>=32768) THEN V1:=(DATA-65536)/10; ELSE V1:=DATA/10; ENDIF;); % 10*
DATA[7] -> RWORD(IF (DATA>=32768) THEN V2:=(DATA-65536)/10; ELSE V2:=DATA/10; ENDIF;); % 10*
DATA[9] -> RWORD(IF (DATA>=32768) THEN V3:=(DATA-65536)/10; ELSE V3:=DATA/10; ENDIF;); % 10*
TIMEOUT 2000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for REGIN EXO Compact settings
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2008-10-23 initial version
%
DEVICETYPE ReginOutput NAMED "Regin ställ" TYPEID 21261 IS
PARAMETER
Id :"Adress";
S0 :"Börvärde GT11" ["°C"];
S2 :"Starttemp pump" ["°C"];
S3 :"Hysteres pump" ;
PUBLIC
V1 :"Börvärde Reg1"["°C"];
V2 :"Börvärde Reg2"["°C"];
%V1 :"Läst BV Reg1"["°C"];
%V2 :"Läst BV Reg2"["°C"];
V00 : "Börvärde GT11" ["°C"];
V01 : "Kurva X1" ;
V02 : "Kurva X2" ;
V03 : "Kurva X3" ;
V04 : "Kurva X4" ;
V05 : "Kurva X5" ;
V06 : "Kurva X6" ;
V07 : "Kurva X7" ;
V08 : "Kurva X8" ;
V09 : "Kurva Y1" ;
V10 : "Kurva Y2" ;
V11 : "Kurva Y3" ;
V12 : "Kurva Y4" ;
V13 : "Kurva Y5" ;
V14 : "Kurva Y6" ;
V15 : "Kurva Y7" ;
V16 : "Kurva Y8" ;
V17 : "Starttemp pump" ["°C"];
V18 : "Hysteres pump" ;
V19 : "Nollställa larm" ;
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM WriteSet NAMED "Ställ register" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(06); % Modbus command "0x06" write singel register
DATA[2] <- RWORD( % Register address
IF Cnt>8 THEN Cnt:=0; ENDIF;
IF Cnt=0 THEN DATA:=79; %40080 Fast börvärde, T1 framledning 10*
ELSIF Cnt=1 THEN DATA:=79;
ELSIF Cnt=2 THEN DATA:=79;
ELSIF Cnt=3 THEN DATA:=79;
ELSIF Cnt=4 THEN DATA:=79;
ELSIF Cnt=5 THEN DATA:=79;
ELSIF Cnt=6 THEN DATA:=79;
ELSIF Cnt=7 THEN DATA:=79;
ELSIF Cnt=8 THEN DATA:=79;
ENDIF;
);
DATA[4] <- RWORD( % Register value
IF Cnt=0 THEN DATA:=(S80*10); %40080 Fast börvärde, T1 framledning 10*
ELSIF Cnt=1 THEN DATA:=(S80*10);
ELSIF Cnt=2 THEN DATA:=(S80*10);
ELSIF Cnt=3 THEN DATA:=(S80*10);
ELSIF Cnt=4 THEN DATA:=(S80*10);
ELSIF Cnt=5 THEN DATA:=(S80*10);
ELSIF Cnt=6 THEN DATA:=(S80*10);
ELSIF Cnt=7 THEN DATA:=(S80*10);
ELSIF Cnt=8 THEN DATA:=(S80*10);
ENDIF;
Cnt:=Cnt+1;
);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = HEX(06);
TIMEOUT 1000
END;
TELEGRAM WriteSet NAMED "Ställ värden" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(10); % Modbus command "0x10" write multiple registers
DATA[2] := RWORD(0); % start register
DATA[4] := RWORD(3); % number of registers to write
DATA[6] := BYTE(6); % number of bytes
DATA[7] <- RWORD(DATA := S1*10;
V1 := S1;
);
DATA[9] <- RWORD(DATA := S2*10;
V2 := S2;
);
DATA[11]<- RWORD(DATA :=(S3>0););
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = HEX(10);
%DATA[2] = RWORD(0); % start register
%DATA[4] = RWORD(3); % number of registers to write
TIMEOUT 2000
END;
% TELEGRAM ReadSet NAMED "Läs värden" IS
%
% QUESTION
% DATA[0] := BYTE(Id); % Modbus unit address
% DATA[1] := HEX(03); % Modbus command "3h" Read holding registers
% DATA[2] := RWORD(0); % Start address register
% DATA[4] := RWORD(2); % Number of registers
%
% ANSWER SIZE 9
% DATA[0] = BYTE(Id); % ID
% DATA[1] = HEX(03); % Modbus command "03h" Read holding registers
% DATA[2] = BYTE(4); % Byte count
% DATA[3] -> RWORD(V1 := DATA / 10;);
% DATA[5] -> RWORD(V2 := DATA / 10;);
%
% TIMEOUT 2000
%
% END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for REGIN EXO Compact settings
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2008-10-23 initial version
%
DEVICETYPE ReginOutput NAMED "Regin ställ" TYPEID 21261 IS
PARAMETER
Id :"Adress";
S1 :"Börvärde Reg1"["°C"];
S2 :"Börvärde Reg2"["°C"];
S3 :"Larmåterställ";
PUBLIC
V1 :"Börvärde Reg1"["°C"];
V2 :"Börvärde Reg2"["°C"];
%V1 :"Läst BV Reg1"["°C"];
%V2 :"Läst BV Reg2"["°C"];
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM WriteSet NAMED "Ställ värden" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(10); % Modbus command "0x10" write multiple registers
DATA[2] := RWORD(0); % start register
DATA[4] := RWORD(3); % number of registers to write
DATA[6] := BYTE(6); % number of bytes
DATA[7] <- RWORD(DATA := S1*10;
V1 := S1;
);
DATA[9] <- RWORD(DATA := S2*10;
V2 := S2;
);
DATA[11]<- RWORD(DATA :=(S3>0););
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = HEX(10);
%DATA[2] = RWORD(0); % start register
%DATA[4] = RWORD(3); % number of registers to write
TIMEOUT 2000
END;
% TELEGRAM ReadSet NAMED "Läs värden" IS
%
% QUESTION
% DATA[0] := BYTE(Id); % Modbus unit address
% DATA[1] := HEX(03); % Modbus command "3h" Read holding registers
% DATA[2] := RWORD(0); % Start address register
% DATA[4] := RWORD(2); % Number of registers
%
% ANSWER SIZE 9
% DATA[0] = BYTE(Id); % ID
% DATA[1] = HEX(03); % Modbus command "03h" Read holding registers
% DATA[2] = BYTE(4); % Byte count
% DATA[3] -> RWORD(V1 := DATA / 10;);
% DATA[5] -> RWORD(V2 := DATA / 10;);
%
% TIMEOUT 2000
%
% END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Device definition for REGIN EXO Compact Digital inputs/outputs
%
% Settings module:
% Parity: None
% Baud: 9600
% Mode: RTU
%
% Author: Peter Widetun, ABELKO AB Luleå
% History: 2008-10-23 initial version
%
DEVICETYPE ReginDigital NAMED "Regin DI/DU" TYPEID 21262 IS
PARAMETER
Id : "Adress";
PUBLIC
DI0 : "Pumpstart";
DI1 : "Driftsvar pump";
DI2 : "Fellarm FF4";
DI3 : "Serviceomkopplare";
DI4 : "Reserv";
DI5 : "Summalarm A";
DI6 : "Summalarm B";
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(0); % Start adress
DATA[4] := RWORD(7); % Number of inputs
ANSWER SIZE 6
DATA[0] = BYTE(Id);
DATA[1] = HEX(02);
DATA[2] = BYTE(2);
DATA[3] -> BYTE(IF (DATA & 1) THEN DI0 := 1; ELSE DI1 := 0; ENDIF;
IF (DATA & 2) THEN DI1 := 1; ELSE DI2 := 0; ENDIF;
IF (DATA & 4) THEN DI2 := 1; ELSE DI3 := 0; ENDIF;
IF (DATA & 8) THEN DI3 := 1; ELSE DI4 := 0; ENDIF;
IF (DATA & 16) THEN DI4 := 1; ELSE DI5 := 0; ENDIF;
IF (DATA & 32) THEN DI5 := 1; ELSE DI6 := 0; ENDIF;
IF (DATA & 64) THEN DI6 := 1; ELSE DI7 := 0; ENDIF;
);
TIMEOUT 2000
END;
TELEGRAM Analogset1 NAMED "Kvittering larm" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(10); % Modbus command "0x10" write multiple registers
DATA[2] := RWORD(19); % start register
DATA[4] := RWORD(1); % number of registers to write
DATA[6] := BYTE(2); % number of bytes
DATA[7] <- RWORD(DATA := 1;
);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = HEX(10);
%DATA[2] = RWORD(19); % start register
%DATA[4] = RWORD(1);
TIMEOUT 2000
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 1022 Operating mode R/W Holding register
% Brine pump Bitfält 0x0C 0 = Intermittent, 1 = Cont, 2 = 10 days cont.
% Level monitor Bitfält 0xC0 0 = Off, 1 = On (NC), 2 = On (NO)
% Heating medium pump A Bitfält 0x03 0 = Intermittent, 1 = Cont, 2 = Economy
% Quickstart Compressors Bit 0x10 0 = (normal), 1 = quick start
% Reset alarm Bit 0x20 0 = (normal), 1 = reset alarm
TELEGRAM SendAcknowledge NAMED "Kvittera larm" IS
QUESTION
DATA[0] := BYTE(Id);
DATA[1] := HEX(06); %Write singel register
DATA[2] := RWORD(1021+(N*100)); %Adress 1022 = Operating mode
DATA[4] <- RWORD(
DATA := OperatingMode | 32; % Set RESET bit
% Tysta telegrammet efter sändning
SilenceSend := 5;
);
ANSWER SIZE 8
DATA[0] = BYTE(Id);
DATA[1] = HEX(06);
TIMEOUT 1000
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GROUP SendAckGroup OF MAX 9 DEVICE TYPEID 21283
SELECT ALL SORT BY N
ITERATOR SendAck
ALIAS
BEGIN
IF (Started) THEN
IF (MAck <> Ack) THEN
SEND SendAcknowledge;
MAck := Ack;
ENDIF;
IF (SilenceSend > 0) THEN
SilenceSend := SilenceSend - 1;
SILENCE SendAcknowledge;
ENDIF;
ELSE
SILENCE SendAcknowledge;
MAck := Ack;
Started := 1;
ENDIF;
END;
END;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ROUTINE Acknowledge
BEGIN
CALL SendAckGroup.SendAck;
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.