Hi there,

I have tried to update my LV Vi design style to keep up with the new functionalities like User Event Handling, but there are still few things I don't quite masterize. One problem I have encountered several times, and which I ended up solving with global variables or hidden controls is the following.
I have a main Vi (call it TopLevel.vi) that dynamically launches subVis on user demand (call them subViN.vi, N=1,2, etc). The user plays with the subVi, and one action requires the main Vi to be updated somehow (shall it be panel update, menu update, or some action to be performed internally). I have a two "inelegant" solutions to that: (1) either update a Global, which the main Vi is then supposed to poll at regular intervals (thus killling the all idea of having the UI idle whenever there is no events, ie I can't set the timeout value of the Event structure timeout to -1), (2) or have a hidden control on the main level vi that I remotely change from the subVi, and that triggers an event in the Main Vi (value change).
I thought initially that the dynamic event registration feature would help me do this in a more elegant way, but I can't figure out how, so maybe I am just wrong. What I would need is some sort of event registration in the TopLevel.vi that would be fired in the subVis. But since the subVis are not started until possibly very late in the execution process, this cannot be done at launch time in the TopLevel.vi. Somehow I would need to have an intermediate Vi (call it Dummy.vi) that would run before the TopLevel.vi, start it and pass a set of dynamic event references, then hide somehow. When a subVi would start and need to communicate some event to the TopLevel.vi, it would in fact first trigger an event (again, Value change in the Dummy.vi ?), that in turn would have the Dummy,vi fire one of the events registered with the TopLevel.vi.
I am not sure that's a good idea, and since the problem is quite general, I am pretty sure some of you have good suggestions.
Hoping to here some comments...
Thanks
X.


--
______________________________________________________
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]
______________________________________________________






Reply via email to