Troubles using while loops and case loops 
Author Message
 Troubles using while loops and case loops

Hi, i have accounted a lot of problems using labview 6.02 with field
point. My main problem was that originally i had trouble running two
while loops at once and been able to control them independently e.g.
start and stop each loop when i want, but i have also come up with a
separate problem. when using case loops with while loops, i can not
seem to to get them to work properly. Like say if i have a program
with while loops and i want to switch something on and off using a
case loop its not possible. An example of this are below, any help
greatly appreciated.

Thanks Stuart



Mon, 14 Feb 2005 20:50:57 GMT  
 Troubles using while loops and case loops
Sorry could not stop this one being posted, the example is on the
second one.

Stu



Mon, 14 Feb 2005 20:53:22 GMT  
 Troubles using while loops and case loops
Stu,

I looked at your example - couldn't run it, since I don't have the
Field Point VI's, but I an observation. In your main VI, you have two
parallel while loops that run independently, and the case structure is
outside both of them - this will only be evaluated once - you need a
way to poll the case, maybe in its own loop. Hope this helps.



Mon, 14 Feb 2005 21:28:28 GMT  
 Troubles using while loops and case loops
Thanks for the comments. What i mean about running independently is
that, i can start one loop then 5 mins later start the second loop and
stop the second loop and restart it if need be and for some reason
that is not possible as for th case loop i have tried putting a while
loop around it. So that it will run, and so i can select different
vi's, but for some unknown reason it does not work and i have talked
to an application engineer from NI and they even say it should work.
So i'm waiting for the application engineer to solve the problem. But
thanks for your comments any way.

Stuart



Mon, 14 Feb 2005 23:23:28 GMT  
 Troubles using while loops and case loops
Hi Kim, thanks but already tried this and got talking to an NI
application engineer and they suggested this. And they also said this
should work. So i'm going to let the application engineer have a look
and if it works with him. Its then got to be a hardware or software
problem.

Anyway thanks



Mon, 14 Feb 2005 23:46:59 GMT  
 Troubles using while loops and case loops

Quote:
> Thanks for the comments. What i mean about running independently is
> that, i can start one loop then 5 mins later start the second loop and
> stop the second loop and restart it if need be and for some reason
> that is not possible ...

I haven't looked at your VI, but from the other description, I think
that it is clear what is going on.

Any given diagram in LV will execute all nodes on it exactly once before
it can be scheduled to run again.  In this case, the loops will not
begin running again until the case finishes and begins running again.

To resolve this, do not let the while loop stop until you really want
the case to exit.  In otherwords, the contents of the loop can be made
conditional and can execute in the TRUE, but simply wait ms in the FALSE
case.

Greg McKaskle



Tue, 15 Feb 2005 08:19:27 GMT  
 Troubles using while loops and case loops
Thanks, this has been the main cause of my trouble and have solved it
now. But from now on, i think i will stick to using DAQ than field
point as is more flexible and u do not have to use loops to use it in
this particular task.

Thanks Stu



Sat, 19 Feb 2005 17:09:52 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. using while loops within while loops?

2. GNU Common Lisp (trouble using loop construct)

3. break one loop and skip one iteration of outer loop

4. 2 files: a loop within a loop??

5. Problem with loop inside other loop

6. Impelement for loop and do while loop

7. Fast loop inside a slow loop?

8. For Loop looping only once

9. nested while loops, inside loop not stopping correctly

10. For loop, possible to increment counter/exit loop?

11. changing the value of loop-control variable in loop

12. Loop variable value after loop finish

 

 
Powered by phpBB® Forum Software