FB_CalcPublicHolidaysUS

FB_CalcPublicHolidaysUS 1:

Calculation of the United States public holidays.

US public holidays for the current year are calculated based on the date entered. A boolean output indicates whether the entered date matches one of the calculated holidays. To ensure international readability the function block was translated into English. The parameters have the following meaning:

English name

German

New Year's Day

Neujahr

Martin Luther King "JR" Day

Martin Luther King Tag

Presidents Day

Tag der Präsidenten

Good Friday

Karfreitag

Easter Sunday

Ostersonntag

Memorial Day

Gedenktag

Independence Day

Unabhängigkeitstag

Labor Day

Maifeiertag

Columbus Day

Kolumbus-Tag

Veterans Day

Veteranentag

Thanksgiving Day

Erntedank

Thanksgiving Friday

Schwarzer Friday (Freitag nach Erntedank)

Christmas Eve

Heiligabend

Christmas Day

Weihnachtstag

New Years Eve

Silvester

VAR_INPUT

dCurrentDate      : DATE;

dCurrentDate: current date.

VAR_OUTPUT

dNewYearsDay           : DATE;
dEpiphany              : DATE;
dGoodFriday            : DATE;
dEasterSunday          : DATE;
dEasterMonday          : DATE;
dLabourDay             : DATE;
dAscensionDay          : DATE;
dWhitSunday            : DATE;
dWhitMonday            : DATE;
dCorpusChristi         : DATE;
dAssumptionDay         : DATE;
dGermanUnificationDay  : DATE;
dReformationDay        : DATE;
dAllSaintsDay          : DATE;
dPenanceDay            : DATE;
dChristmasEve          : DATE;
d1stChristmasDay       : DATE;
d2ndChristmasDay       : DATE;
dNewYearsEve           : DATE;
bNewYearsDay           : BOOL;
bEpiphany              : BOOL;
bGoodFriday            : BOOL;
bEasterSunday          : BOOL;
bEasterMonday          : BOOL;
bLabourDay             : BOOL;
bAscensionDay          : BOOL;
bWhitSunday            : BOOL;
bWhitMonday            : BOOL;
bCorpusChristi         : BOOL;
bAssumptionDay         : BOOL;
bGermanUnificationDay  : BOOL;
bReformationDay        : BOOL;
bAllSaintsDay          : BOOL;
bPenanceDay            : BOOL;
bChristmasEve          : BOOL;
b1stChristmasDay       : BOOL;
b2ndChristmasDay       : BOOL;
bNewYearsEve           : BOOL;

dxxxxxx: Date of the respective holiday.

bxxxxxx: Boolean statement indicating whether today is the respective holiday.

Requirements

Development environment

Required PLC library

TwinCAT from v3.1.4020.32

Tc2_BABasic from v3.1.0.0