02-28-2011 09:52 AM
Here's the deal... if I can describe it. Should be no need to post a vi... should be a simple problem.
I have several images on the main front panel. When one image is clicked, it begins to flash. I'm doing this with a parallel while loop. I'm swapping the image loaded from disk with an empty picture twice a second. I see my image for 500ms, and then an empty image for 500ms. When its clicked a second time, the flashing stops and the image from disk is displayed.
Everything works great, but I want to convert it to OOP. For the learning experience if nothing else.
What I'd like to do is keep all image control inside of the class. Everything is fine until I need an image to flash.
So... my question is this... can I execute a data accessor in parallel with the main program? In its own thread? This way I can flash the image with a while loop while allowing the rest of the program to go on about its merry way.
I'm pretty sure now that I have thoroughly confused anyone reading this. I could throw together a quick vi to demonstrate.
The question seems simple though... can I run a member function(vi) of a class in parallel with the main program?
02-28-2011 03:25 PM
The short answer to your last question is yes. Class member VIs are no different from any other VIs, so you can run them in parallel to other code.
That said, there are a couple of points to make:
I suggest you look through some of the LVOOP training material available on line to get a feel for where it might be better suited.
02-28-2011 03:36 PM