03-05-2024 10:44 AM
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.
03-05-2024 10:52 AM
Most simple modification is something like that:
03-05-2024 08:46 PM
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:
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"):
Have fun with these.
Bob Schor
03-05-2024 10:53 PM
@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:
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.
06-10-2024 12:46 AM
Thankyou everyone for helping for this query. I have checked and tried everyone's vi and all of them works as desired.