From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
05-11-2014 03:34 PM
For a schoolproject I'm programming a Compact Rio to control an algae cleaning boat that is autonomous.I want the labview on the compactRio to generate a sound when the battery is almoust empty, the box is full of algae, the boat collided with an object. To hear the difference, their has to be a different morse code for each of the cases, and it also can not be on for too long.
Does anybody know how to do this?
Thanks!
05-11-2014 04:26 PM
What part do you not know how to do?
Do you have a means of detecting the alarm conditions?
Do you know how to generate Morse Code ..- - ..
Do you know how to generate the sound? Does your Compact RIO system have a sound output?
Do you know how to make a subVI run for a specified time and then stop?
Do you know how to ask specific questions which will get you moer helpful answers?
Lynn
05-11-2014 04:52 PM
I don't know how to generate a morse code, and also don't know how I run a subvi for a period of time on command...
05-11-2014 05:04 PM
Use a lookup table for the Morse code.
Read the detailed help file for Elapsed Time.vi. Place the VI inside a loop with a short Wait and stop the loop after the Time has Elapsed? output becomes True.
I have not used cRIO, so I am not sure what might need to be changed for that.
Lynn
05-12-2014 08:43 AM - edited 05-12-2014 08:44 AM
Thanks for the reply Lynn!
I now have this. It does the job. For a number of seconds that i set up, the sound goes on and off in the rhythm. But the Elapsedtime from the subvi only counts when every cycle of the flat sequence passed and not every second, in this case every 2.5 seconds.
Is there a way to get this result without flat sequence?
05-12-2014 08:59 AM
That question doesn't make sense.
The loop will iterate when everything inside of it is complete, which is primarily the 2 second wait followed by the 1/2 second wait.
There is no way to get the loop to run at a 1 second rate when the code inside will take 2.5 seconds.
05-12-2014 09:13 AM
And now i tested it in a while-loop, because it will be running in a big while loop, and it keeps running if the bool keeps being true.
My goal is that it stops after the amount of time, even if the bool stays on true, in a while loop. And that it can be started again when bool gets false and then true again.
05-12-2014 09:32 AM
Then you need to turn off the boolean that drives the case structure so it doesn't run again when your big while loop iterates.
05-12-2014 10:12 AM
This does the job!