LGF_GetCalendarWeek_ISO (FC / V3.0.1)

Overview

Author: Siemens Digital Industry

Short description

This function uses the specified date to calculate the calendar week and the number of days that have passed since the beginning of the year for ISO 8601 European countries.

Block Interface

LGF_GetCalendarWeek_ISO (FC)
DTL  date Ret_Val  DInt
    
   calendarDay  DInt
    
   error  Bool
    
   status  Word
    
   

Input parameter

IdentifierData type Description
dateDTL Date used to calculate the calendar week and days since 1 January

Output parameter

IdentifierData type Description
Ret_ValDInt Number of the calendar week.
calendarDayDInt Days past since January 1st on given date
errorBool FALSE: No error / TRUE: An error occurred during the execution of the FB
statusWord 16#0000-16#7FFF: Status of the FB / 16#8000-16#FFFF: Error identification (see following Table)

Status & Error codes

Code / ValueIdentifier / Description
16#0000STATUS_NO_ERROR
Status: no error occurred
16#8201ERR_LIM_DATE
Date out of the range, has to be greater than <1970-01-01 ; 2262-04-11>

Functional description

####### Counting method for European countries in accordance with ISO 8601

Change log

Version & DateChange description
01.00.00Siemens Industry Online Support
27.01.2017First released version
01.00.01Siemens Industry Online Support
17.08.2018Upgrade: TIA V15 Update 2
01.00.02Siemens Industry Online Support
23.11.2018Upgrade: TIA V15.1
01.00.03Simatic Systems Support
16.07.2019Renamed from LGF_CalenderWeek to LGF_CalenderWeek_ISO
Function split into week for ISO and US Format and as well day counter.
Result passed as return value.
Standard header implemented
Constant, temp variable naming
Update function call of CalendarDay
03.00.00Simatic Systems Support
23.04.2020Set version to V3.0.0, harmonize the version of the whole library
03.00.01Simatic Systems Support
19.01.2020Insert documentation