LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Displaying Static and Dynamic Picture using Event Structure

Solved!
Go to solution

Hello everybody,

 

I need to display a static picture using an event, and then using another event, I need to keep displaying the second picture, while the first stays displayed. Simply speaking, in the attached example, I would like to have the black colored circle fixed while I dynamically change the red circle.

 

My attempt is shown in the attached VI with the first approach using shift-register, and the second one using property node (Value). Both don't work. Either the previous red circle doesn't erase, or the black circle also gets erased.

 

I would appreciate any help in this regard.

 

Thanks

0 Kudos
Message 1 of 7
(3,250 Views)

What do you mean by "it doesn't work".  It is it doing that you do not want it to do?  What do you want it to do that it is not doing?

 

The shift register is the way you should be doing this.


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
0 Kudos
Message 2 of 7
(3,244 Views)

Thanks for the reply crossrulz,

 

The situation is explained as under.

 

Target: I would like to have the black colored circle fixed while I dynamically change the red circle.

 

Problem: Either the previous red circle doesn't erase (yielding slew of red circles), or the black circle also gets erased.

 

Regards

0 Kudos
Message 3 of 7
(3,241 Views)

I was able to solve this (attached) by redrawing the black circle again in the changing red circle event. 

 

I am not sure if it is the efficient way to do this though.

 

Thanks

0 Kudos
Message 4 of 7
(3,224 Views)
Solution
Accepted by topic author nskatlv

From what I'm seeing here, you need to have two shift registers, one for each circle you are trying to draw.  You just update the one that needs updating inside of the corresponding event case.  You then use Cancatinate String to combine the two pictures.

 

Other things to note:

Put the terminals of your controls into their respective event cases.  This makes sure you are using the latest data instead of stale data.

 

Change the Stop button's event to Value Changed.  Again, put the terminal inside of the event case.  This will allow the latch to work its magic.

 

The picture subVIs want the radius to be I16 instead of DBL.  I recommend changing your sliders to use the I16 representation.

 


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 5 of 7
(3,222 Views)

Thanks crossrulz,

 

This circle thing was just a simple example I conceived to convey my actual problem with a larger dataset. But your pointers are helpful in any case.

 

Good thing about your solution (unlike mine above) is that the black circle doesn't need to be redrawn. The concatenation for the picture function didn't occur to me and is the biggest find for me here.

 

I am going to try implement this in my actual problem.

 

Thanks & Regards

 

 

PS: The second shift register (for the red circles) is redundant as I observe. I guess the concatenation was the key.

0 Kudos
Message 6 of 7
(3,207 Views)

nskatlv wrote:  The concatenation for the picture function didn't occur to me and is the biggest find for me here.

I'll be honest, I didn't know the Cancatinate String would do this either.  But that is what I found when I went digging into the picture VIs and went with it.  Glad to hear that you have things working now.


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
0 Kudos
Message 7 of 7
(3,192 Views)