05-01-2015 11:51 AM
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
Solved! Go to Solution.
05-01-2015 12:03 PM
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.
05-01-2015 12:07 PM - edited 05-01-2015 12:07 PM
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
05-01-2015 12:34 PM
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
05-01-2015 12:36 PM - edited 05-01-2015 12:37 PM
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.
05-01-2015 01:10 PM - edited 05-01-2015 01:23 PM
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.
05-01-2015 01:33 PM
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.