LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Passing data from subpanel to subvi

I have been trying to pass data from a subpanel to a subvi so that when a button is pressed the data being read is continuously updated. 

 

I need to pass a array ideally but have managed to get something to work using strings.  I can get it to run but it only updates once when the button is pressed.

 

I think I need to open the subvis in memory and then keep a subvi open when a button is pressed.  It needs to run this subvi continuously until another button is pressed or the exit button is pressed to kill the application.

 

Any help greatly appreciated.

0 Kudos
Message 1 of 4
(2,581 Views)

It's not clear to me what you're trying to do.  You mention passing " data from a subpanel to a subvi ", but a subpanel doesn't really contain any data (except for the reference to the contained VI).   If you meant to refer to the contained VI instead of the "subpanel", then it seems like you're asking how to send data from a VI to a subVI; that's trivial, just call the subVI.

You also mentioned "data being read is continuously updated", but your VIs "test1.vi", "test2.vi", "test3.vi" don't do anything continuously.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 2 of 4
(2,548 Views)

I'm trying to update a graph that is contained within the subpanel by referencing and array containing the graph data.

 

that graph needs to be updated continuously.  Any ideas what the best way to do this is?

 

0 Kudos
Message 3 of 4
(2,534 Views)

Provide some method for sending data into the VI when you start it running asynchronously (i.e. before you place it inside the panel) then use that after you embed it.

 

For example, you could place a queue reference on the connector pane of the subVI, then create a queue in the calling VI, and use that to pass data. In the subVI, dequeue elements and update the graph. Run the subVI asynchronously and then embed it in the subpanel.


GCentral
0 Kudos
Message 4 of 4
(2,512 Views)