All you need is an activator or button ether touching the rail, or connected with c+v (from rail to activator) and whenever a docked entity touches that rail, it will send a signal.
EDIT
actually, it may need to actually touch the rail. Someone correct me if I'm wrong! Don't want to spread...