IDEC MicroSmart User Manual

Page 269

Advertising
background image

15: W

EEK

P

ROGRAMMER

I

NSTRUCTIONS

« FC4A M

ICRO

S

MART

U

SER

S

M

ANUAL

»

15-3

S1 through S

N

— Special month/day data

Specify the months and days to add or skip days to turn on or off the comparison outputs programmed in WKTIM
instructions.

Example: To set July 4 as a special day, designate 704 as S1.

Make sure that the values set for S1 through S

N

are within the valid ranges. If any data is over the valid value, a user pro-

gram execution error will result, turning on special internal relay M8004 and the ERR LED on the CPU module.

Examples: WKTIM and WKTBL

• Without Special Days (MODE = 0)

This example is the basic program for week programmer application without using the WKTBL (week table) instruction.
While the CPU is running, the WKTIM compares the S1, S2, and S3 preset data with the current day and time.

When the current day and time reach the presets, an output designated by operand D1 is turned on and off.

• With Additional Days in the Week Table (MODE = 1)

When the current time reaches the hour/minute preset time on the special days programmed in the WKTBL, the designated
output is turned on or turned off. In addition, the designated output is turned on and off every week as designated by oper-
and S1 of WKTIM.

In normal execution, when the current day and time coincide with the preset day (S1) and time (S2 or S3) of the WKTIM,
the designated output is turned on or off. Execution on the special days has precedence over execution on normal days.

This example demonstrates operation on special days in addition to regular weekends. The output is turned on from 10:30
a.m. to 11:10 p.m. on every Saturday and Sunday. Without regard to the day of week, the output is also turned on Decem-
ber 31 through January 3.

• With Skip Days in the Week Table (MODE = 2)

On the special days programmed in the WKTBL, the designated output is not turned on or off, while the designated output
is turned on and off every week as designated by operand S1 of WKTIM.

In normal execution, when the current day and time coincide with the preset day (S1) and time (S2 or S3), the designated
output is turned on or off. Execution on the special days has precedence over execution on normal days.

This example demonstrates operation aborted on special days. The output is turned on from 10:00 a.m. to 8:00 p.m. on
every Monday through Friday, but is not turned on from May 2 through May 5.

Month

Day

01 through 12

01 through 31

D1
Q0

S1
62

M8125

WKTIM
0

S2

830

S3

1715

M8125 is the in-operation output special internal relay.

S1 (62) specifies Monday through Friday.

The WKTIM turns on output Q0 at 8:30 and turns off output Q0 at
17:15 on Monday through Friday.

D1
Q0

S1
65

WKTIM
1

S2

1030

S3

2310

M8120 is the initialize pulse special internal relay.

WKTBL designates Dec. 31 to Jan. 3 as special days.

MODE (1) adds special days.

S1 (65) specifies Saturday and Sunday.

WKTIM turns on output Q0 at 10:30 and turns off at 23:10 on
ever y Saturday, Sunday, and special days.

S4

103

S1

1231

M8120

S2

101

S3

102

WKTBL

M8125

D1
Q0

S1
62

S2

1000

S3

2000

WKTBL designates May 2 to May 5 as special days.

MODE (2) skips special days.

S1 (62) specifies Monday to Friday.

WKTIM turns on output Q0 at 10:00 and turns off at 20:00 on
ever y Monday through Friday except on special days.

S4

505

S1

502

M8120

S2

503

S3

504

M8125

WKTBL

WKTIM
2

Advertising