Your post was difficult to read because your objects are not clearly labeled.
If I understand what you are doing, you wish to have a robotic leg with a piston on the front that “actuates” the foot as it bends at the ankle.
This is actually a fairly simple solution. For illustrative purposes, I’ll give names to the parts: foot, leg, upper piston (attached to leg), lower piston (attached to foot).
The first thing to understand is that it is the foot that drives the animation (you probably already knew this though): bending the foot (at the ankle) makes the pistons move.
Both ‘upper piston’ and ‘lower piston’ should have their object centers at their hinges. (It appears you have done this in the image with ‘lower piston’.) Likewise, foot should have its center at the ankle, or as it is in your case, be parented to an armature with a joint at the ankle.
Parent ‘lower piston’ either to ‘foot’ or to the armature ‘foot’ bone. Parent ‘upper piston’ to ‘leg’ or to the armature ‘leg’ bone.
Add constraint to ‘upper leg’ targeting ‘lower leg’.
Now you might be tempted to add a constraint to ‘lower leg’ targeting ‘upper leg’. You’ll notice that in your image that there is a red box where it says “const”. Whenever you see red there’s something wrong. The reason you can’t do this is because you are creating a circular reference, which Blender will not try to resolve, even in a case as simple as this.
Move the cursor to the ‘upper leg’ object center and add an Empty (any object will do, so long as it is centered in the same place as ‘upper leg’). Parent it to ‘leg’ as well. Now, add a constraint to ‘lower leg’ targeting the Empty. Ta-da! All works well.
I hope this helps, if I understood your question right…