if command and variable command

Hi,
I want to calculate translocation time of a polymer through a nanopore. I need to stop performance of my input when the last bead of polymer exit form pore.
For example when coordinate of the last bead that is tangent with axis of pore is became larger than coordinate of the end of pore,performance of my input is stopped.
How can i do this with If command?
How can i define that coordinate of the last bead in variable command in order to use in boolean expression in If command?
Thanks
Samira;

Hi,
I want to calculate translocation time of a polymer through a nanopore. I
need to stop performance of my input when the last bead of polymer exit form
pore.
For example when coordinate of the last bead that is tangent with axis of
pore is became larger than coordinate of the end of pore,performance of my
input is stopped.

why do you need to stop the simulation at that point?
you can compute the time easily in post-processing.
that would be much more efficient that having to test
for some condition all the time.

axel.

If you can write an equal-style variable that
tests the condition you want, then you can
use it in a loop or the run every command
to test periodically as you are running and quit.

If the last bead has particle ID 150, then you
can access z[150], for example in a variable
and test it against some threshold. See the
variable command for more details.

Steve