LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Event picture ring

Hi,
 
I'm trying to call a sub vi from a picture ring. I want to be able to select the good picture, and then, once it has been selected, the sub vi execute itself. The vi should call the sub vi even if the picture ring value has not changed.
 
Thanks
Download All
0 Kudos
Message 1 of 6
(3,200 Views)
The difficult part of what you want to do is running your SubVI even if the value of the ring doesn't change.  Without that requirement, I would suggest watching for the "Value Change" event on the picture ring and running your SubVI in that event handling case.

I think what I would try instead is use your own dialog for changing the value of the pict ring.  Disable the ring control and watch for the mosue down event on it.  When this occurs, call your own SubVI that runs modal.  It will present an array of images to the user which they can click on one (or you can make the selection behave however you want).  The SubVI will then return the value of the image selected, which you can use to update the value of the pict ring on the main VI.

J



Jason King
LabVIEW R&D
National Instruments
0 Kudos
Message 2 of 6
(3,188 Views)
Yeah, that's sound a good idea for me. I'll give it a try.
 
Thanks for your advice.
0 Kudos
Message 3 of 6
(3,181 Views)
It seemed like a good challenge so I coded up something really quick that works (well, on my Mac. I make no claims as to how it actually looks on a PC).   This is to show proof of concept, but I think it's fairly robust. Let me know if you have questions.

J

Jason King
LabVIEW R&D
National Instruments
Message 4 of 6
(3,179 Views)
Thank you Jason
 
This is exactly what I was looking for.
 
Julien
0 Kudos
Message 5 of 6
(3,169 Views)
I guess I should note that the above example does not scale incredibly well as there's a separate picture control for each item in the pict ring.  I think the ideal solution would be to have a single picture control that is divided into regions for each "item".  We did something similar to this for the LEGO Mindstorms software where we needed the user to select from a grid of images.  There are a lot of minor details to address in this implementation which is why I went for the easier, quicker to implement one as a proof of concept 🙂

J
Jason King
LabVIEW R&D
National Instruments
0 Kudos
Message 6 of 6
(3,166 Views)