Julian Date Logic for AB SLC 5/04

bakerboy_99ca

Member
Join Date
Mar 2004
Location
London Ontario
Posts
58
Hi Guys,

I trying to see if anyone has been able to get the Julian Date logic for the SLC family. I have found this thread ... http://www.plctalk.net/qanda/showthread.php?t=22008&highlight=julian but I cannot see how this would work. The line that determines if it is a leap year does not make any sence and I know the calculation is much more involved. Also, the last line of code where he uses N255:[S:38], I have no idea what this entails?...I entered the code for fun and it does not work on my SLC 5/04.

I eventually want to compare the julian date of a day that I know is a sunday of a paticular year to todays julian date and work out if today is a sunday. Every sunday night our midnight shift gains an extra hour of work on a paticular robotic cell due to there not being an afternoon shift and the 2 shifts overlap by 1 hour. I then want to add that extra hour of production data into my excel sheet but just on sunday's... any ideas? I could just set up a day counter 0=monday - 6=sunday but was just wondering if anyone has tackled this before and tried to write the logic?
Thanks Mark
 
Almost think this is easier to do in Excel with the formula

=RIGHT(YEAR(A1),2)&TEXT(A1-DATE(YEAR(A1),1,0),"000")

and even getting the difference between 2 dates with the formula
=DATE(IF(0+(LEFT(A1,2))<30,2000,1900)+LEFT(A1,2),1,RIGHT(A1,3)) -
DATE(IF(0+(LEFT(A2,2))<30,2000,1900)+LEFT(A2,2),1,RIGHT(A2,3))


so if the difference between the 2 is evenly divisable by 7 it would be the same day of the week right?.... and then just turn on a bit back to the plc from excel saying that this is sunday....
 

Similar Topics

Hey guys, I am currently trying to create code to display a 5 digit Julian date, taken from the current local time of the PLC. Ive searched the...
Replies
16
Views
9,062
using directlogic on a dl 06 I need to do calculations based on date numbers. Could someone tell me how to get a Julian date number.
Replies
3
Views
2,980
Hi, my name is Marshall. Long time browser, first time poster! I am looking for an elegant solution to a julian date problem. We have a label...
Replies
18
Views
18,197
In my plant, all production requires a Julian date code. I am looking for logic that converts the built in calandar in a Julian date for data...
Replies
7
Views
10,760
I am using a Siemens S7 300 and I need the formula to convert the standard date to julian date. For example, June 1, 2005 to 05152. Thanks.
Replies
7
Views
10,094
Back
Top Bottom