From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW APIs Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Scripting : How to get for a VI instance its own SubVI Refnum

Solved!
Go to solution

Emmanuel: I've been working toward a solution for a long time. If you've succeeded with an Express VI, I would definitely like to see your code (and then copy it and reuse it in many places). Is it something you can share at all?

0 Kudos
Message 21 of 31
(4,420 Views)

Yes, for sure. It would be great if it could be reused !

So what I needed and what I propose to you is a VI Express that returns its own subVI refnum. But in deed, it's so easy to do with VI express...Where would you like me to put it ?

Also, do you see any drawbacks in terms of speed or memory using VI Express technology ?

For that purpose a VI express is a big machinary ... but can't see another solution.

0 Kudos
Message 22 of 31
(4,420 Views)

This work because the created VI is an INSTANCE VI. Id est : a simple copy of original VI, but thanks to Express VI mechanisms, you don't have to manage the VI copying and renaming and so on...

 

AFAK, Actually creating an instance VI (so just a copy) can only be done transparently through VI express mechanism. Am I wrong ?

There's a property of VI called "Is Instance", this one can be written,... so I tried... but it returns an error : not implemented in this version of LabVIEW....

0 Kudos
Message 23 of 31
(4,420 Views)

An instance VI is one which is totally embedded in its parent VI (no external file) and linked to a particular instance (subVI).  Since it is specifically tied to a particular instance, you can get its subVI reference - there is only one.  You can programmatically create instance VIs, but the methods are not public, since they are generic, pertain to a lot of other things, and require knowledge of the internals of LabVIEW to use properly.  Instance VIs were created for Express VIs, and that is about their only current use.

Message 24 of 31
(4,420 Views)

I understood the things like that... and even if I could access those method and property, I suppose that the creation of Isntance VI would not be automatic but done each time you drop the VI, right ? this might explain the tiem overhead when you drop an express VI. So there's a kind of deamon taht looks if an express VI is dropped and then do the job... right ?

Also, I'd like to not have the option "open front panel" on express VI...  is should be quite easy no ? possible ?

Or better catching the event (open foront panel) and do what I want in a call back VI... ok, I'm just dreaming...

0 Kudos
Message 25 of 31
(4,420 Views)

Emmanuel GEVEAUX wrote:

Also, I'd like to not have the option "open front panel" on express VI...  is should be quite easy no ? possible ?

I've never built an Express VI, so I have no idea if it is possible. If it is possible, I wouldn't expect easy -- they were designed explicitly to be VIs with configuration panels to enable custom scripting based on user input into dialogs. If there is a way to circumvent it, I wouldn't expect it to be obvious.

0 Kudos
Message 26 of 31
(4,420 Views)

When an Express VI is dropped, it has a piece of information attached to it telling the LabVIEW development environment that it is an Express VI and where to look for the configuration panel, which is then loaded and run.  The original VI must also be added as an instance VI into the VI it is dropped into.  Both of these take some amount of time.

As of LabVIEW 2012 (if I remember correctly), there is a mechanism to prevent opening the front panel of Express VIs (right click, select open front panel does not work - configuration will still work).  Unfortunately, it also uses private methods.

0 Kudos
Message 27 of 31
(4,420 Views)

I think that path were you put the following code could be important.
under user.lib/tecatlant

because of paths stored under tags of VIs.
Am I right DFGray ?

Also when speaking about private methods, are they those that I can access through a certain super private property under LabVIEW.ini ?

0 Kudos
Message 28 of 31
(4,420 Views)

Your zip file seems to be password protected, so I can't say.  However, the location of the source code for an Express VI does matter, since the location of the configuration dialog is statically stored on the VI.  The code has to be where it says it is or it will not work.

As an NI employee I unfortunately cannot comment on how to access private methods.

0 Kudos
Message 29 of 31
(4,420 Views)

DFGray: He password protected it and supplied me the password privately. It may take me a couple months before I have time to open it up, but if I find something I can generally extract, I'll let folks know.

0 Kudos
Message 30 of 31
(4,420 Views)