2 Instructions
2-34 CP1E CPU Unit Instructions Reference Manual(W483)
Hint
Differences between SET/RSET and SETB(532)/RSTB(533)
The instructions operate in the same way when the specified bit is in the CIO, W, H, or A Area.
The SETB(532) and RSTB(533) instructions can control bits in the DM Areas, unlike SET and RSET.
The set and reset inputs for a KEEP(011) instruction must be programmed with the instruction, but
the SETB(532) and RSTB(533) instructions can be programmed completely independently. Further-
more, the same bit may be used as the operand in any number of SETB(532) and RSTB(533)
instructions.
Precautions
Bits turned ON by SETB(532) can be turned OFF by any other instruction, not just RSTB(533).
Bits turned OFF by RSTB(533) can be turned ON by any other instruction, not just SETB(532).
SETB(532) and RSTB(533) cannot set/reset timers and counters.
When SETB(532) or RSTB(533) is programmed between IL(002) and ILC(003) or JMP(004) and
JME(005), the status of the specified bit will not be changed if the program section is interlocked or
jumped, i.e., when the interlock condition or jump condition is OFF.
SETB(532) and RSTB(533) have immediate refreshing variations (!SETB(532) and !RSTB(533)).
When a CPU Unit built-in output bit has been specified in one of these instructions, any changes to
the specified bit will be refreshed when the instruction is executed and reflected immediately in the
output bit.
When a CPU Unit built-in output is specified for bit address N of word D by !SETB (or !RSTB instruc-
tion), bit address N of word D which turned ON (or OFF) will be OUT-refreshed at that point (when the
instruction is executed). Bit address N of word D which was turned ON (or OFF) remains ON (or
OFF) as normal until an RSTB instruction (or SETB instruction) is executed.
Sample program
RSTB
RSTB(533) turns OFF bit N of word D
when the execution condition is ON. The
status of the bit is not affected when the
execution condition is OFF. (Use
SETB(532) to turn ON the bit.)
Bit 02 of D0 is turned ON when CIO 0.00 is ON.
Bit 02 of D0 is turned OFF when CIO 0.01 is ON.
15
Execution condition ON
OFF
Bit N of word D ON
OFF
This bit is turned OFF.
0.00
0.01
SETB
D0
&2
RSTB
D0
&2