05-19-2021 05:06 PM - edited 05-19-2021 05:13 PM
Good evening everyone,
For a project, I have to simulate a synthesizer with a MyDAQ card. I want a sound to come out when I plug a digital input into 5V and it will stop when I unplug it.
I realized the attached program. When I plug in the wire, the boolean becomes "'True" and the beep starts. Except that the boolean does not resume the value "False" when I unplug the wire which means that the sound signal continues as long as I do not stop the defined program.
This only makes me for a sound signal, I tested with simple different calculations depending on the value of the boolean and for that, the program works very well! The boolean does indeed change value.
You will also find the joint program of my subVI which I use to generate the sound signal.
Thank you in advance for your answers
Good night
05-19-2021 05:17 PM
Your problem is that your subVI that creates sound never stops. It continues to loop until it sees an error or the Stop button is pressed on its front panel.
You will need to either use queues/user events/notifiers/etc to communicate between the loops, or set it up so that a True writes a value to the Play Sound function once, then the program returns. Otherwise, the first time you detect a True, that program will begin executing continuously and will never stop.
05-20-2021 01:11 AM
Hi Chamart,
Bert already told you the reason why your VIs don't behave as expected…
Another notes: