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.
07-19-2013 05:16 AM
Hi everybody.
I want to execute a case structure inside a while loop only once. The case strucutre is controlled by a counter, so that every time the counter has a value multiple of N, the program records an acoustic signal and calculate the main peaks of the FFT. The problem I have at the moment is that, every time the case is executed, it records and analyze the sound several times until the counter jumps to the next value. I want the case to execute only once every time the counter has a value multiple of N. I atttach the vi.
Thank you for your attention guys!!!
07-19-2013 05:56 AM
Hi Franky,
right now the case structure is called with
IF counter = zero
You should change that to
IF (counter = zero AND counter <> previous counter value)
Btw. there are special functions to compare for "=0". There is also a function to convert a boolean to 0/1.
07-19-2013 06:16 AM
GERD is right. You should use a feedback node to store the previous count value. If the current count is Not Equal AND the remainder is Equal To Zero run your case.
Since your counts are all integers, I would also recommend changing the representation to an integer type. I32 would likely be the most appropriate.
07-19-2013 08:20 AM
Already solved! Thank you guys!!
06-17-2018 11:53 PM
Hey, I'm new to Labview. Im facing the same problem.Please can you show me how to do what you have suggested?
06-18-2018 01:07 AM
Hi amysri,
I'm new to Labview.
Yes, you even don't know how to spell/write "LabVIEW"… 😄
Did you notice that "beginner" (aka "Tutorials") section in the header of the LabVIEW board?
Im facing the same problem.Please can you show me how to do what you have suggested?
This forum works the other way around!
Show us what you have tried so far and tell us, where you are stuck!
As has been said several years ago: you will need two comparison functions and a shift register (or feedback node) to reach your goal!
06-18-2018 05:43 AM - edited 06-18-2018 05:43 AM
@amysri wrote:
Please can you show me how to do what you have suggested?
06-18-2018 05:47 AM
Hi crossrulz
Thank you so much.. 🙂
It means a lot
06-18-2018 06:09 AM - edited 06-18-2018 06:10 AM
@amysri wrote:
Thank you so much.. 🙂
It means a lot
Funny, I don't see any "thank yous".
02-06-2019 08:01 PM
My first post begins with an apology...to crossrulz for incorrect posting etiquette and probably a ton of other forum transgressions, but a POST button is missing for some reason and I have been researching and fiddling around for days on how to execute a case structure only once. I finished Core 1, working on Core 2, but am still practicing on actual coding, so would appreciate really dumbed-down help.
Specifically, how can each of the case structures in the attached pic be programmed to execute once? Others have suggested local variables, "implies statements", First Call?, Shift Registers, but am not sure how to implement them
Thanks for any direction.