LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
0 Kudos
wiebe@CARYA

Allow dynamically running of an already running VI

Status: Declined

Any idea that has not received any kudos within a year after posting will be automatically declined.

I've always wondered why this is not possible.

 

So you can dynamically start a VI. Except when it's not already "running". I quoted running, but the VI itself is not running, it's just on the diagram of a running VI.

 

To start a VI dynamically, when already "running" we need to make it re-entrant. This is very limiting (see use case in following post).

 

Technically, there should not be a problem. You can create a new VI, put the sub VI on the diagram and run it.

 

Why can't we do this by reference???

16 Comments
wiebe@CARYA
Knight of NI

"spin up a new copy".

 

I know about templates, saving copies, etc. This is exactly what don't want.

 

It just is silly that I can make a new VI with sub VI and run it, but I can't do that by reference (unless I know the strict type).

 

This is all I'm asking for:

This is all I want.png

 

 

wiebe@CARYA
Knight of NI

Let me start to comment this: "it just ain't ever likely to happen".

 

It's one of the few thinks I agree with (the VI server things aside). The thread is spoiled.

 

AH. The "Run VI" method is a completely different beast than the "Call By Reference". That I can explain.

 

I'm pretty sure I already understand.

 

Any given VI is set up to either run as a top-level VI or as a subVI. Remember that the top-level VI has a lot of work to do that other VIs do not -- locking other VIs so they cannot be edited, remembering refnums to automatically deallocate on idle, manages abort behaviors differently, and other tasks behind the scenes. Something that is running top-level cannot be called as a subVI. This is a fundamental restriction of how LV is architected and won't be changing -- won't even be changing in the NXG platform.

 

Yes. I know. Not the problem.

 

The "Run VI" method starts a VI running as a top-level VI. It's an independent entity, separate from its caller. The Call By Reference node runs the VI as a subVI. Thus a VI that is reserved for use as a subVI can be called by CBR but cannot do the "Run VI" method.
 
A nice summary of the problem. Now for a solution...

 

We can dynamically start a Top Level VI. Or call a subVI with CBR but we need to know the strict type. Nothing in between.

 

I want to dynamically set inputs\get outputs and then run the VI (subVI or Top Level VI).

 

The Asynchronous Call By Reference has two modes: "call and forget" and "call and wait". The first runs as a top-level VI... the second runs as a subVI.
 
You asked for an option on VI Server to "open a new instance (not a clone)".

 

Please dismiss "open a new instance (not a clone)". It is confusing.

 

You mean like "new from .vit" instance? You can do that. Just name all your VIs with the ".vit" file extension. Every time you call Open VI Reference, you'll get a new, independent VI unless you wire in the 0x2 flag (the one that says don't instantiate templates).

 

I just want to call a VI as a subVI (like new VI drop it, wire ctrls\indicators, run it), but by reference! A copy\template instance\close is totally useless.

 

If you want us to go further with that and allow a more general "duplicate this VI on open even though it is not a .vit", we could do that, but I severely doubt that we ever would -- your use case is pretty exotic. I'm not saying its invalid, just that I cannot imagine it ever getting to the top of a priority queue of feature requests.

 

I feel that most seasoned developers got used to this not being possible, and came to except it 15 years ago. I just recently found out again how annoying this is.

 

I'm inclined to Decline the idea as "it just ain't ever likely to happen," but I'll leave it open and let the kudos surprise me. The automatic closing of ideas (if more years elapse than kudos count) will, I suspect, close this one eventually.

 

Do you mind if I post the Run As SubVI as a new idea thread? Like I said, this one is spoiled, mostly by my own bad explanation (although your replies don't help either). I think we're not on the same page.

 

Another workaround: For VIs that are not members of libraries, You could programmatically call "File >> Save As" and duplicate the VI and then call the Run VI method on the duplicate.

 

A copy is not what I want. The user selects a menu item, and event is triggered. Now I want to automate that. So I need to send that event. In the development environment but also in an executable. So I need to make a VI that has only one sub VI, only because I can't call the subVI directly (dynamically).

 

Or literally just copy the file on disk to a new file name... [removed some text]

It wouldn't work at all. Not a solution to the problem.

PS: I called your use case exotic. I figure I should explain. Your architecture may very well work for you. I am not saying you should abandon it.

 

It isn't. Please do. It does. I won't (there is no better alternative anyway).

 

I did write a counter-rambling on my architecture and programming style. I decided to remove it since it seemed counter productive (, with all the frustration shining through). It's also OT. I'll show you my architecture one day, and I think you'll have to agree that at least it is not small (it's quite large in fact).

 

I hope that the one thing you get from this is that *I do not want a copy*!

 

I want to dynamically run a sub VI (but not with CBR, and for non-re-entrant VI's)!

AristosQueue (NI)
NI Employee (retired)

>  I hope that the one thing you get from this is that *I do not want a copy*!

 

Ah. That was unclear.

Your picture makes things clearer.

Yes, post that as a new idea... I think that will help.

wiebe@CARYA
Knight of NI

>Ah. That was unclear.

>Your picture makes things clearer.

>Yes, post that as a new idea... I think that will help.

That was unexpected. I'll do that.

 

Can you make this one "Completed" or "Declined" or something?

Darren
Proven Zealot
Status changed to: Declined

Any idea that has not received any kudos within a year after posting will be automatically declined.

wiebe@CARYA
Knight of NI

btw. posted a new idea here (a long time ago):

Run-As-SubVI-method