Counting the amount of times a voltage is read?

I have been having a complete brain fart over how to program something I think should be really simple. Using a sequence, I want a button to start a motor, count the amount of times a certain voltage is read from our analog channel, and then stopping the motor. However, I have no idea how to count and reset the amount of times this voltage is read! Anyone have any ideas?

Look up Analog Triggers. You can define a voltage range for an analog input channel, and pass the output of the trigger to a counter as if it were a digital input.