The fastest and simplest way to make a piston. It requires a selection of two objects, with one active. Their origins are used to define the pivot points. The operator works regardless of orientation and if needed, it can align the armature/rig to the objects used to create it.
When the align to active option is used, the use axis setting is rather important and when wrongly set, the piston may disappear until you set the right one. The y axis should point towards the B empty. In addition, both UI elements that appear briefly should have the same orientation.