LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Update changes done in a subVI and see results in main VI

I have a main vi, it consits of a state machine. The Settings State of the state machine is supposed to pop-out the SubVI which will allow me to choose what Analog channels to use. However my problem is that, when I close my subVI the changes I've done does not apply to my main VI. 

 

 

Download All
0 Kudos
Message 1 of 9
(3,506 Views)
Why should the changes apply? You don't pass them back to the main. You can connect the subVIs indicators to the connector pane and call the subVI normally. No need for that dynamic call you have now.
0 Kudos
Message 2 of 9
(3,478 Views)

I need to change the Channel for Analog Input, I can choose Analog Channel In 1, or Analog Channel In 2, or I can display them both in my waveform graph

0 Kudos
Message 3 of 9
(3,474 Views)

Of course not.  You are not passing the data out.  You will also need to stop your task, set the sample rate again, and then restart it.    And you will want to store your number of samples to read in a shift register.

 

Edit: Looking at your code again, I think you will benefit from not having your initialization outside of the state machine.  That should be moved into your settings state and replace what you currently have in there.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 9
(3,471 Views)

What functions do I need to pass my data? Part of this program is that you dont need to press the stop button. So when I close the settings pop-up window, the changes I applied (selecting a different channel from Analog In) will automatically apply once I press the Acquire button once again.

0 Kudos
Message 5 of 9
(3,441 Views)

@jamison.suade wrote:

What functions do I need to pass my data?


You already did it once at the start of the VI.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 9
(3,435 Views)
You seem to need to take the basic tutorials of you don't know how to wire indicators to the connector pane. You have not even explained why you are calling the subVI in this manner. Someone else wrote this?
0 Kudos
Message 7 of 9
(3,413 Views)

I'm refering on what functions do I need to pass, something like references.

0 Kudos
Message 8 of 9
(3,399 Views)

@jamison.suade wrote:

I'm refering on what functions do I need to pass, something like references.


You need to pass the values you set in the settings VI out of the settings VI, just like you did with the first call to it.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 9 of 9
(3,386 Views)