CurrentAndForecastWeather (FB)¶
FUNCTION_BLOCK CurrentAndForecastWeather EXTENDS APICaller
Requests a current weather report and a hourly 48h weather forecast report from the API server and saves the information in the given “CurrentWeatherData” and “ForeastWeatherBatch” data structures.
- InOut:
Scope
Name
Type
Initial
Comment
Inherited from
Input
xExecuteBOOLRising edge: Starts defined operationFALSE: Resets the defined operation after ready condition was reachedETrig
Output
xDoneBOOLTRUE: Ready condition reachedETrig
xBusyBOOLTRUE: Operation is runningETrig
xErrorBOOLTRUE: Error condition reachedETrig
Input
sApiKeyOutput
eErrorsConstructedUrlContains the internally constructed URL, that is used to retrieve data from the API Server.
xUrlConstructedBOOLIs TRUE, when the content of sConstructedUrl is valid (after the internal URL Construction is finished).
Input
pGeoLocationPOINTER TO GeoLocation
eUnitsUNIT_OPTION.METRIC
Inout
dataCurrentdataForecast
Methods:
CallAPI, inherited from APICaller
CheckGeoLocationParam, inherited from APICaller
CleanupAction, inherited from APICaller
CyclicAction, inherited from APICaller
ProcessResponse, inherited from APICaller
ResetAction, inherited from APICaller
StartProcessResponse, inherited from APICaller
Structure: