I don't believe that is the case. You should be able to create the queue outside your top-level vi, and pass the queue refnum to the subvi. In the subvi, you would use "enque element" and in the top level vi "dequeue element". The dequeue just waits until something appears in the queue, then acts on it. There is no unneccessary polling (besides the low-level operation of looking at the queue contents). No globals involved.
This should work, unless I completely missed your problem description. Eric -----Original Message----- From: Xavier Michalet [mailto:[EMAIL PROTECTED] Sent: Monday, June 21, 2004 12:38 PM To: George Gatling (Contractor) Cc: info LabVIEW Subject: Re: Generic UI question Hi Georges, I think I understand your approach, but it seems to me that the separate loop that is needed in the MainLevel.vi will have the same "problem" as the polling strategy I was mentioning, that is, unecessary activity (you can't use a queue without volontarily polling it, ie you will again need to relieve the CPU of unwanted load by having a Wait 100 ms in your side loop). Plus, how do you enqueue something in a subVi, when the queue is read in the TopLevel.vi ? Somehow you need a Queue RefNum global, if I am not mistaken. What do you think ? X. George Gatling (Contractor) wrote: > One possible solution would involve using queues. Create a queue that > uses a cluster of an enum and a variant as the type. Put a loop in > your main VI that waits for elements to arrive in the queue. When > they show up, it uses the enum to determine which control to update > and then casts the variant to the appropriate type and does the > update. I uses this method all the time very successfully for things > like moving the cursor on a graph around, enabling/disabling menu > items, updating control values, hiding/disabling controls or > indicators and on and on. Finally, one of the items of my enum is > "exit"... and so when the app is exiting it sends the exit message to > the UI Update loop to stop it so the application can exit gracefully. > This way you can put a -1 for the timeout on the deque and make your > ui updates "event driven". > > If this sounds like something you'd like to try but it is still not > entirely clear what I am talking about, let me know and I will send > you an example. > > 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] ______________________________________________________
