Cut redstone circuit when a signal is sent

I have a simple thing to do : whenever a minecart is on a Detector rail it triggers a piston to block it, and when another signal is thrown by any source, the redstone circuit is cut and the piston turns off and liberates the minecart

Here is an image of what I started :

enter image description here

I'm lost for where I should go to cut off the circuit

Thanks you very much!


Solution 1:

I created a solution, using the detector rail to put out a redstone torch which then allows a second redstone torch to power some dust which powers the smooth stone which powers a sticky piston attached to the rail blocking it. Then, we can just power the second torch to allow it to go again. Attached below are some screenshots.

Screenshot 1

Screenshot 2

Screenshot 3

Screenshot 4

Solution 2:

In your situation probably the easiest option will be to use a comparator in subtraction mode.

enter image description here

The signal will pass through the comparator unaffected, with only minimal delay, if there's no signal from the side. In presence of the side signal, its strength (thanks to use of repeater, the maximum, 15) is subtracted, leaving 0 on output. Depending on geometry (distance of the comparator from the rail, distance of the 'departure' signal source) you may be able to skip the repeater.