LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

delay case structure

Hi,
I am presenting one out of two different pictures ( in a case structrure)  on the control panel, based on some processing that is done sample by sample, by outputting a boolean variable(call it X).
What I would like to do is this:
If X is true -->  display PIC1
If X is false --> display PIC2, and maintain it for, say, half a second, no matter what is the actual value of X in this time range.

As of now, I managed to do basically this:
If X is true -->  display PIC1
If X is false --> display PIC2

And this is not good enough for my VI, since there is an annoying flickering between images

 

Thanks 

0 Kudos
Message 1 of 24
(3,387 Views)

I think that a Wait (ms) function would do it for you.

Look up in the timing Programming >> Timing palette the function Wait (ms) and wire the delay you want (in ms) to the left (as a constant or control). This should works.

 

Regards.

Mondoni
0 Kudos
Message 2 of 24
(3,382 Views)

Thanks! 

The problem is that the case structure ( and so the images) are into a while loop, but i don't want a delay of while loop ...

0 Kudos
Message 3 of 24
(3,379 Views)

Nop.

Why don't you put your images inside the case structure? 

Mondoni
0 Kudos
Message 4 of 24
(3,373 Views)

I am not sure if I explained it correctly:

with the wait function, the vi will basically pauseexecuting for the specified amount of time, right?

I don't want this, I would like to have the function execute normally, and just the picture to "freeze" for a specified amount of time.

Would it be possible?

Thanks!

 

 

0 Kudos
Message 5 of 24
(3,367 Views)

Check out this community example:

Display Image on Front Panel for Specified Amount of Time

 

 

Mondoni
0 Kudos
Message 6 of 24
(3,358 Views)

Do you know how fast your loop is iterating?  If so, you can set a flag to FALSE and keep it false for so many iterations.  The flag can then just be ANDed with your boolean to determine which picture to show.  You will need two shift registers on your loop: one for the flag and another for the loop count.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 7 of 24
(3,347 Views)

Use the Tick ms to calculate how long it was since you showed image. If X = True or time (Tick(now) - tick(show image) < 500 ==> show image.

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 8 of 24
(3,331 Views)

Hope this is what you are looking for,Delay is 2 sec once pic 2 is selected.

 

Let me know if something else is needed.

Thanks.

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 9 of 24
(3,314 Views)

@Ranjeet_Singh wrote:

Let me know if something else is needed.


Did you notice that your VI uses 100% of a CPU core when the button is not pressed, slowing down everything else running on your computer? You only need to write a property when it changes, not over and over millions ot times per second. Right?

0 Kudos
Message 10 of 24
(3,306 Views)