The integration with your robot depends on the controller you have. Linear search requires customizing the robot driver to intercept the search movement and link the stop condition to a specific signal. You can also use a customized post processor.
What robot are you using?
For example, if you have a Fanuc robot you'll see a program called go_mls.ls (MoveL Search) as part of the robot driver setup. This program looks like this:
1: SKIP CONDITION DI[101]=ON ;
2: IF R[51]>=0,JMP LBL[10] ;
3:L PR[50] R[50]mm/sec FINE Skip,LBL[50] ;
4: PR[52]=JPOS ;
5: END ;
6: LBL[10] ;
7:L PR[50] R[50]mm/sec CNT R[51] Skip,LBL[50] ;
8: PR[52]=JPOS ;
9: END ;
10: LBL[50] ;
11: PR[52]=PR[50] ;
In this example, the search is stopped by the "Skip condition" DI[101]=ON. You can modify that line to match the DI of your choice. The final position is saved in the position register PR[52]. This can also be customized.
What robot are you using?
For example, if you have a Fanuc robot you'll see a program called go_mls.ls (MoveL Search) as part of the robot driver setup. This program looks like this:
1: SKIP CONDITION DI[101]=ON ;
2: IF R[51]>=0,JMP LBL[10] ;
3:L PR[50] R[50]mm/sec FINE Skip,LBL[50] ;
4: PR[52]=JPOS ;
5: END ;
6: LBL[10] ;
7:L PR[50] R[50]mm/sec CNT R[51] Skip,LBL[50] ;
8: PR[52]=JPOS ;
9: END ;
10: LBL[50] ;
11: PR[52]=PR[50] ;
In this example, the search is stopped by the "Skip condition" DI[101]=ON. You can modify that line to match the DI of your choice. The final position is saved in the position register PR[52]. This can also be customized.