API Requirements 4.1.2 Data types 4.1.2.1 Structures 4.1.2.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 *) TF3900 20 Version:
1.1.1 Name Type Description fZenith LREAL The zenith angle of the sun is defined as the angle between the vertical above the observer (zenith) and the connecting line between the observer and the sun. If the sun is absolutely vertical above the observer, the zenith angle is 0°. Sometimes the sun elevation angle (SunElevation or Altitude) is also used. The following applies: 90° - zenith angle = altitude fAzimuth LREAL The azimuth coincides with the horizon. North is 0°, with the value increasing in clockwise direction. (east = 90°, south=180°, west=270°). A graphical representation of the sun angles can be found on the overview page [} 8].
fAzimuth180 LREAL This value corresponds in meaning to the azimuth. However, the azimuth180 is assigned the value 0° in the south. From there the value increases positively in clockwise direction and negatively in counter-clockwise direction. (azimuth-180° = azimuth180) fIncidence LREAL Indicates the angle of solar incidence in relation to the surface specified at the input. If the surface is horizontal fIncidence matches the value of fZenith. fSuntransit LREAL Indicates the time of the solar apex. It is specified in hours and used the time zone created at the input.
The following type conversion can be used to convert the variable fSuntransit (analogous to fSunrise and fSunset) to the TIME format: tSuntransit := LREAL TO TIME(fbSPA.fSuntransit*60*60*1000); _ _ fSunrise LREAL Indicates the sunrise time. It is specified in hours and used the time zone created at the input. fSunset LREAL Indicates the sunset time. It is specified in hours and used the time zone created at the input. bError BOOL Is TRUE if an error has occurred. In this case iErrorCode indicates the respective error code. iErrorCode UINT Indicates the error value for the calculation. If an error has occurred this value is not equal zero.
All possible error values are summarized in the enumeration E SPA ErrorCode [} 21]. _ _ Development environment Target platform PLC libraries to include TwinCAT V3.1.4011 PC or CX (x86, x64, ARM) Tc2 SPA _