03-21-2018 10:57 AM
Hello guys,
I have this VI that retrieves data from 3 different arrays (depending on the input, it will give the first, second or third data set), and then displays it.
The first data set has 10 samples, the second 50 and the third 100.
Statistically speaking, the first one has few samples enough, so I added a loop that, each time the number of samples has less than 30, he just shows a message to the user saying:
"ATENTION!!! Number of Samples < 30 !!!
In small data sets of less than 30 samples is not advised to use Sturges rule do plot histogram because the number of bins will be less than 7!"
But what happens is that, as soon as I choose that dataset, the program just enters a infinite loop and never leaves (I have to Alt+Ctr+Delete).
I searched for a solution and some of you said creating a flag or shift register, but to be honest I don't know how to do it or set it up.
Could you please help me?
Baiscally, what I want is, EACH time the sample number is smaller than 30, show the user ONCE the message on the screen!
Projects and VI's are here!
Thanks
03-21-2018 11:07 AM - edited 03-21-2018 11:08 AM
Try the Boolean Crossing PtByPt VI. If you set the direction to "false-true" it only outputs true for one iteration when the signal goes from false to true. If the signal stays true or goes from true to false, it will output false.
03-21-2018 11:11 AM
I don't see that issue here. I run it with the default settings and the message pops up and the program runs and stops.
It's hard to get stuck in a loop when your program does not contain a single loop!
03-21-2018 11:59 AM
Im running it continuously, maybe that's why! But either way, I don't want the program to end, just to show the message and continue
03-22-2018 11:16 AM
Here I try to explain the problem a little bit better: