Skip to main content

Search Data (BOOL)

Instruction Parameters

Supported PLC Series

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

Supported Data Registers

MXYKLFTCSZRQD@DConstant
S-
D----

Supported Flags

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

Number of Steps

Steps
3

Operands

OperandDescription
SThe first operand.
Entries are WORD> data registers or constants.
This is the value to search the least and most significant bit of.

The signed value range is -32,768 ~ 32,767 (216).
The unsigned value range is 0 ~ 65,535 (216-1).
The Hexadecimal value range is H0000 ~ HFFFF.
DThe second operand.
Entries are only WORD data registers.
This stores the data register location where the data was found.
This requires 2 data registers.

There is an offset of +1 to the found bits if the search is successful.

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 BSER and BSERP instructions behave as follows:

  • The location of the least significant bit set (ON or 1) from the value, S, is stored in the data register, D, with a +1 offset.
  • The location of the most significant bit set (ON or 1) from the value, S, is stored in the data register, D+1, with a +1 offset.
  • If there is no matched data, 0 is stored in the data registers, D and D+1.

Examples