Table of Contents

Solar calculator - Astronomical clock

Function name

T40_SOLARCALCULATOR

ST call

PROGRAM TEST_T40
   VAR 
        DT1,DT2,DT3: DT;
        REAL1,REAL2,REAL3,REAL4: REAL;
          BOOL1: BOOL;
        FB: LIB.HVAC.V1_0.T40_SOLARCALCULATOR;
  END_VAR
 FB(DATETIME:= DT1, LATITUDE:= REAL1, LONGITUDE:= REAL2, SUNSHINE=> BOOL1, AZIMUTH=> REAL3, ALTITUDE=> REAL4, SUNRISE=> DT2, SUNSET=> DT3);   
END_PROGRAM

Library

LIB\HVAC

Version

V1.0

Description

The function calculates the position of the Sun for given geographical coordinates and time. It provides information on the position of the Sun against the horizon, and time of sunrise and sunset for a particular day. It is used to control blinds, and in photovoltaic plants monitoring systems.

Inputs

Input TypeDescription Default value
DATETIME DT Time and date for which the Sun position has to be calculated0001-01-01-00:00:00
LATITUDE REALLatitude in degrees (°) as a decimal number 50
LONGITUDEREALLongitude in degrees (°) as a decimal number 14,3999996185303

Outputs

Output TypeDescription
SUNSHINEBOOLTrue, if the Sun is above the horizon
AZIMUTH REALHorizontal angle (in degrees) which the Sun shows according to the observer
ALTITUDEREALVertical angle (in degrees) which the Sun shows according to the observer
SUNRISE DT Date and time of sunrise in the given day
SUNSET DT Date and time of sunset in the given day

Function

The Solar calculator uses equations for description of relative movement of the Sun against the Earth. The lattitude and longitude will most probably be constants: the calculation is performed for the place where the PLC is installed.

Application example

The ALARMS_ENABLED variable is used to unblock all performance-based alarms of a photovoltaic plant. The alarms may be active only if they are enabled by a global variable  ENABLE_ALARMS, if the Sun is above the horizon (the output SUNSHINE of the block T40 is TRUE), and the irradiance sensor shows value higher than approximately 300 W/m2.