3 ) programming example – Yaskawa MP900 Series Ladder Programming Manual User Manual
Page 198

5.7 Data Shift Instructions
5.7.9 Binary Search (BSRCH)
5-129
Instructions
5
( 3 ) Programming Example
In the following programming example, the data from ML00000 to ML00008 is sorted when the sort command
(DB000000) turns ON.
Then, if the search command (DB000001) turns ON, the search data in ML00012 is searched for in the sorted data area.
The following table shows how the sort is processed when the first line is executed. Here, the data from ML00000 to
ML00008 is as listed below, and the search data in ML00012 is 70. When the second line is executed, the search result
in MW00010 is set to 4 as the result of finding 70.
Register
Data before Execution of 1st Line
Data after Execution of 1st Line
Execution Result of
2nd Line
ML00000
100
15
ML00004 = 70, so
MW00010 = 4
ML00002
30
30
ML00004
90
70
ML00006
15
90
ML00008
70
100