Data types 7 Data types 7.1 Structures 7.1.1 ST_SPA_TIMESTRUCT TYPE ST_SPA_TIMESTRUCT : STRUCT iYear :INT(-2000..6000); (* 4- digit year, valid range: -2000 TO 6000, error code: 1 *) iMonth :INT(1..12); (* 2-digit month, valid range: 1 to 12 (Jan.= 1), error code: 2 *) iDay :INT(1..31); (* 2-digit day, valid range: 1 to 31, error code: 3 *) iHour :INT(0..24); (* Observer local hour, valid range: 0 to 24, error code: 4 *) iMinute :INT(0..59); (* Observer local minute, valid range: 0 to 59, error code: 5 *) iSecond :INT(0..59); (* Observer local second, valid range: 0 TO 59, error code: 6 *) END_STRUCT END_TYPE The structure ST_SPA_TIMESTRUCT contains information on date and time.
It is used at the input for function block FB_SPA [ } 13] in order to specify the local time at the location. This local time has seconds as the smallest unit. Various time scales are in use. The Universal Time (UT1) is used for sun position calculations based on the time specified in ST_SPA_TIMESTRUCT. Provided that an inaccuracy of +/-0.005 ° of the sun angles is acceptable, the Coordinated Universal Time (UTC) can also be used for the time indication. Explanations can be found on the overview page [ } 8] . When specifying the time, the summertime/wintertime changeover must be omitted.
The introduc- tion of daylight saving time in the 20th century only serves the purpose of increasing the number of hours with usable daylight. For the calculation of the sun angles with this library the standard time must be used. Standard time corresponds to winter time in Germany.
7.2 Enumerations 7.2.1 E_SPA_FunctionCode TYPE E_SPA_FunctionCode :( (* enumeration for function codes to select desired final outputs from SPA *) eSPA_ZA, (*calculate zenith AND azimuth [default setting] *) eSPA_ZA_INC, (*calculate zenith, azimuth, AND incidence *) eSPA_ZA_RTS, (*calculate zenith, azimuth, AND sun rise/transit/set values *) eSPA_ALL (*calculate all SPA output values *) ); END_TYPE The enumeration E_SPA_FunctionCode defines constant values for the different functions, which can be executed with the function block FB_SPA [ } 13] . In addition to sun angles, sunrise and sunset can be calculated, depending on the selection.
A detailed explanation of the terminology can be found on the overview page [ } 8] . eSPA_ZA : If the function code eSPA_ZA is selected only the sun angles (zenith, azimuth, azimuth180) are calculated [DEFAULT]. eSPA_ZA_INC : In addition to the sun angles the angle of incidence in relation to the specified surface is issued. TS3900 18 Version: 1.1