Omron SYSMAC C20K Operation Manual page 87

K-type programmable controllers
Hide thumbs Also See for SYSMAC C20K:
Table of Contents

Advertisement

Bit Control Instructions
Limitations
Description
Flags
Example
0000
0000
1000
76
Any output bit can be used in only one instruction that controls its status. See
3-3 Internal Relay (IR) Area for details.
DIFU(13) and DIFD(14) are used to turn the designated bit ON for one cycle
only.
Whenever executed, DIFU(13) compares its current execution with the previ-
ous execution condition. If the previous execution condition was OFF and
and current one is ON, DIFU(13) will turn ON the designated bit. If the previ-
ous execution condition was ON and the current execution condition is either
ON or OFF, DIFU(13) will turn the designated bit OFF or do nothing (i.e., if
the designated bit is already OFF). The designated bit will thus never be ON
for longer than one cycle assuming it is executed each cycle (see Precau-
tions, below).
Whenever executed, DIFD(14) compares its current execution with the previ-
ous execution condition. If the previous execution condition was ON and the
current one is OFF, DIFD(14) will turn ON the designated bit. If the previous
execution condition was OFF and the current execution condition is either
ON or OFF, DIFD(14) will turn the designated bit OFF or do nothing (i.e., if
the designated bit is already OFF). The designated bit will thus never be ON
for longer than one cycle.
These instructions are used when a single-cycle execution of a particular in-
struction is desired. Examples of these are shown below.
DIFU(13) and DIFD(14) operation can be tricky when used in programming
between IL and ILC, between JMP and JME, or in subroutines. Refer to 5-7
INTERLOCK and INTERLOCK CLEAR – IL(02) and ILC(03) and 5-8 JUMP
and JUMP END – JMP(04)/JME(05) for details. A total of 48
DIFU(13)/DIFD(14) can be used in a program. If more than 48 are used in a
program only the first 48 will be executed and all others will be ignored.
DIFU(13)/DIFD(14) are useful when used in conjunction with CMP(20) or
MOV(21), see Example below.
There are no flags affected by these instructions.
In diagram A, below, CMP(20) will compare the contents of the two operand
words (HR 1 and DM 00) whenever it is executed with an ON execution con-
dition and set the arithmetic flags (GR, EQ, and LE) accordingly. If the execu-
tion condition remains ON, flag status may be changed each cycle if the con-
tents of one or both operands change. Diagram B, however, shows how
DIFU(13) can be used to ensure that CMP(20) is executed only once each
time the desired execution condition goes ON.
Diagram A
Diagram B
Address Instruction
CMP(20)
0000
LD
HR 1
0001
CMP(20)
DM 00
DIFU(13) 1000
Address Instruction
0000
LD
CMP(20)
0001
DIFU(13)
HR 1
0002
LD
DM 00
0003
CMP(20)
Section 5-6
Operands
0000
HR
1
DM
00
Operands
0000
1000
1000
HR
1
DM
00

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sysmac c40kSysmac c60kSysmac c28k

Table of Contents