08-06-2013 02:13 PM
I have a VI that would play a sound file if a it receives 5 volts. If the voltage supply discontinues, I need it to stop playing the sound. But whatever I try it does not seem to do that. My Play Sound File vi plays the whole clip untill it stops. Even if I use the abort execution button, it will continue to play till it has reached the end of the clip. Is there a way for me to configure it so it woud stop abuptly when the voltage supply stops.
I have attached the file here if you want to take a look.
Thanks!
08-06-2013 04:12 PM
Your VI runs one time.
It does a comparison based on the value from the DAQ assistant at the very beginning to never check again. If true, then you read a file and play it. Your stop playing VI isn't going to stop anything until the VI that plays the file completes.
If you want to stop it, you need to do your comparison in a separate parallel while loop that runs the stop VI when the condition is true.