LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using Control Reference to change subVI control - sub VI also called using a container

Hello

I am in need to update a control inside a sub VI that is also called inside a container in the main VI.

 

Please see the project attached.

 

My goal is simple -

 

  1. Change the "Main VI calling sub VI-Container.vi " panel's "FGV state"
  2. once the state changes, it needs to be propagated to the sub VI that is called within the container
  3. The sub VI's (sub VI called is "Check Time FGV.vi")  "FGV state" also needs to change when the main front panel's control

How do I accomplish this ? just a FYI - the sub VI being called is at "C:\Projects\User Examples\Check Time with FGV\Check Time FGV.vi"

 

Also my stop button functionality is broken, not sure why.

 

Thanks for your help.

0 Kudos
Message 1 of 5
(2,198 Views)

You didn't supply any code.  The project file is just a software organizer of code.  It doesn't contain any of the actual code.  Zip up your project and post that.

 

I would recommend using a queue to send messages into your subVI.  Your subVI can then read the queue and update whatever it needs to.


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 2 of 5
(2,197 Views)

Oops

here we go again.

 

0 Kudos
Message 3 of 5
(2,192 Views)

This time with path depedencies removed...

0 Kudos
Message 4 of 5
(2,187 Views)

OK you have a few problems.  Lets address the Stop button first:

 

Add a value change event for the stop button and put the stop button in that case.  Wire the button out of the event structure to the conditional terminal of the while loop.  WHAT IS HAPPENING:  You press "Stop" but the event structure is still waiting for an event so the loop never iterates.  Get rid of the wait.  the CPU will not be hogged unless you are generating events at warp speed.  No user can generate events that fast! so the loop will not be greedy.  The event structure does wait for an event it does not poll for them by running contineously.

 

Now your subpanel.  You do know that the FGV runs once when you invoke the run method on it right?  You can change the contol value all you want but the vi won't do anything about it because the vi is not running.  And even if the vi WAS running changing the value of a control that is read once (outside the loop) would not cause the value on the wire inside the loop to change at all.  Does that clear up some of why what you are attempting will not work like that?


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 5
(2,181 Views)