06-08-2017 02:31 AM
Hi everyone,
I am fairly new to LabView. I have been trying to get my hands dirty the MatLab block and do some data processing with it. The VI is suppose to read a complete (.wav) audio file into an array; depending on whether the 'stretch' or 'play' button is clicked, the signal in the 'waveform' variable is altered/processed or played.
The current behavior is that I can either initially
1. play the music
2. stretch the signal
3. stretch the signal then play the music
4. play the music and then stretch the signal
and then the VI just froze up. I understand that it freezes probably due to the 'locking interface option' when the event is being process... but I have yet to see why the event wouldn't finish processing...
Any help will be much appreciated. Thank you in advance!
(TIPS: if you going to run my VI, use a very short .wav file or it will take a VERY LONG time to complete my MatLab code when clicking the 'stretch' button).
Best.
Solved! Go to Solution.
06-08-2017 02:44 AM - edited 06-08-2017 02:47 AM
It's not the locking behaviour 🙂
You should usually only have one event structure in any given while loop. Each event structure can have more than one event. Treat it like an advanced Case Structure - right click on the event structure and click "Add Event Case". Then create a new case for each event.
Don't create parallel Event Structures, especially if you're "fairly new to LabVIEW". The loop won't move to the next iteration until ALL of the things inside the loop have finished.
Edit: Also, you should use Value Change events for boolean buttons, not Mouse Up. Then, place the boolean inside the event (like you have done) and it will reset a Latching action button. Latch When Released is the default action for an OK button, which is what you seem to have used, but you're using Latch When Pressed. This is more-or-less the same with regards to an event structure - they just trigger the structure on Press, rather than Release. Your choice 🙂
06-10-2017 04:26 AM
Thank you so much for the hints. It worked!
06-12-2017 06:51 AM