I need several clones of a VI that store different state informations. I considered passing data to and from these clones by the 'Call By Reference Node', and therefore used strictly typed references to call the clones. My problem is that each time the calling VI turns idle the references turn invalid. How can I access a particular clone to read out its state information in such a situation?
Thank you, Uli
[...] My problem is that each time the calling VI turns idle the references turn invalid. [...]
Thank you, Uli
i am not sure what the quoted sentence means. Could you please post an examples to illustrate that?
...sorry, I would like to provide my code here, but somehow NI doesn't let me. The two VIs have 8 and 12 kB, respectively, so I guess they're not too large. Maybe you get along with the JPEG, but if you know any prerequisites for attaching *.vi files, please let me know...
Sorry for the inconvenience, Uli
First of all i think Labview will delete all opened references if the main vi finishes. Although i am not sure. Keep your main vi running, going idle and not finished.
If you need a previous reference then you need to build an array of references, which will be stored at the shift register.
Your shift register only keeps one.
For clone VIs all you need to know to access them is their name. The names will be in the form of the base VI name followed by a number. Wire a string containing the clone's name (no path is needed because the clone only exists in memory) to the Open VI Reference function. The output is a reference to the clone that you can use as you see fit...
If you wire a type specifier VI Refnum into the top of the open function, you will get a strictly typed VI reference that you can use with Call by Reference.
Thank you everybody for so much expert support!
This was my first appearance in this forum, and it was a good experience.
Ravens Fan, thank you for the wrong browser advice. Obviously Mozilla does a better Job here.
Mike, I added another VI named '1_CallCloneByNameString.vi' to show that the clone name seems to be simply ignored (so, if you say 'open any.vi:1' it creates any.vi:2 or higher...)
I think the only way out is to keep the VI from finishing, as Pnt suggested.
It's just weird that when all VIs have finished the front panel of a clone might still be visible, but there's no way of accessing the data of its controls anymore...
It's just weird that when all VIs have finished the front panel of a clone might still be visible,
It is not weird. You open the front panel but you are not closing it. It is logical.
One way is to use an invoke node "Front panel close"