SLC-5/04 Julian Date Generator

drplc

Member
Join Date
Apr 2003
Location
Holland, MI
Posts
4
Any of you guru's out there ever write logic for a Julian Date generator for a SLC-5/04 instruction set format. I need to
send this via an ASCII string to a label printer (that part is
done). Any help will be greatly appreciated!!!!! :D
 
Just got to ask what is a Julian Date Generator...........

Prob me just being thick

banghead
 
Do a Google search for "julian date" and a bunch of pages that have Java script will pop up. Look at that code and use a couple of Compute blocks in the SLC to calculate.

Here's the code from http://www.isc.tamu.edu/~astro/javascript/julianday.html :

MM=eval(form.nmonth.value)
DD=eval(form.nday.value)
YY=eval(form.nyear.value)
HR=eval(form.nhour.value)
MN=eval(form.nminute.value)
with (Math) {
HR = HR + (MN / 60);
GGG = 1;
if (YY <= 1585) GGG = 0;
JD = -1 * floor(7 * (floor((MM + 9) / 12) + YY) / 4);
S = 1;
if ((MM - 9)<0) S=-1;
A = abs(MM - 9);
J1 = floor(YY + S * floor(A / 7));
J1 = -1 * floor((floor(J1 / 100) + 1) * 3 / 4);
JD = JD + floor(275 * MM / 9) + DD + (GGG * J1);
JD = JD + 1721027 + 2 * GGG + 367 * YY - 0.5;
JD = JD + (HR / 24);
}
form.result.value = JD;


and another from http://www.macho.mcmaster.ca/JAVA/JD.html


function compute(form) {
var y = parseFloat(form.year.value)
var m = parseFloat(form.month.value)
var d = parseFloat(form.day.value)
var uh = parseFloat(form.uth.value)
var um = parseFloat(form.utm.value)
var us = parseFloat(form.uts.value)

var extra = 100.0*y + m - 190002.5
var rjd = 367.0*y
rjd -= Math.floor(7.0*(y+Math.floor((m+9.0)/12.0))/4.0)
rjd += Math.floor(275.0*m/9.0)
rjd += d
rjd += (uh + (um + us/60.0)/60.)/24.0
rjd += 1721013.5
rjd -= 0.5*extra/Math.abs(extra)
rjd += 0.5
form.result.value = rjd


Other pages show similar code. Don't know if they all give the same answer.

You may also want/need:
( from: http://tycho.usno.navy.mil/mjd.html ):
The Modified Julian Day, on the other hand, was introduced by space scientists in the late 1950's. It is defined as

MJD = JD - 2400000.5




Dave
 

Similar Topics

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 ...
Replies
2
Views
5,507
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,762
I’m attempting to send a temperature from a SLC-5/02 to an EZiMarquee display. The vendor said to use a MSG instruction to send the data to the...
Replies
1
Views
81
Hello all. I have a few SLCs in my plant and of late we've seen a weird issue: The system will be running normally and then randomly the outputs...
Replies
2
Views
93
I am working on setting up a Prosoft Datalogger model PLX51-DLplus-232. This unit will be collecting data from a SLC 5/05 on the DB9 port set to...
Replies
3
Views
101
Back
Top Bottom