Skip to main content

Bit Set

Instruction Parameters

Supported PLC Series

XPnA/1RXPnBXPnEXPnFCP3A/B/P/U
CP4A~D/U
CPnECPnFBPPLC-S

Supported Data Registers

MXYKLFTCSZRQD@DConstant
D----
n-

Supported Flags

FlagBitSupport
ErrorF11.0
ZeroF11.1-
CarryF11.2-

Number of Steps

Steps
3

Operands

OperandDescription
DThe first operand.
Entries are only WORD data registers.
This is the location of the data register to set the bit, n to ON.
nThe second operand.
Entries are WORD data registers or constants.
This is the bit number of the data register, D, to set to ON.

The value range is 0 ~ 15.

Notice

Error Flag (F11.0) Notice

The error flag, F11.0, will be ON for one scan when the address of the data register assigned by @D exceeds the range of the data register, D. The range of the data register, D, is dependent on the CPU type.

Instruction Behavior

The BSET and BSETP instructions behave as follows:

  • The value, n, is value from 0 ~ 15.
    • If the value, n, is greater than 15, the remainder from n ÷ 16 is the equivalent.
      • Example: if n = 17, the remainder is 1. This is the same as S2 = 1.
  • Bits turned ON by either instruction.

Examples