LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to tell if top level vi is loaded from a project?

Solved!
Go to solution

Hmm... I'm seeing something different than that on 2017. I can't get the string "Main Application Instance" no matter what I put where or what's open. I either get the the name of the last project I clicked on if one or more projects is open, or Not a Refnum and therefore error 1055 if no project is open.

 

Redhawk
Test Engineer at Moog Inc.

Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.

0 Kudos
Message 11 of 13
(359 Views)

wiebe@CARYA wrote:

How about this (even simpler):

 

In Project 2.png


That is what I was about to suggest, I think this will work for the OP.

 

EDIT: Clear the error coming out of the property node or you get this:

Spoiler
FireFist-Redhawk_0-1599222735629.png

 

Redhawk
Test Engineer at Moog Inc.

Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.

Message 12 of 13
(358 Views)

Thanks for the help!

 

I marked Wiebe's post as the solution, but I will will give Redhawk an honorable mention for clearing the error.

 

I was able to use the snippet to get the code.  But it took a few minutes to figure out that the scripting property nodes are inside the regular property nodes so I could recreate it myself.   I thought all the scripting functions would all be in the VI Scripting palette.

 

Thanks again.

0 Kudos
Message 13 of 13
(333 Views)