harsh_electro Posted August 24, 2005 Report Share Posted August 24, 2005 Hi Freinds, I want to acess the data of one Vi (which is local to that loop) in the other loop ,How can i do this ? My both Vis are running in parellal. Harsh Quote Link to comment
Yair Posted August 25, 2005 Report Share Posted August 25, 2005 The easiest way is to use a global. Drop a global from the structures palette on the diagram and double click it to open a Globals VI. All controls in these VIs can be accessed through the globals. Create the control you need, wire the data into it in one loop and copy the global to the other VI and read it there. You should note that using globals can be dangerous if not used properly, because you can easily get race conditions. Another global option you can look for is LV2 style globals, which are somewhat safer in the race conditions department. You should look up some LV tutorials which explain these things. Quote Link to comment
EVS Posted August 28, 2005 Report Share Posted August 28, 2005 Hi Freinds,I want to acess the data of one Vi (which is local to that loop) in the other loop ,How can i do this ? My both Vis are running in parellal. Harsh 5826[/snapback] Make your choice: 1. Function global 2. Queue 3. Control reference 4. Local variable 5. Global variable Quote Link to comment
DredPirate Posted October 18, 2005 Report Share Posted October 18, 2005 Globals = BAD code in LV Use LV2 style! Do not get into the practice of using globals. There is no need for them. You'll hate yourself when you have to debug your own code. Check out this simple example of an LV2 style global. Launch Master then notice how slave will close when master closes. And master will not close with slave. Basically an LV2 style global is nothing but an uninitialized shift register. If you need more info just search around. There is alot of info on this style of global throughout the web and even on NIs site. Download File:post-3219-1129607862.zip Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.