SolarNoaa (FB)

FUNCTION_BLOCK SolarNoaa EXTENDS AbbLConC3

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

Enable

BOOL

FALSE

A rising edge (Enable = TRUE) starts the operation, the output Busy goes to TRUE. All other inputs are read and considered continuously. Execution will continue forever until a falling edge (Enable = FALSE) aborts the operation. During Aborting the Busy is still TRUE. Afterward all outputs are reset.

AbbLConC3

Output

Busy

BOOL

FALSE

Operation is running (while output Error is FALSE)

AbbLConC3

Error

BOOL

FALSE

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.

AbbLConC3

Input

Year

INT

2022

2: Year. Range 2000 to 6000

Mon

INT

6

3: Month. Range 1 to 12

Day

INT

1

4: Day. Range 1 to 31

Hour

INT

10

5: Hour. Range 0 to 23

Minute

INT

10

6: Minute. Range 0 to 59

Sec

INT

25

7: Second. Range 0 to 59

TimeZone

LREAL

0

8: Observer time zone(negative west of Greenwich) in hours. Timezone = Standard Time - Universal Time. Maximum value 12

Latitude

LREAL

0

9: Observer latitude in degrees, Negative south of equator. Maximum 90

Longitude

LREAL

0

10: Observer longitude in degrees, Negative west of Greenwich. Maximum 180

Output

ErrorID

ERROR_ID

3: Error Code

Azimuth

LREAL

0

4: Topocentric Sun azimuth, Eastward of North (0°= 360°= North, 90° = East, 180° = South, 270° = West)

Range of values: 0 to 359.9999 Error values:

  • Northern hemisphere: area between latitudes from 70° to 24°. In this area the accuracy of function SolarNoaa is ±0,02° azimuth.

  • Southern hemisphere: area between latitudes from -70° to -24°. In this area the accuracy of function SolarNoaa is ±0,08° azimuth.

  • Equator: area between 24° and -24°. In this area the accuracy of function SolarNoaa is 0,08° azimuth. Note that in this area, around 12:00h (solar time) maximum error values may be greater because of the high speed of the azimuth axis at 12.00h (solar time). It must move from 90° to 270° in a few seconds.

ElevationUncorrected

LREAL

0

5: Sun elevation angle (0° sun rise, 90° zenith). Range of values: -90.00 to 90.00. Negative values=darkness. Format: Degrees, Elevation Error: ±0.015°

Note

  • If elevation goes through zero at special locations at sunset/sunrise, slightly larger errors can occur (mind that energy production is close to zero anyway).

  • For latitudes greater than 72° north or less than 72° south, accuracy may be lower due in part to the effects of atmospheric refraction.

ElevationCorrected

LREAL

0

6: Sun elevation including refraction correction (0° sun rise, 90° zenith). Range of values: -90.00 to 90.00. Negative values=darkness. Format: Degress, Elevation Error: ±0.015°

Note

  • If elevation goes through zero at special locations at sunset / sunrise, also slightly larger errors can occur (mind that energy production is close to zero anyway).

  • Atmospheric refraction is the angular displacement of astronomical objects from their true or geometrical position, because of the bending of rays in the earth’s atmosphere.

Methods:

D_AbortAction

A_StartAction

B_CyclicAction

C_CleaningAction

E_ResetAction

Structure: