The leader in industrial automation and control solutions

Instruction Parameters

Supported PLC Series

PLC-AESPLC-FBPLC-ES

Supported Data Registers

MXYKLFTCSZRQD@DConstant
S1
S2
D
n

Supported Flags

FlagBitSupport
ErrorF11.0
ZeroF11.1
CarryF11.2

Number of Steps

Steps
5

Operands

OperandDescription
S1The first operand.
Entries are WORD data registers or constants.
This is the value to search for.

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.
S2The second operand.
Entries are only WORD data registers.
This is the starting data register to search from.
DThe third operand.
Entries are only DWORD data registers.
This stores the data register location where the data was found.

There is an offset of +1 to the found data register if the search is successful.
nThe fourth operand.
Entries are WORD data registers or constants.
This is the amount of data registers starting at S2 to search for.

The value must be greater than or equal to 1.

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. F11.0 turns ON when the value of the data for searching exceeds the data register assigned to S1 or S2. F11.0 turns ON if the value assigned to n is 0 or negative.

Instruction Behavior

The SER and SERP instructions behave as follows:

  • n can only be positive
  • If S1 is found in multiple data register locations, only the first occurrence will be saved in the data register D with a +1 offset.
    • The total number of occurrences is saved in D+1.
  • If S1 is not found, the data registers, D and D+1, will both be equal to 0.

Ladder Diagram Examples

SER

The SER instruction searches for the WORD value, S1, occurring in n number of WORD data registers starting at S2. If S1 is found in the search, the da

The SER instruction searches for the WORD value, S1, occurring in n number of WORD data registers starting at S2. If S1 is found in the search, the data register location + 1 (offset) is saved into and assigned DWORD data register, D.

The result of the search will be saved in the data registers, D40 and D41.

The result of the search will be saved in the data registers, D40 and D41.

Ladder Diagram Example for MapleLogic SER/SERP instruction.
When the contact, M0.0, is powered ON (1), the instruction searches for the value 326 in 5 WORD data registers starting at D20.

When the contact, M0.0, is powered ON (1), the instruction searches for the value 326 in 5 WORD data registers starting at D20.

Memory Monitor

The value 326 was found at the data register, D23. This value is represented as 4, which is saved in the WORD data register, D40.

The value 326 was found at the data register, D23. This value is represented as 4, which is saved in the WORD data register, D40. The value 326 was found once. This value is represented as 1, which is saved in the WORD data register, D41.

SERP

The SERP one-shot instruction searches for the WORD value, S1, occurring in n number of WORD data registers starting at S2. If S1 is found in the sear

The SERP one-shot instruction searches for the WORD value, S1, occurring in n number of WORD data registers starting at S2. If S1 is found in the search, the data register location + 1 (offset) is saved into and assigned DWORD data register, D. Every time this instruction executes, it energizes the output only once.

The result of the search will be saved in the data registers, D50 and D51.

The result of the search will be saved in the data registers, D50 and D51.

Ladder Diagram Example for MapleLogic SER/SERP instruction.
When the contact, M0.1, is powered ON (1), the instruction searches for the value 7,530 in 6 WORD data registers starting at D30.

When the contact, M0.1, is powered ON (1), the instruction searches for the value 7,530 in 6 WORD data registers starting at D30.

Memory Monitor

The value 7,530 was found at the data registers, D32 and D35. This value is represented as 3, which is the first occurrence of the value. This value i

The value 7,530 was found at the data registers, D32 and D35. This value is represented as 3, which is the first occurrence of the value. This value is saved in the WORD data register, D50. The value 7,530 was found twice. This value is represented as 2, which is saved in the WORD data register, D51.