LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Run two different VIs in parallel

Solved!
Go to solution

Hello,
i'd like to know how to call and run a second VI in parallel to my main one with both windows open because i want to acces controls on both.
In my case i have a userinterface for a machine on the Main.vi and i want to simulate some machine behaviour and mechanical actions that have to be performed in the second VI.
I am communicating over a third VI keeping my global variables.
Lets call them Main.vi, Controls.vi and Globals.vi for this case.
I'm new to labview and would be happy for some advice to a simple solution.

Best Regards,
MT_at_home
0 Kudos
Message 1 of 11
(3,772 Views)

Hi MT,

 

just run them in parallel - with no dataflow dependencies!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 11
(3,758 Views)
Solution
Accepted by topic author MT_at_home

Hello,

A simple option is to put Controls.vi in the main and select "Show front panel when called" in Vi properties->Window appearance->Customize. It will need to be in parallel of your other processes.

 

Yddet 

Message 3 of 11
(3,755 Views)

Thx, is there an option to kill Controls.vi when i stop the Main.vi?

Best Regards,
MT_at_home
0 Kudos
Message 4 of 11
(3,750 Views)

Figured it out by myself, just put a terminal to the stop button of my Controls.vi and wired it to the stop of Main.vi.

Best Regards,
MT_at_home
0 Kudos
Message 5 of 11
(3,746 Views)

@MT_at_home wrote:

Figured it out by myself, just put a terminal to the stop button of my Controls.vi and wired it to the stop of Main.vi.


But that would either mean your Controls.vi is in series with your main loop or you are not getting an updated value.  I would use a Queue, Notifier, or User Event to have your main VI send a message to your Controls.vi to command it to stop.


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 11
(3,729 Views)

Okey, found some buggy behavoiur in my way...
So what's the correct way of doing it then, i have no idea sadly.

Best Regards,
MT_at_home
0 Kudos
Message 7 of 11
(3,720 Views)
Solution
Accepted by topic author MT_at_home

Hi mt,

 

as said before: call both subVIs in parallel without dataflow dependencies!

 

(That's basic LabVIEW knowledge, so I suggest to take the training resources offered in the header of this LabVIEW board. Also note the self-paced courses are free until end of April!)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 8 of 11
(3,713 Views)

@MT_at_home wrote:

Okey, found some buggy behavoiur in my way...
So what's the correct way of doing it then, i have no idea sadly.


You've been told the correct way of doing it. You've not shared your code so we can't tell you what you're doing wrong. Buggy behavior is not a proper explanation.

Message 9 of 11
(3,601 Views)

You were right, putting them in parallel without any wire-connections was the correct way i didn't know to use in the first place.
By creating local variables and using these instead of wiring from one loop to the other the problem was solved, thx 4 the advice.

Best Regards,
MT_at_home
0 Kudos
Message 10 of 11
(3,548 Views)