LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

reentrant vi in a for loop

Does anyone know if there is a way to place a reentrant vi in a for loop and make each iteration of the loop call a different instance of the vi?  Currently it seems the behavior is to automatically assume that each loop iteration should re-use the same instance of the reentrant vi, which usually seems to make sense.  I just wish there was a way to change that behavior for certain circumstances.  My current issue is that I have a reentrant vi that I need to run 18 times, but each of the 18 instances must save its state separately for the next cycle.  It would be nice to put this vi in a for loop instead of dropping it 18 times on my block diagram.  I dont want to get into the gory details of why i need 18 independent copies, but I do.

 

Feature request?  Smiley Wink



0 Kudos
Message 1 of 4
(3,487 Views)
open a reference to the vi and invoe the tun method (do not wait for completion).
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 2 of 4
(3,471 Views)
Make it a more complex single VI that also accepts [i] as an input and keeps 18 different states depending on [i].
0 Kudos
Message 3 of 4
(3,469 Views)

Another two options:

 

  1. Place a case structure with [i] as selector value, now in every case (1, 2, 3 ...) place the reentrant VI. This will load 18 instances of the VI into memory (make sure you don't share clones)
  2. Place a for loop with 18 runs before the actual for loop, and obtain a new reference to the reentrant VI with option 8 (new reentrant instance)

Good luck,

 

Ton

 

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Message 4 of 4
(3,450 Views)