beckhoff TF3900 — 4.1.2.2.2 E_SPA_ErrorCode

API 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 [ } 17] 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. If an inaccuracy of +/-0.005° is acceptable for the sun angles, the coordinated world time (UTC) may be used as the time. Explanatory notes can be found on the overview page [ } 8] .

Summer and winter time clock change must not be used. The initiation of summer time (daylight saving time) in the 20.century should only extend the usable number of hours daylight per day. It's not common practice in all countries. For calculating the sun position with this library the Standard Time has to be used. In germany the Standard Time is equal to the winter time. 4.1.2.2 Enumerations 4.1.2.2.1 E_SPA_FunctionCode The enumeration E_SPA_FunctionCode defines constant values for the different functions, which can be executed with the function block FB_SPA [ } 17] . 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] . The time required for a calculation strongly depends on the choice of function code. (* enumeration for function codes to select desired final outputs from SPA *) TYPE E_SPA_FunctionCode :( 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 4.1.2.2.2 E_SPA_ErrorCode The enumeration E_SPA_ErrorCode defines constant values for the different errors that can be generated internally in the library.

These values can be found in the output variable iErrorCode again, which indicates the associated integer value at the output of the PLC SPA function block FB_SPA [ } 17] in the event of an error. (* enumeration for error codes returned as iErrorCode output of FB_SPA //////////////////////////////////////////////////////////////////////// // Note: A non-zero return error code indicates that one of the // // input values did not pass simple bounds tests. // //////////////////////////////////////////////////////////////////////// *) TF3900 21 Version:

1.1.1 Name Description 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. eSPA ZA RTS _ _ In addition to the sun angles, sunrise, solar apex and sunset is calculated. eSPA ALL _ All offered data are calculated and displayed at the output.