LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Overwrite reentrant setting of SubVIs

Solved!
Go to solution

Hello,

 

I would like to execute multiple instances of a Reentrant VI. The twist is that this VI has a lot of SubVIs and some of those SubVIs are "Functional Global Variable" (shift-register on while loop).

 

Thus, those instances share the same memory allocation for that variable. I would like those instances to share nothing at all and be completly independent...

 

Is there a way to make sure that any SubVI has its own memory allocation within his scope (Reentrant Root VI)?

 

Thanks a lot!

 

Vincent

0 Kudos
Message 1 of 9
(3,359 Views)

So you want some of your FGVs to act like normal as non-reentrant VIs that will keep a shared memory space wherever used, but others to not share the memory space? What's the point of using the FGV as subVIs of the reentrant VIs if you don't use the shared memory space? If you get rid of the memory space share, you might as well just not use the FGV.

 

You can't change a VI's reentrancy for different instances. You could potentially create two versions of the FGV (one reentrant, one non-reentrant), and use a case structure to choose which one to run. But this is very roundabout and it just seems to me like you need to do away with the FGV in these instances.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 2 of 9
(3,329 Views)

Hello James,

 

Thanks for your anwser!

I'm very well aware utility of a FGV. The thing is that the reentrant VI that I'm talking about is very complexe and have several SubVIs, FGV, GUI etc. They are vision inspection station that must be launch on 1 or several computer and many instance of any of these stations can run on the same machine at the same time. This is what I'm trying to acheive.

 

Thus, those FGV are very useful inside their own instance of the station.

 

Any suggestion?

 

Vincent

0 Kudos
Message 3 of 9
(3,322 Views)

Like I said above, you would have to change the way you use the FGVs because there is no way around the non-reentrant settings by instance. Creating a reentrant version of your FGV code and switching between the two may be your best option.

 

How do you use the FGVs? What data do you want to use if the FGV were reentrant? If it can't access the memory space, then the data has to come from somewhere else, right?

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 4 of 9
(3,316 Views)
Solution
Accepted by topic author vgravel

We did something like this a few years ago -- we had 24 "stations", each consisting of a Camera and additional I/O hardware, and launched each one using Start Asynchronous Call.  We passed into each Station a Station ID (a number from 0 .. 23) which we used to create (where needed) uniquely-named entities (like Queue names) on a per-Clone basis.  Within each top-level Clone, those VIs that needed to be specific to the Clone were coded as Reentrant, those that could be "shared" were not.  We didn't use FGVs, but if we'd needed a Clone-specific FGV, we'd have made it Reentrant.

 

Bob Schor   

0 Kudos
Message 5 of 9
(3,307 Views)

 

Yeah, I guess I'll have to do that...

 

What about instead of using a FGV, I use a Lossy Queue of a size of 1... Instead of deqeueing, I only do a preview of the queue to get the data.

 

What I would need to do is to store a unique name for each instance and use it to create/get access to the right queue.

 

I think that does make sense...

0 Kudos
Message 6 of 9
(3,303 Views)

Thanks Bob...

 

I was writing the same as you while you wrote yours...

 

I guess that is the best way to do it! I'll give it a try!

0 Kudos
Message 7 of 9
(3,302 Views)

@vgravel wrote:

What about instead of using a FGV, I use a Lossy Queue of a size of 1... Instead of deqeueing, I only do a preview of the queue to get the data.


That sounds a lot like a Global Variable to me.  Or, if you want to keep the reference setup, a Data Value Reference.


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 9
(3,298 Views)

Well... yes indeed...

Maybe I just didn't use the right term... When I speak of FGVs, I usually mean an uninitialize shift-register.

0 Kudos
Message 9 of 9
(3,296 Views)