SolarNoaa (FB)
FUNCTION_BLOCK SolarNoaa EXTENDS AbbLConCA
This function block calculates the position of the sun, elevation and azimuth, according to: date, time and location, with an azimuth error = ± 0.01° and elevation error = ±0.03°. This function embeds the SOLAR_NOAAs algorithm. Output parameters are solar elevation and solar azimuth. These outputs are the topocentric coordinates of the sun which use the observer’s location as a centre of the coordinate system.
- InOut:
Scope
Name
Type
Initial
Comment
Inherited from
Input
EnableBOOLFALSE
A rising edge (Enable = TRUE) starts the operation, the output Busy goes to TRUE. All other inputs are read and considered continuously. A falling edge (Enable = FALSE) aborts the operation. During Aborting the Busy is still TRUE. Afterward all outputs are reset.
AbbLConCA
Output
BusyBOOLFALSE
Operation is running (while output Error is FALSE)
AbbLConCA
ErrorBOOLFALSE
Operation is stopped with error (while output Busy is FALSE). This output is TRUE for at least one cycle or until Enable is set to FALSE. The output ErrorID gives more details about the error.
AbbLConCA
Input
YearINT2022
2: Year min 2000 max 6000
MonINT6
3: Month min 1 max 12
DayINT1
4: Day min 1 max 31
HourINT10
5: Hour min 0 max 59
MinuteINT10
6: Minute min 0 max 59
SecINT25
7: Second min 0 max 59
TimeZoneLREAL0
8: Observer time zone in hours max 12
LatitudeLREAL0
9: Observer latitude in degrees max 90
LongitudeLREAL0
10: Observer longitude in degrees max 180
Output
ErrorID3: error code
AzimuthLREAL0
4: sun azimuth (0°=360°=north, 90° = east, 180° = south, 270° = west)
ElevationUncorrectedLREAL0
5: sun elevation (0° sun rise, max 90° zenith)
ElevationCorrectedLREAL0
6: sun elevation including refraction correction (0° sun rise, max 90° zenith)
Methods:
D_AbortAction
A_StartAction
B_CyclicAction
C_CleaningAction
E_ResetAction
Structure: