Sign in to follow this  
Followers 0
pcmccartney1

Control/CompactLogix Day of the Week

5 posts in this topic

Any idea how to obtain or calculate the Day of the Week from WorldClockTime or any other attribute?

There is a KB about a specific instruction GDW for SoftLogix 5 only.

Share this post


Link to post
Share on other sites

Hi, I can send you L5X file for an "Add-On Instructions" to add if you need. 

Once you add the L5X file and download the program, you can calculate the "day of the week". 

1. Make an 7 array of dint, for my example I have "WallClockTime"

This is to get current date & time

2. Make a tag with data type with DayOfweek_LD, for my example, I have "DayOfWeek"

Capture2.PNG.c2d44a216b21e35d79d8aff9b72

This is where you can get the number of week.

0 = Sunday

1 = Mon

2 = Tues

3 = Wed

4 = Thurs

5 = Fri

6 = Sat

3. Capture.thumb.PNG.05f984bea68b736513acde

I hope this helps you out but if it does not make sense, please let me know. Thanks !

 

 

Share this post


Link to post
Share on other sites

That would be wonderful!

Share this post


Link to post
Share on other sites

@PaulKim1003 Wanted to get back to you and thank you.  It worked quite well for me.  My associate built his own but studied yours and found them to be quite similar.  There are many formulas on the web that describe how to get day of week.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0