LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Showing error message only once each time condition is met

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

Download All
0 Kudos
Message 1 of 5
(3,129 Views)

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.

0 Kudos
Message 2 of 5
(3,119 Views)

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!

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 3 of 5
(3,114 Views)

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

0 Kudos
Message 4 of 5
(3,106 Views)

Here I try to explain the problem a little bit better:

 

Statistically speaking, when using data with less than 30 samples, it's not advised to use the Sturges rule, and so, I created a "Display Image" within a case structure.
 
What I wanted to happen? Every FIRST time the case with less than 30 samples was selected, the message poped up in the screen, advertising the user, the user would click "ok" and the program would continue, and only when he choosed again that data sample, the message would then appear again, only ONCE.
 
What is happening? As soon as I run the program continuously and I click on the data sample with 10 samples, the program enters a Infinite Loop of showing the message, and when I click ok, it appears again, so that the only way for me to leave the look is to Alt + Ctr + DLT!!!
 
The answer to the problem? I've been looking and some people suggested using a Flag that would go on and off each time the Sample was chosen and off each time other sample was chosen. Other suggestion was using the "ok" and the "enable" output and input of the "Display Message to user", but I couldn't put that to work!
0 Kudos
Message 5 of 5
(3,084 Views)