12-09-2009 10:48 AM
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!
12-09-2009 11:15 AM
You can search for globals. I'm using version 8.6
12-09-2009 12:46 PM
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.
12-10-2009 02:05 AM
I´ve tried, but still nothing returns!
In the snapshoot, I want to find the other "LINsend" in all the SubVIs.
12-10-2009 02:34 AM
Or maybe it is just a share variable, but still cann´t find it.
12-10-2009 02:58 AM
12-10-2009 09:41 AM
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.
12-10-2009 09:55 AM
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
but your search scope in this image
should be set for "all VIs in memory".
Ben
12-11-2009 03:13 AM
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"?
12-11-2009 08:09 AM
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