LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reentrant top level vi


@for(imstuck) wrote:

Jeff·Þ·Bohrer wrote:

 

Scaleing a singlton to a multiple is a lot easier by replacing the FGVs with Classes.  Each caller then needs only know which collection of class instances contain the collection of "MyData."


Ugh, but now you have to pass that wire around! Smiley Very Happy


I Said  "spawn One VIT (FGV) that holds references to your "MyData" class instances"Smiley Surprised


"Should be" isn't "Is" -Jay
0 Kudos
Message 11 of 16
(470 Views)

Thanks Greg - This was very helpful.  Although, I don't yet understand why I can't just drop two instances of the vi template on my block diagram (as you apparently tried in your diagram disable structure).

0 Kudos
Message 12 of 16
(460 Views)

Hello

 

I know this discussion is pretty old but i am in the same situation as meg57 (existing application with FGVs AEs which i need to make multi-instances) except that it's a Windows application, not RT.

 

I was really interested by the VIT solution but unfortunately it doesn't work when i build an executable, it throws an error 1127 Smiley Sad

 

After reading several other discussions here and on the LAVA forum, I finally have the idea to encapsulate the data of my AEs in variant attributes (1 attribute per application instance) and use "Call Chain" to identify the instance. See below this idea applied to the example FGV from GregFreeman.

 

Can someone give me a feedback on this solution ?

Thanks

 

IncrementFg.png

Yohann L.
0 Kudos
Message 13 of 16
(363 Views)

Hi yledieu,

 

I've done some research on this and found a link that should be relevant to what is going on for you. I found this link that seems like it will be helpful, but let me know if it doesn't resolve your issue.

 

It basically talks about how you go about opening the VI references, and how to send two codes for Open templates for editing and Prepare for reentrant run.

 

Thanks!

Timothy D.
Applications Engineering
National Instruments
0 Kudos
Message 14 of 16
(337 Views)

Hi Timothy,

 

I saw this KB article but it doesn't solve the problem because it opens all the vit files in edit mode, so it doesn't create several instances of the FGV.

 

Thanks for your help

Yohann L.
0 Kudos
Message 15 of 16
(321 Views)

We have used the variant attributes in AEs with great success. Generally we prefer to use classes but we have some cases where we do not really pass wires for some items and they make use of a FG which stores each instance of the relevant data in a variant attribute list. The caller simply passes in their ID and are provided with their data. The concept would work in an AE equally as well. 



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 16 of 16
(308 Views)