Sign in to follow this  
Followers 0
Monster

Day of Week

8 posts in this topic

This is probably more of a math problem than a PLC problem. I'm looking for an equation to calculate day of week. I will eventually convert it into PLC code, but first I need an equation that works. I have found 2 or 3 different equations on the internet, but after some testing I have found that certain dates do not work in all of then. I sure I'm not the first person to pursue this, so I'm figuring that someone already has an equation that actually works. I'm really only intrested in calculating from this day forward.

Share this post


Link to post
Share on other sites
If you are using RS5000, a day of the week example is included in the sample files

Share this post


Link to post
Share on other sites
For AB also in SLC format there is a sample download in the Download Code section of MRPLC http://forums.mrplc.com/index.php?act=Downl...s&CODE=02&id=15 And for Omron also: http://forums.mrplc.com/index.php?act=Downl...&CODE=02&id=444

Share this post


Link to post
Share on other sites
Which PLC is it? Have you checked already if your PLC has a real time clock or not?

Share this post


Link to post
Share on other sites
Who in their right mind would want to let their PLC know what day of the week it is? Its bad enough that the PLC knows what time it is. But if it knows what day it is then it will choose to break down at 4:40 PM on the Firday afternoon of a holiday weekend.

Share this post


Link to post
Share on other sites
Lmao, yeah I agree Alaric, its madness.

Share this post


Link to post
Share on other sites
I will more than likely use this in both a SLC and L5K. I just now looked up the L5K sample, and have not had a chance to try it yet, However that sample is based on en equation I tried by hand and gave me an incorrect answer for 10/10/05??? I also just downloaded the sample from MrPLC and will check it out.

Share this post


Link to post
Share on other sites
In an slc503 and newer S:52 is the day of week 0-6, I believe that is the adress either way it's there already.

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