9 binary search instruction (bsrch) – Yaskawa Ladder Works Programming Manual User Manual

Page 115

Advertising
background image

6.9 BINARY SEARCH Instruction (BSRCH)

6-18

6.9 BINARY SEARCH Instruction (BSRCH)

[Outline]

The BSRCH instruction uses a binary search method to search the designated data (Search Data)
within the designated search range (Source). The search result (offset from the leading register
number of the search range for the matching data) is stored in the designated register (Result).

[Format]

Symbol : BSRCH
Full Name : Binary Data Search
Category : MOVE

Icon :

[Parameter]

Parameter Name

Setting

Source

· Any integer type and double-length integer type register
· Any integer type and double-length type register with subscript

Width

· Any integer type and double-length integer type register
· Any integer type and double-length type register with subscript

Search Data

· Any integer type and double-length integer type register
· Any integer type and double-length type register with subscript
· Constant

Result

· Any integer type register (except for # and C registers)
· Any integer type register with subscript (except for # and C registers)

[Program Example]

Data matching with 01234 are searched for in registers MW00100 to MW00199, and the result is
stored in register DW00000.

Offset number of MW00100
is stored in DW00000.
DW00000←00102 - 00100

DW00000

MW00102 MW00100

・・・

0

00321

01234

99765

MW00100

MW00101

MW00102

MW00199

・・・

00002


Advertising