LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I call the subvi in parallel with main VI. Main vi should not wait for the subvi

I have a subvi which takes the parameters like port name, transmit rate, message to transmit over serial port and Start/stop flag. This subvi calls VISA write vi in a loop continuously, till the Start/Stop flag is false, to write a message to serial port at a mentioned transmit rate. This subvi will be called from another VI. Actual intension is to transmit different messages to different ports continuously and stop them when required. In this senario, please provide solution for below points:

 

1. How do I call the subvi in parallel with main VI. Main vi should not wait for the subvi.

 

2. How does main vi can control already running subvi in parallel to it. In the above example I would like to start the subvi from main vi when start\stop flag is true and would like to stop it when the flag is false.

 

3. How do I call the subVI with one set of parameters from main vi, when same subVI is running with other set of parameters already from main vi(subvi being called in a case with different set of parameters each time when the case is called). Means, how do I keep track of reentrant subvi (different calls to same vi)from the same main vi.

0 Kudos
Message 1 of 4
(3,533 Views)

You can e.g. start the sub-vi through VI server or Asynchronous call, and connect a user event to the sub-vi so it can get events to react on (or a simple AE which'll check if time to stop in the sub-vi).

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 2 of 4
(3,524 Views)

Hi,

 

Just look for something called "Master - Slave Architecture" in NI website. You will find answers to your questions on architecture level.

For condition checkin booleans (For multiple port write), you can use either a simple LV2GBL or a synchronizing techniques like notifiers or queues.

You can look for these terminologies as well in NI website.

If you need more details, let us know.

 

Regards,

Muthuraman S

Regards,
Muthuraman
0 Kudos
Message 4 of 4
(3,514 Views)