Hi Georges,
thanks for your time. I am a bit puzzled by the while loop without a "Wait" in your example, but I checked (Profile Vi) that indeed, since the reentrant Vi was in a sense hanging on as long as nothing is enqueued, this while loop was also hanging on for ever doing nothing. I also separated the two loops, one [firing events] that I put a "sublevel Vi" (the equivalent of my dynamically lanched Vi) and the other [responding to events] remaining in the top level vi. Works like a charm, even though I don't understand the timeout feature. I think I am going to use it, and each subViN (see my first post) will have the firing events loop in it.
But overall, this example doesn't use the Event Handler on the [respond to events] side...
Best, X.
George Gatling (Contractor) wrote:
The way I manage my queues is maybe a little eccentric.... i create a reentrant subvi for each queue I want to use in my application. I name this queue the same name as the subvi (using a property node for the VI), and the subvi has an input to specify whether to enque or deque (it also has data in, data out and timeout terminals). I put one instance of this vi in the deque loop with timeout set to -1. Then, wherever I want to enque data I drop instances of this subvi with the operation terminal set to enque. This has some memory overhead because an instance of the reentrant VI is created everywhere I use the queue, but that's ok for me because I prefer the readability and convenience. It is easy to see where data is getting into the queue be looking for instances of the queue subvi. With the queue timeout set to -1 the deque operation will suspend until data is placed in the queue... this is what makes this approach event driven. (And is what also creates the need for and exit command for the queue... there is no other way to stop the loop while it is suspended in the deque).
I will send an example by private mail.
George
-- ______________________________________________________ Xavier Michalet, Ph D Department of Chemistry and Biochemistry, UCLA Young Hall-2002, 607 Charles E. Young Drive East Los Angeles, CA 90095-1569 Ph: (310) 794-6693 (off)/6685(lab); Fax: (310) 267-4672 Email: [EMAIL PROTECTED] ______________________________________________________
