05-02-2013 05:46 AM
I have to create an application which for 3 different ranges of sound frequency (which user can adjust on screen) turns on one of three alarms:
1. text warning on user interface
2. blinking of LED indicator
3. sound signal warning.
I have realised a part of the code, but I am not sure if my algorythm is good.
Here is my code: Sound Frequency Detector.vi
05-03-2013 03:15 AM - edited 05-03-2013 03:15 AM
Hi Miki!
Could you upload the VI as an attachment? I do not have a 4shared account, and others will also be able to access it easier and faster.
Thanks!
Andrew Valko
NI Hungary
05-03-2013 05:15 AM
Thank you for response! I am new to forum, so I didn't know how to attach a file. Here it is now.
05-03-2013 06:34 AM
Dear Miki!
Allow me to give you a few recommendations:
1. If you only have two cases, it might be easier to use the Select node from the comparison menu.
2. If you use case structures, make sure you have wired soomething to all the cases. It can be an empty/default value, if nothing else.
3. There is a Blinking property for LED indicators.
4. It's probably easier to use the Play Waveform Express VI or the Beep VI for sound.
5. If you want this code to run continuously, it's better to have a loop than using the continuous run button.
Hope this helps.
Regards:
Andrew Valko
NI Hungary
05-03-2013 07:27 AM
Thank you fo recommendations! I made it work, though not all the things I need, but it's not bad for the beginning. I just didn't succeed to make it with while loop. It doesn't read frequency for some reason then.
Best regards,
Milos Mladenovic
05-03-2013 07:37 AM
Dear Milos!
Make sure your indicators are also inside the loop, otherwise they will not be updated in every iteration. Since I do not see what's inside the subVI that acquires the frequency information, I'm not sure why it isn't working. For frequency measurements in general, please check out our example storage.
Regards:
Andrew Valko
NI Hungary
05-03-2013 12:46 PM
Here is my working code without subVI. It's not complete. I have troubles when I record a voice over the microphone, it stops after one second, but it should be stopped by user itself. Secondary, I am not sure how to connect that blinking part to the indicator. Sorry for too much questions, I am a newbie.
05-04-2013 12:42 PM
I've made a program, it works completely! Now I just need to make opening/creating and reading/writing. The problem is that I cannot write frequency (which is data type), because string type should be written. There are only number/string converters. Do someone knows some solution?