DAY_OF_WEEK : Day of the week
Original instructions
Description of the function
The function DAY_OF_WEEK provides the result of the day of the week, in the form of a whole number:
The additional parameters EN and ENO can be configured.
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
DAY_OF_WEEK
ST Out_Day_Of_Week
Representation in ST
Representation:
Out_Day_Of_Week := DAY_OF_WEEK();
Description of parameters
The following table describes the output parameters:
Parameter
Type
Comment
Out_Day_Of_Week
Whole number from 1 to 7 indicating the day of the week:
  • 1 for Monday,
  • 2 for Tuesday,
  • 3 for Wednesday,
  • 4 for Thursday,
  • 5 for Friday,
  • 6 for Saturday,
  • 7 for Sunday.
Runtime errors
If the function cannot update the result following a real-time clock access error, the result sent back is 0 and the system bit %S18 is set to 1.