LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

register multiple user events in subvi event structures

Hello experts,

My top level vi utilizes an event structure that acts on GUI events.  I want actions in the top level VI to trigger use events located in subvis (which also have their own event structures).  So far I am trying to dynamicaly register events but I have not been able to do this successfully. 

So far, I can pass data to the plotting subvi and it correctly processes the event, however it then hangs.  I'd like the toplevel.vi to regain control and wait for the next value change.  If another value change hapens in the toplevel.vi - it should reupdate the plotting vi.

I've attached code.

Many thanks,
Joe


Message Edited by Dallas on 06-04-2008 09:04 AM
Download All
0 Kudos
Message 1 of 5
(4,650 Views)
Your fundamental problem is that once the top-level VI calls the subVI it has to wait until the subVI finishes, and that doesn't happen until you press the "Stop" button on the subVI. You need to launch the subVI dynamically and have it run as its own independent process. Check the LabVIEW Help as well as shipping examples (Help -> Find Examples), as well as the many examples in these forums for how to do that.
Message 2 of 5
(4,641 Views)
You can see some examples in this thread (I suggest you read all of it).

___________________
Try to take over the world!
0 Kudos
Message 3 of 5
(4,629 Views)
Thanks for the responses.

I took a look at dynamically calling subvis and I had looked at that option before.  The problem as I saw it (at the time) was that you can not trigger a user event based on a new data set.  Ideally, the top level vi would get done performining a test, then it it forces a data set onto the plotting subvi.  The subvi would plot it and return to the top level vi which is waiting for the next event to be called.


Let me ask this question, could I just use a property node to value signal the stop button in my previosuly posted code?  This would stop the subvi event. What is the downside of this - presuming it works?

Thanks,
joe
0 Kudos
Message 4 of 5
(4,610 Views)
Well, it's clumsy. A better option is to use a queue to transfer the data to the other VI. That way the main VI just puts the data into the queue, and immediately returns to handle the next even. The other VI is simply monitoring the queue to see when data gets put into it. This has been recently discussed in this thread, and this one.
0 Kudos
Message 5 of 5
(4,603 Views)