LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Playing sound based on exceeding a threshold value. 1D array data type

Solved!
Go to solution
Highlighted

Playing sound based on exceeding a threshold value. 1D array data type

I  am experiencing a problem with the beep.vi.  I have a DAQ program, which acquired  signal and compare it to a threshold value. When one signal is out of range, a visual and sound alarm occurred. I am using the VI beep.vi to generate the sound. Everything is working well except the sound alarm. It gives type mismatch 1-D array. I tried to overcome this by putting it in a case structure. But it still doesn't work. could any one help? Please find attached my VI. Best regards to all visitors of NI Discussion Forums.

Ihab El-Sayed

0 Kudos
Message 1 of 3
(793 Views)
Solution
Accepted by topic author Ihab
08-27-2015 04:09 PM

Re: Playing sound based on exceeding a threshold value. 1D array data type

Why did you create a new thread? All you needed to do was add a reply to the previous, attaching the VI that you forgot to attach.

 

Please keep all subsequent discussion in this thread.

 

As to your question: I have no idea why you are using a Type Cast function on a 1D array of Booleans. Did you randomly pick a function out of the palettes until you found one that didn't give you a broken wire? It seems to me that since you are comparing an array of values to a threshold, then you'd probably want to beep if any of them is out of range. In this case you'd want it if any of the elements in the Boolean array is True. This implies an OR condition. And this means you'd need to use the Or Array Element function. This will return a True if any value in a Boolean array is True.

Message 2 of 3
(789 Views)

Re: Playing sound based on exceeding a threshold value. 1D array data type

Many thanks. I added OR array and it works.

Thanks again.

0 Kudos
Message 3 of 3
(782 Views)