Function Block SUNPOS

The Function Block SUNPOS calculates the azimuth and elevation of the sun.

Note: The calculations do not exactly match the function blocks SUNINFO and DAYLIGHT, as a different formula is used there for calculation.

Input DT

Defines the time of calculation in DT#. This way, it can be determined, for example, where the sun is located at a certain hour or on a specific date. If the input is not used or the value NULL is applied, the current time is used.

Input PT

Defines the interval for calculating the position of the sun. It is recommended to set this value high. For shading, a calculation every 20 seconds is completely sufficient. If the input is not used or the value NULL is applied, T#1m is assumed.

On restart or when changing an input (except for DT), all outputs are recalculated immediately.

Input Temperature [°C]

With this input, a temperature in degrees Celsius can optionally be passed as a number for calculation. This increases the accuracy of the calculation. It is used to compensate for astronomical refraction. If the input is not used or the value NULL is applied, the default value of 10 is used.

Input Barometric Pressure [mbar]

With this input, air pressure in millibars or hectopascals can optionally be passed as a number for calculation. This increases the accuracy of the calculation. It is used to compensate for astronomical refraction. If the input is not used or the value NULL is applied, the default value of 1'013 is used.

Input Latitude

This input defines the latitude of the position as a floating-point number. The value is passed as a decimal number.

If this input Latitude and Longitude is not defined or NULL, the coordinate is taken from the project.

Input Longitude

This input defines the longitude of the position as a floating-point number. The value is passed as a decimal number.

If this input Latitude and Longitude is not defined or NULL, the coordinate is taken from the project.

Output Azimuth

Returns the calculated azimuth, or also the angle between the meridian plane and the vertical plane of a celestial body.

Output Elevation

Returns the height of the sun, also elevation as an angle. If the sun is below the 0° horizon, this angle is negative.

Tip: If the angle from the zenith needs to be determined, it can be calculated with 90-Elevation.