From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
07-30-2007 08:32 AM
07-30-2007 10:08 AM
Suggesting a solution might be easier if you attached the vi you are working on...
You can right click on the side of your while loop and add a 'shift register'. It places a node on each side of the while loop, the right side to store newly acquired data in, the left side to retrieve the previous iterations data (or the initialized value for the first iteration).
If you want to detect a change in data and use that result to stop another while loop you can use a 'local variable' in the second loop to read the data written to an indicator inside the first loop.
There are probably are number of ways to achieve the functionality you desire without using local variables but without more information on the way your vi functions it is hard to guess at a solution. (Many in this forum recommend avoiding the use of local variables for a number of reasons including performance.)
08-08-2007 07:19 AM
Hi Troy,
THank you so much for your immediate reply. THat day I tried attaching my VI but unfortunately it was not attached. I am attaching the vi here. You see the first while loop from which I generate the the value to stop the 2nd while loop(top). Could you please help me out how to solve this problem.
08-08-2007 07:51 AM
I don't think this vi is working the way you want it to. You have three while loops. The problem is that the second two loops can not start until the one before it finishes (due to data flow).
I think you need to have everything in one loop to get the functionality you are aiming for (there are other ways to do it but we will keep it simple for now). Then, each time the loop cycles, you take a reading, compare it to the previous measurement (for your change detection) and send out data to your serial device accordingly.
08-08-2007 08:10 AM
Hi Troy,
I tried putting all the while loop in one while loop (meaning 3 while loops inside one while loop) and tried. Even then I couldnt see the vi working correctly as the way I want. Do you mean puttin all in only one VI? COuld you please suggest a way? I am really novice and I want to do this correctly.
Best Regards,
Maya
08-08-2007 08:50 AM
Hi Troy,
I even tried putting all the control in one while loop and tried. But the temperary value fromtop section is not stored by the adder with feedback to stop the while loop compleately. The temperary value appears for few seconds and this should be used to stop the whole process.
Am i making any mistakes here? how do i do it ? waiting for your responce.
Maya.
08-08-2007 09:08 AM
08-08-2007 10:17 AM
08-15-2007 09:20 AM