I am writing a datalog program that tracks counts on a test stand. At each shift or model change, the program should append the counts file to a historical file, then zero the counts and overwrite the existing current file. I can detect when the model changes, or when the shift number changes, but there are days where the stand only runs on 1st shift, and not 2nd or 3rd, then again on 1st the next day. If they run the same model, then the model and shift are the same, and it won't write to the historical count file. The easy way is to check for a change of date. However, 3rd shift is not so easy, as it runs from 11:00PM to 7:00AM. So far these are my three conditions:
I need a condition that does this:
(pseudocode)
If shift = 3 AND [checkDate(current Date) - countDate(date in file) = 1] AND [checkTime(current hour) <> 0 To 6] Then
date_shift_changed = True
End If
Any ideas on how to code that?? Any help is much appreciated!!
Thanks in advance, and Happy Holidays!!
Jon
Code:
If checkModel <> countModel Then
date_shift_changed = True
End If
If checkShift <> countShift Then
date_shift_changed = True
End If
If checkDate <> countDate Then
date_shift_changed = True
End If
(pseudocode)
If shift = 3 AND [checkDate(current Date) - countDate(date in file) = 1] AND [checkTime(current hour) <> 0 To 6] Then
date_shift_changed = True
End If
Any ideas on how to code that?? Any help is much appreciated!!
Thanks in advance, and Happy Holidays!!
Jon