New in the Community? Get started here

Schneider Electric Exchange Community

Discuss and solve problems in energy management and automation. Join conversations and share insights on products and solutions. Co-innovate and collaborate with a global network of peers.

Register Now
Knowledge Base
Showing results for 
Search instead for 
Did you mean: 
Discover the Exchange Community Top members of July 
Discover the latest features your community has to offer: register to the webinar here

Function Block program using WDAY with day = Sunday


When creating a FB program and use WDAY, change the date on the AS or ES to Sunday, the WDAY changes the day to 0 (zero).

Product Line

EcoStruxure Building Operation


StruxureWare Building Operation and all compatible operating systems including Windows XP, Windows 7, Windows Server 2008, and virtual machine environments.


Create a FB program and use WDAY, then change the date on the AS or ES to Sunday, the WDAY changes the day to 0 zero.

Steps to reproduce problem:

  1. Create FB Program in AS or ES
  2. Use the WDAY
  3. While using the Graphics Viewer in the AS or ES, WDAY shows correct weekday (today is 2)
  4. Change the date on the AS or ES to a Sunday i.e. 12-09-16 which is Sunday,September 16, 2012
  5. View FB program in Graphics Viewer, which now shows 0 as if today were now 0 

The WDAY FB program should show 7 which is Sunday.

  • Monday=1
  • Tuesday=2
  • Wednesday=3
  • Thursday=4
  • Friday=5
  • Saturday=6
  • Sunday=7


This will be resolved in a future release. Currently, there is a alternative: with an XPI block, make WDAY 0 = 7.A second alternative would be to add an if-statement:
if(output = 0){output = 7}

Tags (4)
Labels (1)
No ratings