AB SLC5/03 real time clock control

A

Thread Starter

Anonymous

I want to start/stop a motor during certain hours of the day using the clock in a SLC5/03 cpu (1747-L531 OS302)... example: I want the motor to turn on between 0400 and 1600 hours

Do I monitor the S:40 bit in an EQUAL TO/GREATER THAN instruction or is there a better way to do it?
 
S

Steve Myres, PE

I'm not aware of any other way to do it. If you use a LIM box instead of the GRT/LEQ combo, you can do the starting and stopping times in a single box, if that helps.
 
T
First off, S:40 is a word, not a bit.
There are a zillion ways to do it, but the simplest way is to use the LIM instruction:
LIM 4 S:40 15.
You want to shut off at 16:00 right? so use 15 as the high limit, thus the instruction will evaluate true whenever 4<= s:40 <= 15.

From online help about LIM instruction:
If the Low Limit has a value equal to or less than the High Limit, the instruction is true when the Test value is between the limits or is equal to either limit. If the Test value is outside the limits, the instruction is false.

If the Low Limit has a value greater than the High Limit, the instruction is false when the Test value is between the limits. If the Test value is equal to either limit or outside the limits, the instruction is true.
 
Y

Yosef Feigenbaum

I recommend calculating the minute of the day as follows:

CurrentMinute = (Hour * 60) + minute

and then use a limit instruction on CurrentMinute

This keeps the comparisons simple and it's relatively easy to understand.
 
A
There is an important caveat to the creative solutions proposed by our colleagues.

You have to be careful of the accuracy of the system clock in the SLC. Over time, it can creep and not match the actual correct time of day. So you start or end earlier or later as time goes on, depending on the direction of creep.

Also, you have to be aware of daylight saving time issues.

In the past, I have always built-in some form of monitoring for creep, usually by an external PC (which also, by the way, is subject to creep).

-ack
 
Top