LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I get a strictly typed VI reference of a particular clone that is idle?

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 

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

ulricius wrote:

[...] My problem is that each time the calling VI turns idle the references turn invalid. [...]

 

Thank you, Uli 


Uli,

 

i am not sure what the quoted sentence means. Could you please post an examples to illustrate that?

 

Norbert 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 9
(3,901 Views)
Hi Norbert,
 
I added an example where the VI 'CallCloneByStrictTypeRef.vi' opens a strict type reference to the reentrant VI 'StateOfClone.vi' and subsequently opens the front panel of the created clone. The 'Open VI Reference' node should be called only if the reference returned by the shift register is invalid. Otherwise, the reference of the previous iteration should be used when attempting to open the clone front panel.
 
LabVIEW creates a new clone with each iteration. The reference of the previous iteration is always invalid, as the VI stops after execution of the while loop. Is it possible to obtain a valid strict type reference in such a scenario?
 
Uli

P.S.: Since I keep getting an error message each time I post my reply I will first try to add an image of the code only... 
0 Kudos
Message 3 of 9
(3,871 Views)

...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

0 Kudos
Message 4 of 9
(3,864 Views)
Are you using Safari or Chrome browsers?  If so, don't.  They have problems file attachments with two letter extensions.  See here.  http://forums.ni.com/ni/board/message?board.id=130&view=by_date_ascending&message.id=5216
0 Kudos
Message 5 of 9
(3,849 Views)

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.

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

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.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 7 of 9
(3,825 Views)

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...

 

Uli

0 Kudos
Message 8 of 9
(3,779 Views)

ulricius wrote:

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"

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