2 Instruction Descriptions
2-54
NJ-series Instructions Reference Manual (W502)
z ResetBits
The ResetBits instruction changes the value of Size bits from the bit position Pos in the bit string
InOut to FALSE. The status of the other bits will not change.
The following example shows the SetBits instruction when Pos is USINT#3 and Size is USINT#2.
Use these instructions to globally set variables with AT specification in memory areas that handle data
by word (e.g., the DM Area) to TRUE or FALSE.
• If this instruction is in a master control region and the master control region is reset, the value of
InOut is retained.
• If this instruction is not executed due to the execution of a jump instruction (e.g., the JMP instruction),
the value of InOut is retained.
• The value of InOut does not change if the value of Size is 0.
• Return value Out is not used when the instruction is used in ST.
• An error occurs in the following cases. ENO will be FALSE, and Out and InOut will not change.
• The value of Pos is greater than No. of bits in InOut − 1.
• The value of Size is outside of the valid range.
• The value of Pos or Size exceeds the number of bits in InOut.
Additional Information
Precautions for Correct Use
SetBits(abc, USINT#3, USINT#2);
LD ST
abc
USINT#3
USINT#2
abc
SetBits
EN ENO
InOut
Pos
Size
InOut=abc
Pos=USINT#3
Size=USINT#2
1 1 0 0 0 0 0 1
1 1 0 1 1 0 0 1
Most-significant bit Bit 0