23 - 05 - 2019

Weather library

Block ForecastMyWeather2

License: Hobby, Industrial

To add a weather forecast to the diagram, you need to do the following:

  • Open the website MyWeather2.com, go to WEATHER API -> 2 Day Forecast Weather API. Then create an account and get your unique Access Code;

  • Add an ImageControl to the diagram:

  • Add a block ForecastMyWeather2. Set the GPS coordinates of the place where you want the weather forecast - block's parameters Latitude, Longitude. Set the parameter UniqueAccessCode gotten from MyWeather2.com WEB site.

The block gives two days forecast - first day is today and means what is the weather now, second day is tomorow. If the block is not connected with an ImageControl, the block will work too and block's outputs will have correct values received from MyWeather2.com WEB site.

Block's parameters:

  • Latitude, Longitude - GPS coordinates of the monitoring place;
  • UniqueAccessCode - a code gotten from MyWeather2.com site;
  • Connected to ImageControl - the name of ImageControl, but the block can works without connected control too;
  • ForecastPerMin - on how many minutes to connect the block to MyWeather2.com and to receive the forecast. If the input DoForecast is connected, the parameter ForecastPerMin is without matter;
  • Disable - if the parameter is checked, the block will not work;

Block's inputs:

  • DoForecast - if the input is connected and becomes to a high level, the block will connect to the WEB site MyWeather2.com and will receive the forecast information;
  • InLatitude, InLongitude - if the inputs are connected, the block will show the forecast information for a place with this GPS coordinates instead of the GPS coordinates located in block's parameters Latitude, Longitude;

Block's outputs:

  • CurrLowTemp, CurrHiTemp - min, max temperatures for today;
  • CurrWindSpeed, CurrWindDirection - wind speed and direction for today;
  • CurrWetherID, CurrWeatherText - describes the weather condition for today. The full list WeatherID:WeatherText is shown below;
  • TomorowLowTemp, TomorowHiTemp - min, max temperatures for today;
  • TomorowWindSpeed, TomorowWindDirection - wind speed and direction for today;
  • TomorowWetherID, TomorowWeatherText - describes the weather condition for today. The full list WeatherID:WeatherText is shown below;
  • OnForecast - becomes to a high level, the block receive the forecast information from the WEB site, show it on the ImageControl and update its outputs;
  • OnError - the forecast information is not received from the WEB site;
  • Error - the text meaning of the error;
  • ForecastTime - DataTime of the last forecast;

List of weather conditions, ID: Name:
0: "Thunderstorm"
1: "Rain and windy"
2: "Light rain and windy"
3: "Thunderstorms in the vicinity"
4: "Heavy thunderstorm"
5: "Sleet"
6: "Hail"
7: "Freezing sleet"
8: "Freezing drizzle"
9: "Drizzle"
10: "Freezing rain"
11: "Light rain"
12: "Rain"
13: "Snow flurries"
14: "Light snow"
15: "Snow blowing"
16: "Snow"
17: "Light rain with thunder"
18: "Melting hail"
19: "Dust"
20: "Fog"
21: "Haze"
22: "Smoke"
23: "Windy"
24: "Variable wind"
25: "Frigid"
26: "Cloudy"
27: "Mostly cloudy (night)"
28: "Mostly cloudy (day)"
29: "Partly cloudy (night)"
30: "Partly cloudy (day)"
31: "Clear"
32: "Sunny"
33: "Fair (night)"
34: "Fair (day)"
35: "Rain with thunder"
36: "Hot"
37: "Scattered thunderstorms (day)"
38: "Thunder"
39: "Scattered showers (day)"
40: "Heavy rain"
41: "Scattered snow showers (day)"
42: "Heavy snow"
43: "Snow and windy"
44: "Showers in the vicinity"
45: "Scattered showers (night)"
46: "Scattered snow showers (night)"
47: "Scattered thunderstorms (night)"

 

Block SunInfo

License: Hobby, Industrial

The block provides information based on GPS coordinates of your living place for sunrise, sunset, morning and evening twilight times, noont, the duration of the day in hours and minutes. All the Sun information is changed every day, because of the movement of the celestial bodies. The block is suitable for controlling outdoor lighting.

Block's parameters:

  • Latitude, Longitude - GPS coordinates of the monitoring place;
  • Time zone - time zone of the monitoring place;

Block's inputs:

  • DoCalc - if the input is connected, the block will calculate the sun information when the input becomes to a high value. If the input is not connected, the block will calculate the information on every minute;

Block's outputs:

  • IsNight - the output is at high level between sunset and sunrise;
  • IsNightTwilight - is at  high level between night twilight and morning twilight;
  • SunRise - the time sunrise;
  • SunSet - the time of sunset;
  • Noont - the time of noont;
  • MorningTwilightBegin - the time of the morning twilight;
  • EveningTwilightEnd - the time of the evening twilight;
  • DayLenH, DayLenMin - length of the day;

 

Block WindRose

License: Hobby, Industrial

The block is used to draw the wind rose with the data contained in the block's input InDataSet. The input DataSet must contain at least three columns - column for DateTime, for wind speed and for wind direction. It is important for the block to be connected with an ImageControl, in whose boundaries the wind roses to be drawn. In one ImageControl can be shown many wind roses, so we can see the history of the wind for last many hours. At the bottom left is shown the average wind speed of the rose, at the bottom right - the maximum wind speed for the rose.

Block's parameters for colors:

  • ColorBackground - color of the background of the ImageControl;
  • ColorGrid - color of the all drawn elements as circles, text;
  • ColorWind - the color of every dot of the wind at the wind rose;

Block's parameters for input InDataSet:

  • ColumnData - the name of the DataTime column located in the input InDataSet;
  • ColumnSpeed - the name of the column with a Wind speed information located in the input InDataSet;
  • ColumnDirection - the name of the column with a Wind direction information located in the input InDataSet;

Block's parameters for drawing the wind rose:

  • PeriodType - determines the time period of data taken from the InDataSet and shown in the roses. If PeriodType is LasMinutes, LasHours or LasDays, then this parameter works together with a parameter Last. For example, if PeriodType is LastHours and Last is 12, then last 12 hours will be shown at the Wind roses. If PeriodType is WholePeriodInDataSet, then all the data located in InDataSet will be shows at the wind roses;
  • Last - work together with parameter PeriodType and determines the priod of shown data at wind roses;
  • NumRoses - determines how many roses will be shown at ImageControl. For example, if PeriodType is LastHours, Last is 12, NumRoses is 6, then 6 roses will be shown, every roses will show 2 hours information, because (6 roses)*(2 hours) = 12h;
  • NumGridCircles - determines how many circles contains one rose;
  • MaxWind - determines the last circle of the rose at what wind speed corresponds;

Block's inputs:

  • InDataSet - a DataSet with at least three columns for DateTime, Wind speed and Direction, and records with wind measured values to be shown in the ImageControl;
  • DoDraw - when the input becomes to a high value, the data from the input InDataSet will be shown at the ImageControl;
  • FromPeriod, ToPeriod - if this two inputs are connected, then the shown period will be gotten from this inputs instead to be calculated based on the parameters PeriodType, Last;

Block's outputs:

  • OnReady - becomes to a high level, when the roses are drawn;

 

Block WS2350

License: Hobby, Industrial

Using this block, we can read the current measured values of the weather station WS2350 or compatible with it stations. In order do this, there must be installed and running HeavyWeather software. During the work of the HeavyWeather software, it connects to the weather station, reads its current weather data, and updates the file: c:\HeavyWeather\currdat.lst. The block WS2350 reads this file every minute and updates the block's output with new read information.

Block's parameters:

  • HeavyWeatherPath - the install path of the HeavyWeather software;
  • ScanRateSec - time period in seconds between two readings of currdat.lst file. Because HeavyWeather updates the file every minute, it is better to read the file for a shorter period, for example, 40 sec;
  • WaitForRestartHWSec - shows how much time to wait for a file change: currdat.lst. If there is no change, then the block's output OnDoRestartHB will becomes to a high value. With other blocks from the System library, we can restart the HeavyWeather software;

Block's outputs:

  • OnRead - becomes to a high level, then a new data is read from the weather station;
  • OnDoRestartHW - if there is long time no new data from the weather station, the block can restart the HeavyWeather software;
  • NumRestarts - the counter shows the number of attempts to restart the HeavyWeather software;

All the other block's outputs correspond with the weather information read from the station;

 

Block WindChill

License: Hobby, Industrial

The block calculates a Wind chill value based on the two block's inputs for temperature and wind speed.

Block's parameters:

  • Type - the parameter may be C, km/h(degrees centigrade and kilometers per hour) or F, mph(fahrenheit and miles per hour);

Block's inputs:

  • DoCalc - if the input is connected, the block will calculate the wind chill value when the input becomes to a high value, in other case the calculations will happen many times per second, which is load to the processor;
  • Temp, Wind - the needful weather parameters. They can be in C, km/h or F, mph;

Block's outputs:

  • OnReady - becomes to a high level on every new calculation;
  • Out - the calculated wind chill;

 

Block DewPoint

License: Hobby, Industrial

The block calculates a dew point value based on the two block's inputs for air temperature and air humidity.

Block's inputs:

  • DoCalc - if the input is connected, the block will calculate the dew point value when the input becomes to a high value, in other case the calculations will happen many times per second, which is load to the processor;
  • Temp, Humidity - the needful weather parameters. The temperature is in degrees centigrade;

Block's outputs:

  • OnReady - becomes to a high level on every new calculation;
  • Out - the calculated dew point;