From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

instances

Hello all,

                               Can you please tell me how to open multiple instances of same SubVI. One standard method which i know is to convert the vi into vit, use open reference,  for loop & convert the subvi exection to reentrant. which is described here

                                But i cant use this because i need to pass data to subVI & based on this input only subVI will process the data. If using this method i can pass the data than its great Smiley Very Happy

 

 

Problem ?

 

A subVI which i want in multiple instances will execute different task based on the passed value from the called VI but front panel will same.

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 1 of 16
(2,839 Views)

Hi Ranjeet,

 

set that subVI to reentrant, so each instance in the code will run in parallel with all other...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 16
(2,838 Views)

I tried this also than also its not working.

I am sending you my code.

Please let me know. 

 

Each time you press add button from the master.vi by entering the different value. Its creating only value

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
Download All
0 Kudos
Message 3 of 16
(2,819 Views)

I'm not seeing what your problem is.  With the VI set to reentrant, you can just call the VI directly in parallel.  With the example you gave, you can only run 1 task at a time.  Are you trying to get them to run in parallel?


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 16
(2,810 Views)

Hi Ranjeet,

 

your subVI can only produce one result from it's inputs as it is working with scalar in-/outputs. What else do you expect?

 

Right now your subVI will block the mainVI from execution as the mainVI has to wait for the subVI to finish...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 16
(2,808 Views)

Hey,

                Thanks for your time, I just want to call slave.vi from master.vi as soon as i press add from master.vi.

 

My slave.vi is reentrant. This is what multiple instances means.. am i right ?

 

i just want to acheive that as soon as user presses add from master.vi by entering different value from master front panel. The slave should add the value & present to output.

 

Just want multiple run slave.vi parallely.

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 6 of 16
(2,800 Views)

Hi Ranjeet,

 

your slave already does what you want it to do: as soon as you press the ADD button the slave is called and presents the result of the addition...

 

Oh, you edited your message:

To call the slave in parallel you have to program it in a parallel fashion. Right now there is only one instance...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 16
(2,795 Views)

Maybe you need the Asynchronous Call By Reference:

Start Asynchronous Call Node

Wait On Asynchronous Call Node


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 8 of 16
(2,782 Views)

Hi 

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 9 of 16
(2,758 Views)

hi crossrulz,

                                 Can u elobate how can i acheive this. How can i acheive the parallel using the solution

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
Message 10 of 16
(2,757 Views)