Difference between revisions of "Component: BBC Weather Forecast (Comms: IoT/Cloud)"

From Flowcode Help
Jump to navigationJump to search
Line 1: Line 1:
 
+
{| style="width:50%"
 
 
{| width="50%"
 
 
|-
 
|-
| width="20%" style="color: gray;" | Author
+
| width="20%" style="color:gray;" | Author
 
| MatrixTSL
 
| MatrixTSL
 
|-
 
|-
| width="20%" style="color: gray;" | Version
+
| width="20%" style="color:gray;" | Version
| 1.0 (Release)
+
| 1.0
 
|-
 
|-
| width="20%" style="color: gray;" | Category
+
| width="20%" style="color:gray;" | Category
 
| Comms: IoT/Cloud
 
| Comms: IoT/Cloud
 
|}
 
|}
  
  
 +
==BBC Weather Forecast component==
 +
Easily allows you to collect three day forecasted weather metrics for your area using the BBC Weather data service. Supports Min/Max temperature, Wind Direction, Wind Speed, Visibility, Pressure, Humidty, UV Risk, Pollution and Sun Rise/Set times for your selected area.
 +
 +
==Detailed description==
  
==[[File:Component Icon df96ffa1_4d36_453a_8877_758f68a2676c.png|Image]] BBC Weather Forecast component==
+
''No detailed description exists yet for this component''
Easily allows you to collect three day forecasted weather metrics for your area using the BBC Weather data service.
 
Supports Min/Max temperature, Wind Direction, Wind Speed, Visibility, Pressure, Humidty, UV Risk, Pollution and Sun Rise/Set times for your selected area.
 
  
 
==Examples==
 
==Examples==
 +
 +
  
 
Here is a basic example to read the three day forecast data and report the information on a graphical display.
 
Here is a basic example to read the three day forecast data and report the information on a graphical display.
Line 32: Line 34:
 
==Downloadable macro reference==
 
==Downloadable macro reference==
  
===<span style="font-weight: normal;"><u><tt>GetDaySummary</tt></u></span>===
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
Gets the summary of the currently selected day as a string.
+
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetMaxTemperature'''
 +
|-
 +
| colspan="2" | Reads the forecast maximum temperature in the selected scale for the selected day.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:]] -
 +
| width="90%" | Scale
 +
|-
 +
| colspan="2" | 0 = Celcius, 1 = Farenheit&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:]] -
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
'''Parameters'''
 
  
:''This macro has no parameters''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetVisibility'''
 +
|-
 +
| colspan="2" | Reads the forecast visibility for the selected day.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
  
'''Return value'''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetDaySummary'''
 +
|-
 +
| colspan="2" | Gets the summary of the currently selected day as a string.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
:[[Variable Types|STRING]]
 
  
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetMinTemperature'''
 +
|-
 +
| colspan="2" | Reads the forecast minimum temperature in the selected scale for the selected day.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:]] -
 +
| width="90%" | Scale
 +
|-
 +
| colspan="2" | 0 = Celcius, 1 = Farenheit&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:]] -
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
===<span style="font-weight: normal;"><u><tt>GetMaxTemperature</tt></u></span>===
 
Reads the forecast maximum temperature in the selected scale for the selected day.
 
  
'''Parameters'''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetWindDirection'''
 +
|-
 +
| colspan="2" | Reads the forecast wind direction as a string for the selected day.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
:[[Variable Types|BOOL]] ''Scale''
 
::0 = Celcius, 1 = Farenheit
 
  
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''RequestData'''
 +
|-
 +
| colspan="2" | Requests data about your selected location from the BBC weather service. Returns true if the request was successful. Must be called before trying to call any of the GetXXX macros.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:]] -
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
'''Return value'''
 
  
:[[Variable Types|INT]]
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetPollution'''
 +
|-
 +
| colspan="2" | Reads the forecast pollution as a string for the selected day.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
  
===<span style="font-weight: normal;"><u><tt>GetVisibility</tt></u></span>===
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
Reads the forecast visibility for the selected day.
+
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetSunset'''
 +
|-
 +
| colspan="2" | Reads the forecast sunset time as a string for the selected day.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
'''Parameters'''
 
  
:''This macro has no parameters''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetHumidity'''
 +
|-
 +
| colspan="2" | Reads the forecast humidity in Relative Humdity for the selected day.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
  
'''Return value'''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetDayName'''
 +
|-
 +
| colspan="2" | Gets the name of the currently selected day as a string.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
:[[Variable Types|STRING]]
 
  
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetWindSpeed'''
 +
|-
 +
| colspan="2" | Reads the reported wind speed in MPH for the selected day.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
===<span style="font-weight: normal;"><u><tt>GetMinTemperature</tt></u></span>===
 
Reads the forecast minimum temperature in the selected scale for the selected day.
 
  
'''Parameters'''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetLocationCode'''
 +
|-
 +
| colspan="2" | Allows the location code to be altered from the default location code set in the component properties. After changing the location the RequestData macro must be called to refresh the forecast variables.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 +
| width="90%" | NewLocation
 +
|-
 +
| colspan="2" | New location string, see Location property tooltip for more info.&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
:[[Variable Types|BOOL]] ''Scale''
 
::0 = Celcius, 1 = Farenheit
 
  
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetSunrise'''
 +
|-
 +
| colspan="2" | Reads the forecast sunrise time as a string for the selected day.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
'''Return value'''
 
  
:[[Variable Types|INT]]
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetPressure'''
 +
|-
 +
| colspan="2" | Reads the forecast air pressure in milli bar (mb) for the selected day.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
  
===<span style="font-weight: normal;"><u><tt>GetWindDirection</tt></u></span>===
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
Reads the forecast wind direction as a string for the selected day.
+
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetForecastDay'''
 +
|-
 +
| colspan="2" | Chooses which day of the three day forecast to look at. &nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Day
 +
|-
 +
| colspan="2" | 0 = Today, 1 = Tomorrow, 2 = Day After Tomorrow&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
'''Parameters'''
 
  
:''This macro has no parameters''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetUVRisk'''
 +
|-
 +
| colspan="2" | Reads the forecast UV Risk for the selected day.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
  
'''Return value'''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetLocationName'''
 +
|-
 +
| colspan="2" | Reads the reported location name as a string.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
:[[Variable Types|STRING]]
 
  
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
 +
|-
 +
| colspan="2" | Sets up the component ready to collect weather data.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
===<span style="font-weight: normal;"><u><tt>RequestData</tt></u></span>===
 
Requests data about your selected location from the BBC weather service.
 
 
Returns true if the request was successful.
 
 
Must be called before trying to call any of the GetXXX macros.
 
 
'''Parameters'''
 
 
:''This macro has no parameters''
 
 
 
'''Return value'''
 
 
:[[Variable Types|BOOL]] : Returns true if the operation is a success, else false
 
  
 
===<span style="font-weight: normal;"><u><tt>GetPollution</tt></u></span>===
 
Reads the forecast pollution as a string for the selected day.
 
 
'''Parameters'''
 
 
:''This macro has no parameters''
 
 
 
'''Return value'''
 
 
:[[Variable Types|STRING]]
 
 
 
===<span style="font-weight: normal;"><u><tt>GetSunset</tt></u></span>===
 
Reads the forecast sunset time as a string for the selected day.
 
 
'''Parameters'''
 
 
:''This macro has no parameters''
 
 
 
'''Return value'''
 
 
:[[Variable Types|STRING]]
 
 
 
===<span style="font-weight: normal;"><u><tt>GetHumidity</tt></u></span>===
 
Reads the forecast humidity in Relative Humdity for the selected day.
 
 
'''Parameters'''
 
 
:''This macro has no parameters''
 
 
 
'''Return value'''
 
 
:[[Variable Types|BYTE]]
 
 
 
===<span style="font-weight: normal;"><u><tt>GetDayName</tt></u></span>===
 
Gets the name of the currently selected day as a string.
 
 
'''Parameters'''
 
 
:''This macro has no parameters''
 
 
 
'''Return value'''
 
 
:[[Variable Types|STRING]]
 
 
 
===<span style="font-weight: normal;"><u><tt>GetWindSpeed</tt></u></span>===
 
Reads the reported wind speed in MPH for the selected day.
 
 
'''Parameters'''
 
 
:''This macro has no parameters''
 
 
 
'''Return value'''
 
 
:[[Variable Types|BYTE]]
 
 
 
===<span style="font-weight: normal;"><u><tt>SetLocationCode</tt></u></span>===
 
Allows the location code to be altered from the default location code set in the component properties.
 
 
After changing the location the RequestData macro must be called to refresh the forecast variables.
 
 
'''Parameters'''
 
 
:[[Variable Types|<- STRING]] ''NewLocation''
 
::New location string, see Location property tooltip for more info.
 
::''This parameter may be returned back to the caller''
 
 
 
'''Return value'''
 
 
:''This call does not return a value''
 
 
 
===<span style="font-weight: normal;"><u><tt>GetSunrise</tt></u></span>===
 
Reads the forecast sunrise time as a string for the selected day.
 
 
'''Parameters'''
 
 
:''This macro has no parameters''
 
 
 
'''Return value'''
 
 
:[[Variable Types|STRING]]
 
 
 
===<span style="font-weight: normal;"><u><tt>GetPressure</tt></u></span>===
 
Reads the forecast air pressure in milli bar (mb) for the selected day.
 
 
'''Parameters'''
 
 
:''This macro has no parameters''
 
 
 
'''Return value'''
 
 
:[[Variable Types|UINT]]
 
 
 
===<span style="font-weight: normal;"><u><tt>SetForecastDay</tt></u></span>===
 
Chooses which day of the three day forecast to look at.
 
 
'''Parameters'''
 
 
:[[Variable Types|BYTE]] ''Day''
 
::0 = Today, 1 = Tomorrow, 2 = Day After Tomorrow
 
 
 
'''Return value'''
 
 
:''This call does not return a value''
 
 
 
===<span style="font-weight: normal;"><u><tt>GetUVRisk</tt></u></span>===
 
Reads the forecast UV Risk for the selected day.
 
 
'''Parameters'''
 
 
:''This macro has no parameters''
 
 
 
'''Return value'''
 
 
:[[Variable Types|BYTE]]
 
 
 
===<span style="font-weight: normal;"><u><tt>GetLocationName</tt></u></span>===
 
Reads the reported location name as a string.
 
 
'''Parameters'''
 
 
:''This macro has no parameters''
 
 
 
'''Return value'''
 
 
:[[Variable Types|STRING]]
 
 
 
===<span style="font-weight: normal;"><u><tt>Initialise</tt></u></span>===
 
Sets up the component ready to collect weather data.
 
 
'''Parameters'''
 
 
:''This macro has no parameters''
 
 
 
'''Return value'''
 
 
:''This call does not return a value''
 
 
 
 
==Simulation macro reference==
 
 
''This component does not contain any simulation macros''
 
  
  
 
==Property reference==
 
==Property reference==
<span style="font-weight: normal;"><u>Network Comms Component</u></span>
 
  
This property is of type ''Panel object'' and can be referenced with the variable name ''NetworkCommsComp''.
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
+
|-
Network Communications component to use as the bridge to the TCP/IP network.
+
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
 
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
<span style="font-weight: normal;"><u>BBC IP Address</u></span>
+
|-
 
+
|-
This property is of type ''Line of text'' and can be referenced with the variable name ''IPAddr''.
+
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
 
+
| width="90%" | Network Comms Component
IP Address linked to the following URL: weather-broker-cdn.api.bbci.co.uk
+
|-
 
+
| colspan="2" | Network Communications component to use as the bridge to the TCP/IP network.&nbsp;
<span style="font-weight: normal;"><u>Location Code</u></span>
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
This property is of type ''Line of text'' and can be referenced with the variable name ''Location''.
+
| width="90%" | BBC IP Address
 
+
|-
BBC code for your area.  
+
| colspan="2" | IP Address linked to the following URL: weather-broker-cdn.api.bbci.co.uk&nbsp;
 
+
|-
In a web browser go to www.bbc.co.uk/weather/
+
| width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
 
+
| width="90%" | Location Code
Then type in your city in the search bar and your code will be shown at the end of the URL.
+
|-
 
+
| colspan="2" | BBC code for your area. In a web browser go to www.bbc.co.uk/weather/ Then type in your city in the search bar and your code will be shown at the end of the URL. For example Manchester in the UK = 2643123 In the UK you can also use the first half of your post code, e.g. HX1&nbsp;
For example Manchester in the UK = 2643123
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
In the UK you can also use the first half of your post code, e.g. HX1
+
| width="90%" | Receive Timeout
 
+
|-
<span style="font-weight: normal;"><u>Receive Timeout</u></span>
+
| colspan="2" | Maximum time to wait for valid incoming data.&nbsp;
 
+
|-
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''RxTimeout''.
+
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
 
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Connections'''  
Maximum time to wait for valid incoming data.
+
|-
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Simulations'''  
 +
|-
 +
|}

Revision as of 19:48, 16 November 2021

Author MatrixTSL
Version 1.0
Category Comms: IoT/Cloud


BBC Weather Forecast component

Easily allows you to collect three day forecasted weather metrics for your area using the BBC Weather data service. Supports Min/Max temperature, Wind Direction, Wind Speed, Visibility, Pressure, Humidty, UV Risk, Pollution and Sun Rise/Set times for your selected area.

Detailed description

No detailed description exists yet for this component

Examples

Here is a basic example to read the three day forecast data and report the information on a graphical display.

FC6 Icon.png BBCWeatherForecastDemo


The location can be set by adjusting the BBC Weather location property, see the component property tooltips for more information on how to do this.

On an embedded device you would need a TCP/IP component to allow the communications to the BBC server. This then links to the Network Comms component.

Downloadable macro reference

Fc9-comp-macro.png GetMaxTemperature
Reads the forecast maximum temperature in the selected scale for the selected day. 
[[File:]] - Scale
0 = Celcius, 1 = Farenheit 
[[File:]] - Return


Fc9-comp-macro.png GetVisibility
Reads the forecast visibility for the selected day. 
Fc9-string-icon.png - STRING Return


Fc9-comp-macro.png GetDaySummary
Gets the summary of the currently selected day as a string. 
Fc9-string-icon.png - STRING Return


Fc9-comp-macro.png GetMinTemperature
Reads the forecast minimum temperature in the selected scale for the selected day. 
[[File:]] - Scale
0 = Celcius, 1 = Farenheit 
[[File:]] - Return


Fc9-comp-macro.png GetWindDirection
Reads the forecast wind direction as a string for the selected day. 
Fc9-string-icon.png - STRING Return


Fc9-comp-macro.png RequestData
Requests data about your selected location from the BBC weather service. Returns true if the request was successful. Must be called before trying to call any of the GetXXX macros. 
[[File:]] - Return


Fc9-comp-macro.png GetPollution
Reads the forecast pollution as a string for the selected day. 
Fc9-string-icon.png - STRING Return


Fc9-comp-macro.png GetSunset
Reads the forecast sunset time as a string for the selected day. 
Fc9-string-icon.png - STRING Return


Fc9-comp-macro.png GetHumidity
Reads the forecast humidity in Relative Humdity for the selected day. 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png GetDayName
Gets the name of the currently selected day as a string. 
Fc9-string-icon.png - STRING Return


Fc9-comp-macro.png GetWindSpeed
Reads the reported wind speed in MPH for the selected day. 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png SetLocationCode
Allows the location code to be altered from the default location code set in the component properties. After changing the location the RequestData macro must be called to refresh the forecast variables. 
Fc9-string-icon.png - STRING NewLocation
New location string, see Location property tooltip for more info. 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png GetSunrise
Reads the forecast sunrise time as a string for the selected day. 
Fc9-string-icon.png - STRING Return


Fc9-comp-macro.png GetPressure
Reads the forecast air pressure in milli bar (mb) for the selected day. 
Fc9-u16-icon.png - UINT Return


Fc9-comp-macro.png SetForecastDay
Chooses which day of the three day forecast to look at.  
Fc9-u8-icon.png - BYTE Day
0 = Today, 1 = Tomorrow, 2 = Day After Tomorrow 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png GetUVRisk
Reads the forecast UV Risk for the selected day. 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png GetLocationName
Reads the reported location name as a string. 
Fc9-string-icon.png - STRING Return


Fc9-comp-macro.png Initialise
Sets up the component ready to collect weather data. 
Fc9-void-icon.png - VOID Return



Property reference

Fc9-prop-icon.png Properties
Fc9-type-17-icon.png Network Comms Component
Network Communications component to use as the bridge to the TCP/IP network. 
Fc9-type-10-icon.png BBC IP Address
IP Address linked to the following URL: weather-broker-cdn.api.bbci.co.uk 
Fc9-type-10-icon.png Location Code
BBC code for your area. In a web browser go to www.bbc.co.uk/weather/ Then type in your city in the search bar and your code will be shown at the end of the URL. For example Manchester in the UK = 2643123 In the UK you can also use the first half of your post code, e.g. HX1 
Fc9-type-21-icon.png Receive Timeout
Maximum time to wait for valid incoming data. 
Fc9-conn-icon.png Connections
Fc9-conn-icon.png Simulations