05-24-2013 08:27 AM
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
05-24-2013 08:32 AM
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.
05-24-2013 08:34 AM
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 ...
05-24-2013 08:37 AM
Nop.
Why don't you put your images inside the case structure?
05-24-2013 08:45 AM
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!
05-24-2013 08:57 AM
05-24-2013 09:14 AM
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.
05-24-2013 10:15 AM
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
05-25-2013 12:07 AM
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.
05-25-2013 01:38 AM
@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?