<0000 ???

Bering C Sparky

Lifetime Supporting Member
Join Date
Mar 2014
Location
Bering Sea, Alaska
Posts
1,117
Here is one that got me going :unsure:

If I want to check if an instruction is true on first scan and I want to know if it is true between 1800 - 0000.

Can I use GEQ = 18 ----- LES = 00 both with DateTime.Hour

OR will I have to use

GEQ = 18 Hour ----- LEQ=23 Hour LEQ= 59 Min LEQ = 59 Sec

Obviously (obvious in my mind I should say) the PLC does not see 18 or 23 or anything inbetween as less than 00, so I went with the 3 LEQ instructions to bring me to 1 second before 0000.

How do you all normally handle this situation???

Curious :unsure:
 
Last edited:
I feel like you should be able to use GEQ 18, because it would be true for all the time up to 23:59:59 right? Unless I'm missing something xD
 
I think you just misunderstood the question. ( or I did not put it to paper very clearly)

the GEQ =18 is not the problem

I was asking about the LES = 00

I am pretty sure that I answered my own question there, but was curious as to how the rest of you would handle this situation.

Would you just use the LEQ=23 hour LEQ=59 Min LEQ=59 Sec to represent midnight so that you could reference between the hours of 1800 and 0000 or is there a more sophisticated way of accomplishing this that I dont know about.

Thanks

BCS
 
Since the clock is going to roll over at 23:59:59 there is nothing greater than 18:00:00 that isn't also less than midnight.
Testing > 18 gives all from 18:00:00 through 23:59:59
 
Hmm, I'm wondering why you would even need a LEQ?

If you are using hour >= 18, then at hour 23 that would be true minutes 0-59.

Unless you mean not using a GEQ at all?
 
Back
Top Bottom