LUFFT WSx-UMB V23 e Kompakt väderstation
Detaljer
Beskrivning
Drivrutin
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 LUFFT read input registers 32-50
%
% Settings module:
% Parity: None
% Bits: 8+1
% Baud: 9600
% Mode: RTU
%
% Note! Telegram for reading Analog status
%
% Author: Peter Widetun, ABELKO AB Luleå
% Original: 130409
%
DEVICETYPE LufftAnalog1 NAMED "Lufft analog 1" TYPEID 21452 IS
PARAMETER
Id : "Address";
PUBLIC
R32 : "Air Temperature act." ["°C"] ; % Factor 10, s
R33 : "Air Temperature min." ["°C"] ; % Factor 10, s
R34 : "Air Temperature max." ["°C"] ; % Factor 10, s
R35 : "Air Temperature avg." ["°C"] ; % Factor 10, s
R36 : "Dew Point akt." ["°C"] ; % Factor 10, s
R37 : "Dew Point min." ["°C"] ; % Factor 10, s
R38 : "Dew Point max." ["°C"] ; % Factor 10, s
R39 : "Dew Point avg." ["°C"] ; % Factor 10, s
R40 : "WindChill Temp" ["°C"] ; % Factor 10, s
R41 : "Heating Temp Wind" ["°C"] ; % Factor 10, s
R42 : "Heating Temp R2S" ["°C"] ; % Factor 10, s
R43 : "Wind Speed act" ["m/s"] ; % Factor 10, s
R44 : "Wind Speed min" ["m/s"] ; % Factor 10, s
R45 : "Wind Speed max" ["m/s"] ; % Factor 10, s
R46 : "Wind Speed avg" ["m/s"] ; % Factor 10, s
R47 : "Wind Speed vct" ["m/s"] ; % Factor 10, s
R48 : "Wind Speed fast" ["m/s"] ; % Factor 10, s
R49 : "Precipitation abs." ["mm"] ; % Factor 100, u, max 655.34mm
R50 : "Precipitation diff." ["mm"] ; % Factor 100, u, max 100.00mm
R51 : "Precipitation int." ["mm/h"]; % Factor 100, u, max 200.00mm/h
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM AnalogInput1 NAMED "Register 1-20" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(04); % Modbus command "04h" Read registers
DATA[2] := RWORD(31); % 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(IF (DATA>=32768) THEN R32:=(DATA-65536)/10; ELSE R32:=DATA/10; ENDIF;); %Factor 10, s
DATA[5] -> RWORD(IF (DATA>=32768) THEN R33:=(DATA-65536)/10; ELSE R33:=DATA/10; ENDIF;); %Factor 10, s
DATA[7] -> RWORD(IF (DATA>=32768) THEN R34:=(DATA-65536)/10; ELSE R34:=DATA/10; ENDIF;); %Factor 10, s
DATA[9] -> RWORD(IF (DATA>=32768) THEN R35:=(DATA-65536)/10; ELSE R35:=DATA/10; ENDIF;); %Factor 10, s
DATA[11] -> RWORD(IF (DATA>=32768) THEN R36:=(DATA-65536)/10; ELSE R36:=DATA/10; ENDIF;); %Factor 10, s
DATA[13] -> RWORD(IF (DATA>=32768) THEN R37:=(DATA-65536)/10; ELSE R37:=DATA/10; ENDIF;); %Factor 10, s
DATA[15] -> RWORD(IF (DATA>=32768) THEN R38:=(DATA-65536)/10; ELSE R38:=DATA/10; ENDIF;); %Factor 10, s
DATA[17] -> RWORD(IF (DATA>=32768) THEN R39:=(DATA-65536)/10; ELSE R39:=DATA/10; ENDIF;); %Factor 10, s
DATA[19] -> RWORD(IF (DATA>=32768) THEN R40:=(DATA-65536)/10; ELSE R40:=DATA/10; ENDIF;); %Factor 10, s
DATA[21] -> RWORD(IF (DATA>=32768) THEN R41:=(DATA-65536)/10; ELSE R41:=DATA/10; ENDIF;); %Factor 10, s
DATA[23] -> RWORD(IF (DATA>=32768) THEN R42:=(DATA-65536)/10; ELSE R42:=DATA/10; ENDIF;); %Factor 10, s
DATA[25] -> RWORD(IF (DATA>=32768) THEN R43:=(DATA-65536)/10; ELSE R43:=DATA/10; ENDIF;); %Factor 10, s
DATA[27] -> RWORD(IF (DATA>=32768) THEN R44:=(DATA-65536)/10; ELSE R44:=DATA/10; ENDIF;); %Factor 10, s
DATA[29] -> RWORD(IF (DATA>=32768) THEN R45:=(DATA-65536)/10; ELSE R45:=DATA/10; ENDIF;); %Factor 10, s
DATA[31] -> RWORD(IF (DATA>=32768) THEN R46:=(DATA-65536)/10; ELSE R46:=DATA/10; ENDIF;); %Factor 10, s
DATA[33] -> RWORD(IF (DATA>=32768) THEN R47:=(DATA-65536)/10; ELSE R47:=DATA/10; ENDIF;); %Factor 10, s
DATA[35] -> RWORD(IF (DATA>=32768) THEN R48:=(DATA-65536)/10; ELSE R48:=DATA/10; ENDIF;); %Factor 10, s
DATA[37] -> RWORD(IF (DATA>=32768) THEN R49:=(DATA-65536)/100; ELSE R49:=DATA/100; ENDIF;); %Factor 100, u
DATA[39] -> RWORD(IF (DATA>=32768) THEN R50:=(DATA-65536)/100; ELSE R50:=DATA/100; ENDIF;); %Factor 100, u
DATA[41] -> RWORD(IF (DATA>=32768) THEN R51:=(DATA-65536)/100; ELSE R51:=DATA/100; ENDIF;); %Factor 100, u
TIMEOUT 1000
END;
END;
% Device definition for LUFFT read input registers 32-50
%
% Settings module:
% Parity: None
% Bits: 8+1
% Baud: 9600
% Mode: RTU
%
% Note! Telegram for reading Analog status
%
% Author: Peter Widetun, ABELKO AB Luleå
% Original: 130409
%
DEVICETYPE LufftAnalog1 NAMED "Lufft analog 1" TYPEID 21452 IS
PARAMETER
Id : "Address";
PUBLIC
R32 : "Air Temperature act." ["°C"] ; % Factor 10, s
R33 : "Air Temperature min." ["°C"] ; % Factor 10, s
R34 : "Air Temperature max." ["°C"] ; % Factor 10, s
R35 : "Air Temperature avg." ["°C"] ; % Factor 10, s
R36 : "Dew Point akt." ["°C"] ; % Factor 10, s
R37 : "Dew Point min." ["°C"] ; % Factor 10, s
R38 : "Dew Point max." ["°C"] ; % Factor 10, s
R39 : "Dew Point avg." ["°C"] ; % Factor 10, s
R40 : "WindChill Temp" ["°C"] ; % Factor 10, s
R41 : "Heating Temp Wind" ["°C"] ; % Factor 10, s
R42 : "Heating Temp R2S" ["°C"] ; % Factor 10, s
R43 : "Wind Speed act" ["m/s"] ; % Factor 10, s
R44 : "Wind Speed min" ["m/s"] ; % Factor 10, s
R45 : "Wind Speed max" ["m/s"] ; % Factor 10, s
R46 : "Wind Speed avg" ["m/s"] ; % Factor 10, s
R47 : "Wind Speed vct" ["m/s"] ; % Factor 10, s
R48 : "Wind Speed fast" ["m/s"] ; % Factor 10, s
R49 : "Precipitation abs." ["mm"] ; % Factor 100, u, max 655.34mm
R50 : "Precipitation diff." ["mm"] ; % Factor 100, u, max 100.00mm
R51 : "Precipitation int." ["mm/h"]; % Factor 100, u, max 200.00mm/h
PRIVATE
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM AnalogInput1 NAMED "Register 1-20" IS
QUESTION
DATA[0] := BYTE(Id); % Modbus unit address
DATA[1] := HEX(04); % Modbus command "04h" Read registers
DATA[2] := RWORD(31); % 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(IF (DATA>=32768) THEN R32:=(DATA-65536)/10; ELSE R32:=DATA/10; ENDIF;); %Factor 10, s
DATA[5] -> RWORD(IF (DATA>=32768) THEN R33:=(DATA-65536)/10; ELSE R33:=DATA/10; ENDIF;); %Factor 10, s
DATA[7] -> RWORD(IF (DATA>=32768) THEN R34:=(DATA-65536)/10; ELSE R34:=DATA/10; ENDIF;); %Factor 10, s
DATA[9] -> RWORD(IF (DATA>=32768) THEN R35:=(DATA-65536)/10; ELSE R35:=DATA/10; ENDIF;); %Factor 10, s
DATA[11] -> RWORD(IF (DATA>=32768) THEN R36:=(DATA-65536)/10; ELSE R36:=DATA/10; ENDIF;); %Factor 10, s
DATA[13] -> RWORD(IF (DATA>=32768) THEN R37:=(DATA-65536)/10; ELSE R37:=DATA/10; ENDIF;); %Factor 10, s
DATA[15] -> RWORD(IF (DATA>=32768) THEN R38:=(DATA-65536)/10; ELSE R38:=DATA/10; ENDIF;); %Factor 10, s
DATA[17] -> RWORD(IF (DATA>=32768) THEN R39:=(DATA-65536)/10; ELSE R39:=DATA/10; ENDIF;); %Factor 10, s
DATA[19] -> RWORD(IF (DATA>=32768) THEN R40:=(DATA-65536)/10; ELSE R40:=DATA/10; ENDIF;); %Factor 10, s
DATA[21] -> RWORD(IF (DATA>=32768) THEN R41:=(DATA-65536)/10; ELSE R41:=DATA/10; ENDIF;); %Factor 10, s
DATA[23] -> RWORD(IF (DATA>=32768) THEN R42:=(DATA-65536)/10; ELSE R42:=DATA/10; ENDIF;); %Factor 10, s
DATA[25] -> RWORD(IF (DATA>=32768) THEN R43:=(DATA-65536)/10; ELSE R43:=DATA/10; ENDIF;); %Factor 10, s
DATA[27] -> RWORD(IF (DATA>=32768) THEN R44:=(DATA-65536)/10; ELSE R44:=DATA/10; ENDIF;); %Factor 10, s
DATA[29] -> RWORD(IF (DATA>=32768) THEN R45:=(DATA-65536)/10; ELSE R45:=DATA/10; ENDIF;); %Factor 10, s
DATA[31] -> RWORD(IF (DATA>=32768) THEN R46:=(DATA-65536)/10; ELSE R46:=DATA/10; ENDIF;); %Factor 10, s
DATA[33] -> RWORD(IF (DATA>=32768) THEN R47:=(DATA-65536)/10; ELSE R47:=DATA/10; ENDIF;); %Factor 10, s
DATA[35] -> RWORD(IF (DATA>=32768) THEN R48:=(DATA-65536)/10; ELSE R48:=DATA/10; ENDIF;); %Factor 10, s
DATA[37] -> RWORD(IF (DATA>=32768) THEN R49:=(DATA-65536)/100; ELSE R49:=DATA/100; ENDIF;); %Factor 100, u
DATA[39] -> RWORD(IF (DATA>=32768) THEN R50:=(DATA-65536)/100; ELSE R50:=DATA/100; ENDIF;); %Factor 100, u
DATA[41] -> RWORD(IF (DATA>=32768) THEN R51:=(DATA-65536)/100; ELSE R51:=DATA/100; ENDIF;); %Factor 100, u
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.