WSC11 Väderstation (modbus)
Detaljer
Beskrivning
.
Bruksanvisning
Komihåg att ändra till rätt baudrate. Standard är tydligen 9600.
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
DEVICETYPE WSC11 NAMED "WSC11" TYPEID 17908 IS
PARAMETER
Id : "Adress";
PUBLIC
V1 : "Wind speed" ["m/s"]DEC1; %
V2 : "Mean Wind speed" ["m/s"]DEC1; %
V3 : "Wind direction" ["°"]DEC1; %
V4 : "Mean Wind direction" ["°"]DEC1; %
V5 : "Air temperature" ["°C"]DEC1; %
V6 : "Interior temperature" ["°C"]DEC1; %
V7 : "Dew temperature" ["°C"]DEC1; %
V8 : "Rel Humidity" ["%rh"]DEC1; %
V9 : "Abs Humidity" ["g/m3"]DEC2; %
V10 : "Abs Air pressure" ["hPa"]DEC2; %
V11 : "Rel Air pressure" ["hPa"]DEC2; % relative to sea level
V12 : "Global radiation" ["W/m2"]DEC1; %
V13 : "Brightness North" ["kLux"]DEC1; %
V14 : "Brightness East" ["kLux"]DEC1; %
V15 : "Brightness South" ["kLux"]DEC1; %
V16 : "Brightness West" ["kLux"]DEC1; %
V17 : "Twilight" ["Lux"]INT; %
V18 : "Sun pos Elevation" ["°"]DEC1; %
V19 : "Sun position Azimuth" ["°"]DEC1; %
PRIVATE
tmp;
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM Read NAMED "Read" IS
QUESTION
DATA[0] := BYTE(Id);
DATA[1] := HEX(04);
DATA[2] := RWORD(35001);
DATA[4] := RWORD(50);
ANSWER SIZE 105
DATA[0] = BYTE(Id);
DATA[1] = BYTE(04);
DATA[3] -> RWORD(tmp:=DATA*65536;);
DATA[5] -> RWORD(V1:=(DATA+tmp)/10;);
DATA[7] -> RWORD(tmp:=DATA*65536;);
DATA[9] -> RWORD(V2:=(DATA+tmp)/10;);
DATA[11] -> RWORD(tmp:=DATA*65536;);
DATA[13] -> RWORD(V3:=(DATA+tmp)/10;);
DATA[15] -> RWORD(tmp:=DATA*65536;);
DATA[17] -> RWORD(V4:=(DATA+tmp)/10;);
DATA[19] -> RWORD(IF (DATA>=32768) THEN tmp:=(DATA-65536); ELSE tmp:=DATA; ENDIF;);
DATA[21] -> RWORD(V5:=(DATA+(tmp*65536))/10;);
DATA[23] -> RWORD(IF (DATA>=32768) THEN tmp:=(DATA-65536); ELSE tmp:=DATA; ENDIF;);
DATA[25] -> RWORD(V6:=(DATA+(tmp*65536))/10;);
DATA[27] -> RWORD(IF (DATA>=32768) THEN tmp:=(DATA-65536); ELSE tmp:=DATA; ENDIF;);
DATA[29] -> RWORD(V7:=(DATA+(tmp*65536))/10;);
DATA[31] -> RWORD(tmp:=DATA*65536;);
DATA[33] -> RWORD(V8:=(DATA+tmp)/10;);
DATA[35] -> RWORD(tmp:=DATA*65536;);
DATA[37] -> RWORD(V9:=(DATA+tmp)/100;);
DATA[39] -> RWORD(tmp:=DATA*65536;);
DATA[41] -> RWORD(V10:=(DATA+tmp)/100;);
DATA[43] -> RWORD(tmp:=DATA*65536;);
DATA[45] -> RWORD(V11:=(DATA+tmp)/100;);
DATA[47] -> RWORD(tmp:=DATA*65536;);
DATA[49] -> RWORD(V12:=(DATA+tmp)/10;);
DATA[51] -> RWORD(tmp:=DATA*65536;);
DATA[53] -> RWORD(V13:=(DATA+tmp)/10;);
DATA[55] -> RWORD(tmp:=DATA*65536;);
DATA[57] -> RWORD(V14:=(DATA+tmp)/10;);
DATA[59] -> RWORD(tmp:=DATA*65536;);
DATA[61] -> RWORD(V15:=(DATA+tmp)/10;);
DATA[63] -> RWORD(tmp:=DATA*65536;);
DATA[65] -> RWORD(V16:=(DATA+tmp)/10;);
DATA[67] -> RWORD(tmp:=DATA*65536;);
DATA[69] -> RWORD(V17:=(DATA+tmp););
DATA[95] -> RWORD(IF (DATA>=32768) THEN tmp:=(DATA-65536); ELSE tmp:=DATA; ENDIF;);
DATA[97] -> RWORD(V18:=(DATA+tmp)/10;);
DATA[99] -> RWORD(IF (DATA>=32768) THEN tmp:=(DATA-65536); ELSE tmp:=DATA; ENDIF;);
DATA[101] -> RWORD(V19:=(DATA+tmp)/10;);
TIMEOUT 300
END;
END;
END;
PARAMETER
Id : "Adress";
PUBLIC
V1 : "Wind speed" ["m/s"]DEC1; %
V2 : "Mean Wind speed" ["m/s"]DEC1; %
V3 : "Wind direction" ["°"]DEC1; %
V4 : "Mean Wind direction" ["°"]DEC1; %
V5 : "Air temperature" ["°C"]DEC1; %
V6 : "Interior temperature" ["°C"]DEC1; %
V7 : "Dew temperature" ["°C"]DEC1; %
V8 : "Rel Humidity" ["%rh"]DEC1; %
V9 : "Abs Humidity" ["g/m3"]DEC2; %
V10 : "Abs Air pressure" ["hPa"]DEC2; %
V11 : "Rel Air pressure" ["hPa"]DEC2; % relative to sea level
V12 : "Global radiation" ["W/m2"]DEC1; %
V13 : "Brightness North" ["kLux"]DEC1; %
V14 : "Brightness East" ["kLux"]DEC1; %
V15 : "Brightness South" ["kLux"]DEC1; %
V16 : "Brightness West" ["kLux"]DEC1; %
V17 : "Twilight" ["Lux"]INT; %
V18 : "Sun pos Elevation" ["°"]DEC1; %
V19 : "Sun position Azimuth" ["°"]DEC1; %
PRIVATE
tmp;
BAUDRATE 9600;
CHECKSUM MODBUS SWAPPED;
TELEGRAM Read NAMED "Read" IS
QUESTION
DATA[0] := BYTE(Id);
DATA[1] := HEX(04);
DATA[2] := RWORD(35001);
DATA[4] := RWORD(50);
ANSWER SIZE 105
DATA[0] = BYTE(Id);
DATA[1] = BYTE(04);
DATA[3] -> RWORD(tmp:=DATA*65536;);
DATA[5] -> RWORD(V1:=(DATA+tmp)/10;);
DATA[7] -> RWORD(tmp:=DATA*65536;);
DATA[9] -> RWORD(V2:=(DATA+tmp)/10;);
DATA[11] -> RWORD(tmp:=DATA*65536;);
DATA[13] -> RWORD(V3:=(DATA+tmp)/10;);
DATA[15] -> RWORD(tmp:=DATA*65536;);
DATA[17] -> RWORD(V4:=(DATA+tmp)/10;);
DATA[19] -> RWORD(IF (DATA>=32768) THEN tmp:=(DATA-65536); ELSE tmp:=DATA; ENDIF;);
DATA[21] -> RWORD(V5:=(DATA+(tmp*65536))/10;);
DATA[23] -> RWORD(IF (DATA>=32768) THEN tmp:=(DATA-65536); ELSE tmp:=DATA; ENDIF;);
DATA[25] -> RWORD(V6:=(DATA+(tmp*65536))/10;);
DATA[27] -> RWORD(IF (DATA>=32768) THEN tmp:=(DATA-65536); ELSE tmp:=DATA; ENDIF;);
DATA[29] -> RWORD(V7:=(DATA+(tmp*65536))/10;);
DATA[31] -> RWORD(tmp:=DATA*65536;);
DATA[33] -> RWORD(V8:=(DATA+tmp)/10;);
DATA[35] -> RWORD(tmp:=DATA*65536;);
DATA[37] -> RWORD(V9:=(DATA+tmp)/100;);
DATA[39] -> RWORD(tmp:=DATA*65536;);
DATA[41] -> RWORD(V10:=(DATA+tmp)/100;);
DATA[43] -> RWORD(tmp:=DATA*65536;);
DATA[45] -> RWORD(V11:=(DATA+tmp)/100;);
DATA[47] -> RWORD(tmp:=DATA*65536;);
DATA[49] -> RWORD(V12:=(DATA+tmp)/10;);
DATA[51] -> RWORD(tmp:=DATA*65536;);
DATA[53] -> RWORD(V13:=(DATA+tmp)/10;);
DATA[55] -> RWORD(tmp:=DATA*65536;);
DATA[57] -> RWORD(V14:=(DATA+tmp)/10;);
DATA[59] -> RWORD(tmp:=DATA*65536;);
DATA[61] -> RWORD(V15:=(DATA+tmp)/10;);
DATA[63] -> RWORD(tmp:=DATA*65536;);
DATA[65] -> RWORD(V16:=(DATA+tmp)/10;);
DATA[67] -> RWORD(tmp:=DATA*65536;);
DATA[69] -> RWORD(V17:=(DATA+tmp););
DATA[95] -> RWORD(IF (DATA>=32768) THEN tmp:=(DATA-65536); ELSE tmp:=DATA; ENDIF;);
DATA[97] -> RWORD(V18:=(DATA+tmp)/10;);
DATA[99] -> RWORD(IF (DATA>=32768) THEN tmp:=(DATA-65536); ELSE tmp:=DATA; ENDIF;);
DATA[101] -> RWORD(V19:=(DATA+tmp)/10;);
TIMEOUT 300
END;
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.