LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sound to be heard only time , but program should continue running

Hello Everyone , 

I have made a small project in which I have used 'Text to speak' ,when ever I implement this program it continuously speaks either 'FULL' or 'LITTLE' respective of which I have mentioned in my vi , attached below.

My only query is that I want it to speak only once either 'FULL' or 'LITTLE' according to the condition but the program should continue to work.

I went through multiple forum responses but was confused alot therefore to have a clear answer , I approached here.

In short: program runs --> if slider greater than 5 --> speak 'FULL' but only one time ---> if slider goes less than 5 ---> speak 'LITTLE' but only one time.

Please guide which component can help for this problem.

Thanking in Advance.

0 Kudos
Message 1 of 5
(560 Views)

Most simple modification  is something like that:fl.png

 

0 Kudos
Message 2 of 5
(555 Views)

What you are looking for is a "Rising Edge Detector" and a "Falling Edge Detector" (to tell you when your slider value goes "above" or "below" 5.  Here it helps to have taken a course in Symbolic Logic and know about the operation "implies", a very useful (and, I'll bet, never used by at least 95% of all LabVIEW developers).  I won't give you the little lecture, but suffice to say P => Q ("P implies Q") is true in all cases except P is True and Q is False.  What is even more interesting is the negation of P => Q, which is True only when Q is True and P is False.

 

"OK, Bob, but how does that help us?  What are P and Q?"

 

P is "The last value of the slider is > 5" and Q is "The current value of the slider is > 5".  Do you see what that implies?  The slider has just crossed 5, otherwise known as a "Rising Edge Detector".  So how do you make a Falling Edge Detector?  Put the negation of "The current value of the slider is > 5" through a Rising Edge Detector!

 

So here is a Snippet based on what I just said:

Edge Detectors.png

But when I was saving this Snippet, I found another Snippet with almost the same name, but monstrously simpler (and using some interesting "Boolean functions"):

Edge Detectors II.png

Have fun with these.

 

Bob Schor

 

 

Message 3 of 5
(502 Views)

@Bob_Schor wrote:

What you are looking for is a "Rising Edge Detector" and a "Falling Edge Detector" ...

 

 


Well, using SubVI this can be stripped down to the following:

lf.png

But the author is definitivily beginner, I guess, so may be better to follow "straight forward" solution first without "magic" for educational purposes, even if it not so elegant.

 

0 Kudos
Message 4 of 5
(492 Views)

Thankyou everyone for helping for this query. I have checked and tried everyone's vi and all of them works as desired. 

0 Kudos
Message 5 of 5
(319 Views)