03-13-2008 10:50 AM
Norbert B wrote:[Edit] You should not include other loops into events if the loops depend on useraction. Please read Gerds posts carefully regarding this "issue".
03-13-2008 10:55 AM
03-13-2008 11:42 AM
But isnt the producer-consumer architecture a queueing concept. I don't necessairly need every code to be executed one after the other. Only when the button is hit, it should execute.
Also if this is not true, what goes in the consumer loop and what goes in the producer loop?
03-13-2008 01:41 PM
smm,
You can still use the event structure to accomplish what you are trying to do. If I understand correctly, you want to be able to independently start VIs running in separate threads by clicking on the appropriate buttons. The trick is that you need to call the subVIs dynamically (look up Run VI function which can be called on a VI using an invoke node). If you execute the subVI using "Run VI" you can set an input parameter "Wait until done" to false in order to allow your event loop to continue processing your user's button clicks, etc.
If you need to be able to synchronize these threads, it is possible, but is definitely not "basic" LabVIEW - expect to read a lot of documentation to get up to speed.
Rob
03-14-2008 07:54 AM
03-14-2008 08:17 AM
03-14-2008 09:10 AM
03-14-2008 09:21 AM
I'm afraid attaching the VI won't be particularly useful, and since it is technically the property of the company I work for, I'm not even sure the legality of doing so. In any case, there are numerous dependencies and most of it doesn't apply to your situation at all. What you care about is all within the timeout event block. And unless you need to pass parameters to your subVIs, you don't need the call to "Set Control Value" either. Just use the "Open VI Reference" passing it the path to your subVI, and pass the resultant VI reference to an invoke node and select the "Run VI" method, passing in a false for the "Wait until done" parameter. The stuff in the error handler just manually closes the reference and ignores error 1000 in case the subVI that I'm calling was still running from a previous call; you probably don't need it for prototyping purposes.
Anyway, good luck. I'm sure there is documentation on how to use Run VI somewhere, though in a cursory investigation I must admit that I didn't find it. Anyone out there want to point to some examples that might help?
Thanks,
Rob
03-14-2008
09:39 AM
- last edited on
06-11-2025
10:25 AM
by
Content Cleaner
Here
http://zone.ni.com/devzone/cda/epd/p/id/2144
03-14-2008 10:02 AM