LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to determine if a vi is running in a subpanel?


@_carl wrote:

wiebe@CARYA wrote:

@_carl wrote:

It's a bit hacky, but an alternative would be to write "Front Panel Window" -> "Behavior" to its current value and check for an error.  This property is read-only if it's running as a subpanel.

 

_carl_0-1608742067014.png

 


VI.Front Panel.Native Window is 0 if it's in a subpanel or closed.

VI.Front Panel.Window Interface is 0 if it's closed.

 

That logic can be used to determine if the VI is in a subpanel.

 

So much easier that a property node!


Sure, except "Native Window" is not natively available (so not really easier). Previous comments in this thread indicate that one of a dozen or so keys need to be added to the LabVIEW.ini to make it available (but without an indication of which one it is).


I keep practically everything turned on, so it's pretty easy for me.  But I prefer to avoid brown if possible. Attached code has both versions.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 21 of 32
(1,759 Views)

@_carl wrote:

wiebe@CARYA wrote:

@_carl wrote:

It's a bit hacky, but an alternative would be to write "Front Panel Window" -> "Behavior" to its current value and check for an error.  This property is read-only if it's running as a subpanel.

 

_carl_0-1608742067014.png

 


VI.Front Panel.Native Window is 0 if it's in a subpanel or closed.

VI.Front Panel.Window Interface is 0 if it's closed.

 

That logic can be used to determine if the VI is in a subpanel.

 

So much easier that a property node!


Sure, except "Native Window" is not natively available (so not really easier). Previous comments in this thread indicate that one of a dozen or so keys need to be added to the LabVIEW.ini to make it available (but without an indication of which one it is).


If I had to live with what 'native' LabVIEW is giving me, I'd stopped doing LabVIEW 15 years ago...

 

Brown nodes are really just the tip of the hacking iceberg. If I draw the line there, there'd be no fun left.

Message 22 of 32
(1,739 Views)

@_carl wrote:

wiebe@CARYA wrote:

@_carl wrote:

It's a bit hacky, but an alternative would be to write "Front Panel Window" -> "Behavior" to its current value and check for an error.  This property is read-only if it's running as a subpanel.

 

_carl_0-1608742067014.png

 


VI.Front Panel.Native Window is 0 if it's in a subpanel or closed.

VI.Front Panel.Window Interface is 0 if it's closed.

 

That logic can be used to determine if the VI is in a subpanel.

 

So much easier that a property node!


Sure, except "Native Window" is not natively available (so not really easier). Previous comments in this thread indicate that one of a dozen or so keys need to be added to the LabVIEW.ini to make it available (but without an indication of which one it is).


Also, IIRC, Quick Drop CTRL+SHIFT+B does work, even with all that scripting stuff turned off.

 

On a property node, QD, type "VI", CTRL+B. This turns it into a VI property node.

 

Then QD, type "FP.NativeWindow", SHIFT+CTRL+B, to set the property.

Message 23 of 32
(1,738 Views)

I strongly recommend removing GenericsAreGo=True from your INI file. If you accidentally select the "Generic" item it adds from a control's context menu, you could seriously break something. Generic controls are a buggy, abandoned, vestigial prototype of what eventually became Malleable VI's, and are probably completely untested in modern versions of LabVIEW. If you accidentally made some subVI a generic VI, I could easily imagine it breaking an entire project.

0 Kudos
Message 24 of 32
(1,603 Views)

@flarn2006 wrote:

I strongly recommend removing GenericsAreGo=True from your INI file. 


Also, this key has nothing to do with private scripting properties and methods.

0 Kudos
Message 25 of 32
(1,586 Views)

Previous comments in this thread indicate that one of a dozen or so keys need to be added to the LabVIEW.ini to make it available (but without an indication of which one it is).

I'm super late to this thread, but I thought I would mention that I believe the one key that is needed is is SuperSecretPrivateSpecialStuff=True

0 Kudos
Message 26 of 32
(1,347 Views)

@!SuperB! wrote:

Previous comments in this thread indicate that one of a dozen or so keys need to be added to the LabVIEW.ini to make it available (but without an indication of which one it is).

I'm super late to this thread, but I thought I would mention that I believe the one key that is needed is is SuperSecretPrivateSpecialStuff=True


"Need" is a bit strong.

 

Why do you need it?

 

QD will give you the properties, even if they don't show. As described previously.

 

SuperSecretPrivateSpecialStuff will give you lots of extra properties and methods. Mostly lots of extra noise though. Suit yourself, just be aware of the downside.

Message 27 of 32
(1,330 Views)

wiebe@CARYA wrote:

Also, IIRC, Quick Drop CTRL+SHIFT+B does work, even with all that scripting stuff turned off.

 

On a property node, QD, type "VI", CTRL+B. This turns it into a VI property node.

 

Then QD, type "FP.NativeWindow", SHIFT+CTRL+B, to set the property.


Neat! I didn't know that! I just r-click the property node and Select class -> Vi server ...

 

The ability to set the  property is cool, but since you already need to know the names and such i'd put that in the "niche category".

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 28 of 32
(1,326 Views)

wiebe@CARYA wrote:

@!SuperB! wrote:

Previous comments in this thread indicate that one of a dozen or so keys need to be added to the LabVIEW.ini to make it available (but without an indication of which one it is).

I'm super late to this thread, but I thought I would mention that I believe the one key that is needed is is SuperSecretPrivateSpecialStuff=True


"Need" is a bit strong.

 

Why do you need it?

 

QD will give you the properties, even if they don't show. As described previously.


Oooh! That is wild! I clearly didn't read the rest of this thread. Thanks for sharing that arcane tip 🙂

0 Kudos
Message 29 of 32
(1,297 Views)

wiebe@CARYA wrote:


 

In normal programming, I always provide a subpanel to a sub VI, so the sub VI can insert\remove itself. This is (or used to be) the only reliable way to make LabVIEW not crash when recursively inserting clones in subpanels. Closing a clone with a subpanel with a clone in it used to be very unreliable. Perhaps it still is.

I know this is an old thread- but could you expound on this? I have an issue with bizarre RTE crashes, and am using nested subpanels (3 deep, IIRC). My crashes seem to happen around the same time I'm loading and unloading new VI's (AF Actors, so dynamic dispatch clones) into subpanels, so it's either loading a VI, unloading it, or something to do with the subpanel.

0 Kudos
Message 30 of 32
(968 Views)