Sign in to follow this  
Followers 0
simmo1973

micrologix julian date

3 posts in this topic

Hi, is there anyone out there that can send me a bit of logic to calculate the julian day? I am using a micrologix 1400

 

many thanks

 

Share this post


Link to post
Share on other sites

I found old code from a SLC 5/04 that I wrote in 2007 (be merciful, I was  younger then...

In that machine, they used the Julian date as the password, updated weekly. In other words, the password was the Julian date of the preceding Sunday. It was manually set each week by a particular maintenance person but he sometimes forgot or wasn't in, so I wrote code to automate the password change. I think I ended up taking it out later. I've done it a little more elegantly since then, but I can't remember which machine it was for and we have hundreds where I am now, so I don't think I can find it easily. It was probably also in a Logix 5000 platform which wouldn't translate as nicely to a MicroLogix.

In the attachment, I stripped out all of the rest of the code, so the program may not compile as-is and I don't have any error checking (like making sure the system date is reasonably sane and non-zero). It should be accurate but does not account for the fact that years divisible by 100 and not by 400 are not leap  years, so make sure your system date is accurate and don't use it in a machine that you intend to operate for more than 80 years from today.

JulianDate_RotaryPress.RSS

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