LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Search for Global variable

Hello,

 

I wanna search for all the global variables from sombody else`s legacy code. I have used the Find function. But it turns out that it doesn´t support the Global Variable searching.

How can I find out all the Global Variables in the Project (not only in the main but in the SubVIs)? 

(See attachment) 

 

Thanks!

 

Search_for_Global.JPG 

0 Kudos
Message 1 of 10
(6,316 Views)

You can search for globals.  I'm using version 8.6

 

global.PNG

>

"There is a God shaped vacuum in the heart of every man which cannot be filled by any created thing, but only by God, the Creator, made known through Jesus." - Blaise Pascal
Message 2 of 10
(6,309 Views)

wilburwu wrote:

Hello,

 

I wanna search for all the global variables from sombody else`s legacy code. I have used the Find function. But it turns out that it doesn´t support the Global Variable searching.


It does support it. If you have no global variables loaded into memory then the option is disabled. Just open the top-level VI so all VIs get loaded into memory.

0 Kudos
Message 3 of 10
(6,295 Views)

I´ve tried, but still nothing returns!

In the snapshoot, I want to find the other "LINsend" in all the SubVIs.

Find_Global.JPG 

0 Kudos
Message 4 of 10
(6,277 Views)

Or maybe it is just a share variable, but still cann´t find it.

 

Find_Global.JPG 

0 Kudos
Message 5 of 10
(6,270 Views)

Hi,

 

if it is a "real" global: right-click the global and Find->global references...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 10
(6,264 Views)

That is not a global variable - that is a shared variable. I'm not sure what you're doing that's causing that. Are you sure you have VIs loaded into memory that are actually using those shared variables? As you can see from the attached project, if you have either "Untitled 1" or "Untitled 2" open and you search for shared variables, then it will find whatever is loaded into memory. If you open "Untitled 3" and search for shared variables, then it will find nothing since no VI is loaded into memory that uses a shared variable.

 

Note that you cannot search for a specific shared variable with the standard Find tool.  I think someone had posted a tool a while back that would allow you to search for a specific shared variable, but I'm not sure. Do a search for "find shared variable" and you should find the thread. 

Message 7 of 10
(6,240 Views)

For a shared variable you want to go to the strcutures palette and choose the shared variable node as you have selected in this serach

 

Find_Global.JPG

 

but your search scope in this image

 

Find_Global.JPG

 

should be set for "all VIs in memory".

 

Ben

 

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 8 of 10
(6,232 Views)

I´ve run the software once again and all the shared variable can be found.

 

But the problem is, whether I can search for a specified variable, say with the name "Linsend"?

0 Kudos
Message 9 of 10
(6,201 Views)

Follow the advice of serach this forum.

 

There was a post where someone from NI posted some code that was able to search for a specifi shared variable.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 10 of 10
(6,187 Views)