Skip to main content

Example - Ladder Diagram

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 data register location + 1 (offset) is saved into and assigned DWORD data register, D.

Ladder Diagram Example


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




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 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 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.

Ladder Diagram Example


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




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 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.