Issue
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
Environment
StruxureWare Building Operation and all compatible operating systems including Windows XP, Windows 7, Windows Server 2008, and virtual machine environments.
Cause
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:
- Create FB Program in AS or ES
- Use the WDAY
- While using the Graphics Viewer in the AS or ES, WDAY shows correct weekday (today is 2)
- Change the date on the AS or ES to a Sunday i.e. 12-09-16 which is Sunday,September 16, 2012
- 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
Resolution
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}