Omron CJ - REFERENCE MANUAL 10-2009 Reference Manual page 744

Table of Contents

Advertisement

3. Instructions
MSKS(690) controls the execution of interrupt tasks. The value of N specifies the interrupt task and the
kind of processing that will be performed.
(1) N = 0 to 3: Enabling/Disabling the Interrupt Inputs of I/O Interrupt Tasks
• Enables or disables the interrupt inputs specified by N, based on the status of the bits in C. With
this function, MSKS(690) can control whether or not each task is executed.
• When an interrupt input is enabled, any interrupts detected up to that point will be cleared.
(2) N = 6 to 13: Specifying the Differentiation of Interrupt Inputs
• Specifies whether the interrupt inputs specified by N are up-differentiated or down-differentiated,
based on the status of the bits in C.
• Use the differentiation specification together with the enabling/disabling function. If MSKS(690) is
not executed to specify up or down differentiation, the interrupt inputs are up-differentiated (the
default setting).
• When MSKS(690) is executed to specify an interrupt input's up or down differentiation, any inter-
rupts detected up to that point will be cleared.
(3) N = 4 or 5: Specifying Timer Interrupts of Scheduled Interrupt Tasks
• Sets the time interval (specified by C) for the specified scheduled interrupt task (specified by N)
and starts the internal timer. The internal timer can also be stopped by setting C to 0. With this
function, MSKS(690) can control whether or not each scheduled task is executed.
• When MSKS(690) is used to restart the internal timer, the time from the execution of MSKS(690)
to the start of the first scheduled interrupt task is uncertain, because the existing internal timer PV
is used.
• When you want to specify the interrupt start time, use CLI(691) together with MSKS(690).
(4) N = 14 or 15: Resetting and Restarting Scheduled Interrupt Tasks
• Sets the time interval (specified by C) for the specified scheduled interrupt task (specified by N),
resets the internal timer's PV, and starts the internal timer. Since the internal timer's PV is reset,
this function maintains the proper interval from the execution of MSKS(690) until the start of the
first interrupt (CJ1M CPU Units only).
Note 1 The CJ1M-CPU11/21 supports only one scheduled interrupt task, interrupt task 2 for scheduled interrupt
0.
2 The time unit used to set the scheduled interrupt time is set as the Schedule Interrupt Interval in the PLC
Setup.
Hint
The longest interrupt task processing time is stored in A440 (Maximum Interrupt Task Processing
Time). At the same time, the task number of the interrupt task with the longest interrupt task processing
time is stored in A441 (Interrupt Task with Maximum Processing Time).
Precaution
• Be sure that the time interval is longer than the time required to execute the scheduled interrupt task.
• For scheduled interrupts, MSKS(690) is used only to set the scheduled interrupt interval and does not
set the time to the first scheduled interrupt. To accurately control the time to the first interrupt and the
interrupt interval, program CLI(691) to set the time to the first schedule interrupt just before
programming MSKS(690). If MSKS(690) is used to restart a schedule interrupt for a CJ1M CPU Unit,
however, the time to the first scheduled interrupt will be accurate even if CLI(691) is not used.
• Scheduled interrupt tasks cannot be used if synchronous unit operation is being used. An instruction
error will occur if the MSKS instruction is executed with N (interrupt identifier) set to 4 or 5.
Sample program
Examples for CS1W-INT01/CJ1W-INT01
When CIO 0.00 turns ON in the following example, MSKS(690) unmasks (enables) interrupt inputs in
Interrupt Input Unit 0.
706
CS/CJ/NSJ Series Instructions Reference Manual (W474)

Advertisement

Table of Contents
loading

Table of Contents