This is a simplified version of part of a complex project I am currently working on. See image to understand my description. The slider is the input that is powered be continuous linear back and forth motion. Permanently attached to the slider is a pin that fits into the slotted end of the linkage. When the slider slides in either direction it should first slide to the end of the slot and then begin pushing or pulling the arm with the linkage. Animating it without the sliding motion that this project requires is simple. Just use a simple IK bone constraint and it just works. (See GIF) The problems begin after I attempt to create the sliding. I have tried using stretch on the linkage bone and use a limit scale constraint to limit how far the bone stretches to emulate the distance it could travel in the slot. But, I must not be fully understanding how the stretch works on IK bones because I can get nothing to work. Any ideas or workarounds?
Blend file with simple example