09-23-2008 05:41 PM
09-23-2008 10:45 PM
munkifisht wrote:
Could someone please explain how the value can be updated in each loop of the sub VI ?
To make this happen, you have to pass the reference to the DAQ signal (say, it is a waveform graph) from the MainVI into the SubVI. passing the variable as such will not make it get updated in the MainVI after each run of the loop in the SubVI.
09-23-2008 11:03 PM
Hello.. 🙂
According to me global variables will be better potion to solve your problem... You need to take values in global variables and read them in your sub VIs...
1. Go to block diagram - right click to get function palette - then got to all functions - structures - select global - put it in your VI - then double click on the global - then a front panel will open.
2. Take the variables you need save the file.
3. Then copy the same global variable fro the block diagram and paste it in the sub VI where you want. Left click on the global variable and you will be able to select the one of the variables you created in the global front panel.
4. Whenever you want to use these global variables just copy the variable from the VI and paste it another VI where you want to use it..
I hope this will help you.. 🙂 Best luck.. 🙂
09-23-2008 11:32 PM - edited 09-23-2008 11:33 PM
Hi munkfisht,
It would help if you were to attach your Main VI - or a screen-shot of the diagram. At this point it's not clear whether you have one, or multiple processes in your main VI. It sounds like there should be a couple of parallel loops (AKA "threads" ) running, and to pass data between them a Global can work, though, a Queue or Notifier is probably a "better" choice.
Rupali answered where to find the Global, though
If you find yourself puzzling over how to know when new data has arrived, or become worried about new data getting over-written by accident, these potential problems dissappear when using a Queue!
Cheers!