2 Instruction Descriptions
2-58
NJ-series Instructions Reference Manual (W502)
The OutABit instruction stores the value of set value BitVal at bit position Pos in the bit string InOut.
Only the bit at Pos changes.
The following example is for when Pos is USINT#2 and BitVal is TRUE.
• The SetABit and ResetABit instructions change the value of the specified bit to either TRUE or
FALSE.
• With the OutABit instruction, however, you can dynamically change the value to which the specified
bit is set if you change the value of BitVal.
• 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.
• Return value Out is not used when the instruction is used in ST.
• An error will occur in the following case. ENO will be FALSE, and Out and InOut will not change.
• The value of Pos is greater than No. of bits in InOut − 1.
Function
Additional Information
Differences between the SetABit and ResetABit Instructions and the
OutABit Instruction
Precautions for Correct Use
OutABit(abc, USINT#2, TRUE);
LD ST
abc
USINT#2
TRUE
abc
OutABit
EN ENO
InOut
Pos
BitVal
InOut=abc
Pos=USINT#2
1 1 0 0 0 0 0 1
1 1 0 0 0 1 0 1
Most-significant bit Bit 0