LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
TCPlomp

One reentrant instance per parent-VI

Status: Declined

Any idea that has received less than 3 kudos within 3 years after posting will be automatically declined.

It would be nice if it was possible to add another 'Reentrant' setting.

This setting would make sure VI A always uses a specific instance, where VI B uses another instance. Sort of a single parent sub-vi.

This would allow for look-up VIs that have a seperate set of data per VI that is calling them.

 

So you can store some variables that are only valid in a single VI and if another VI is calling the same VI it will be calling a second instance and gets other variables back.

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
6 Comments
JackDunaway
Trusted Enthusiast

Would you provide a use case for where this would be handy? I understand the idea, but I can't readily think of a way I would apply this.

 

The idea here is that the re-entrant SubVI would maintain the same memory space for every instance in the parent VI. My current solution is to just keep that state data resident in the parent, not resident in the SubVI. It seems to make more sense to keep that data resident in the parent, and not the SubVI...

TCPlomp
Trusted Enthusiast

I have a VI that operates reads the tags for decorations in it's parent VI.

The listing of all elements in the owning VI can take quite a while for a complex VI.

So I used a First Call?  primitive and stored the data after the first run in a shift register.

This would work good if the VI is only called inside a single VI.

 

So I added a VI-name based look-up table to the VI.

However there are some little caveats:

 

First Call? doesn't work good because the VI can be called from several VIs.

I cannot detect if an owning VI is stopped and restarted in between runs (and the tags might have changed).

 

This could all be fixed by using a VI that creates a new instance per owning VI.

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
JackDunaway
Trusted Enthusiast

Your application sounds similar to the initialization and static reads/writes in the CVT reference architecture. Would it suffice to have a 2D CVT, where the first indexing input is the VI, and the second indexing input is the name? That way, the one SubVI's memory space would service all the parent VI's.

 

Since you're talking about decorations on a front panel, I'm assuming your use case was HMI only. Can you provide a use-case for an RT system?

TCPlomp
Trusted Enthusiast

Well this specific VI is a tool for the LabVIEW IDE and it worries me that parts of the owning VI can change when the VI is not running (in edit mode), I cannot detect that a callig VI is in edit mode.

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
TCPlomp
Trusted Enthusiast

Here's a better explanation of the idea.

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Darren
Proven Zealot
Status changed to: Declined

Any idea that has received less than 3 kudos within 3 years after posting will be automatically declined.