Sorry, my bad. I forget that not everyone that has Logix500 has Logix5. Here, I converted the PLC5 program file for you.
This is the same thing as what mgvol posted (adjusted for a SLC500), however, it also contains the look up table included in the technote file, which is essential for the calculation. Without the lookup table data the calculation won't work. The routine only needs to execute once a day.
This routine gives you the day of the year. Now technically, the Julian date changes at noon, not midnight. If you are using this convention then use a compare and a single shot to call the date subroutine only once at noon. If you are using a true Julian date then you need the number of days that have passed since Jan 1 4713 BCE. For that you can start with the Julian date of Jan 1 2006, which is 2453737, and add that as an offset and use a look up table for each years offset after that.