I need to launch multiple instances (or clones) of the same vi.
In the attached labview project I am trying to do it, the only problem is that when I look at the VI Hierarchy I only see 1 instance of the VI I am trying to clone. So I think there is something wrong.
As you can see,I use the "open the VI reference" block with option 8, plus I set the VI execution property to be reentrant.
Can somebody point me out a possible solution?
thanks in advance
Try to launch asynchronous call of your VI multiple time ?
Careful you have to close it right with queue or whatever you are working with.
They are only spanned when you run the code.
The VI hierarchy does not act on running code.
You can use the DETT, the Profile Performance tool or some of the other tool under Tools->Profile.
But most only works with running code to get you information.
I do this in several of the Projects that I've created. My preferred way to start and run parallel routines is to use the Start Asynchronous Call method, which also works very well with Clones. One advantage of the method shown here is that it works identically in both Development Mode and when built into an Executable.
This code is in LabVIEW 2016 (which you might not have), so I'm only supplying a "picture" (something I'm ordinarily critical of other Forum Posters for doing -- please forgive me). However, the technique should be obvious, but I'll explain.
The Clone (here the "Blue VI" called "Producer") is, as you've done, configured as a Preallocated Clone Reentrant Execution. The For Loop starts as many copies as you specify. We begin by creating a specific Named Queue for each Clone (I pass in the Loop Index, incremented, to create Queues named "Clone 1 Q", "Clone 2 Q", etc.). To set up the Start Asynchronous Call, we need a VI Reference. We begin by using a Static VI Reference, browsing for the Path to the VI of interest (here "Producer"). See the red star? I right-click the Reference and select "Strictly Typed Reference" (which includes the information needed to specify the VI's Connector Pane). This gets wired to a Property Node to get the Path to the VI. The Path gets wired to the path input of Open VI Reference, with the "typed" VI Reference wired into the top Type Specifier input, and the appropriate option codes (here 0x140, 100 for Call and Collect, 40 for Clone). Now we can drop a Start Asynchronous Call node, wire in the VI Reference, and the appropriate Front Panel Input connectors will appear for wiring (here I'm passing two queues and a "Clone Number" (so the Clone will "know its name")).
thanks man, I have versione 2016 so you can upload you code if you wish.
In the meantime I will try and reproduce what you have shown.
will let you know (please post code if you can)