05-09-2013 03:13 PM
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!
I Said "spawn One VIT (FGV) that holds references to your "MyData" class instances"
05-09-2013 04:03 PM
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).
10-30-2017 04:20 AM - edited 10-30-2017 04:24 AM
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
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 ?
10-31-2017 09:27 AM
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.
10-31-2017 11:29 AM
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
10-31-2017 03:33 PM
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.