LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Stopping a Case Sequence

I have a question that I hope someone can help me with.

I currently have this WHILE loop that has a counter in it. The counter will
count from
100 to 0 and when it reaches 0, it will assert a FALSE to indicate that the
100 seconds is
up. With that in mind, I use it to pause my other WHILE loops using a LOCAL
VARIABLE
for 20 seconds.

My problem lies here:
There is a CASE sequence inside the WHILE loop. It will not stop until all
the sequences
have completed. How can I stop a CASE sequence or is there a work-around
solution?

Can anyone offer any suggestions? I would like to post my VI up here so you

can look at it but it's made up of many other sub VIs and the machine is

not networked.

Thanks.
0 Kudos
Message 1 of 3
(2,785 Views)
Shan Pin Koh wrote:

> I have a question that I hope someone can help me with.
>
> I currently have this WHILE loop that has a counter in it. The counter will
> count from
> 100 to 0 and when it reaches 0, it will assert a FALSE to indicate that the
> 100 seconds is
> up. With that in mind, I use it to pause my other WHILE loops using a LOCAL
> VARIABLE
> for 20 seconds.
>
> My problem lies here:
> There is a CASE sequence inside the WHILE loop. It will not stop until all
> the sequences
> have completed. How can I stop a CASE sequence or is there a work-around
> solution?
>
> Can anyone offer any suggestions? I would like to post my VI up here so you
>
> can look at it but it's made up of many other sub VIs and the machine is
>
> not networked.
>
> Thanks.

I think you're confusing things here - there are CASE structures and there are
SEQUENCE structures in LabVIEW. They are very different.

There is no way to stop a Sequence from sequentially stepping through its
entire set of frames. However, a way to get it to do nothing for subsequent
frames (and execute/terminate rapidly) is to put a (boolean) Case structure in
each frame of the Sequence. One frame (case) is "do nothing"; the other
contains the code to be executed in the normal operation. An "upstream" frame
can write to a Sequence Local to control the action downstream. This, however,
is a rather inelegant way to set up what you are trying to do, and becomes
unworkable with more than a few frames.
A much, much better approach is to set up a "state machine," which can be
implemented in LabVIEW using a Case structure inside a while loop; the case
structure can jump to any case when the loop iterates. It's a little too
complicated to explain here. There is an example in NI's Example Programs
Database, search for "state machine," which will return a couple of examples.
The resulting link for a good one ("Pause/Resume & State Machine") is:

http://digital.ni.com/explprog.nsf/2222373937d4e9a38625666a00831a24/f345cd727b37f2f486256568007cfe07?OpenDocument

Good luck and happy wiring,

Rod
--
Roderic Don
Research Associate II
University of Delaware
Center for Composite Materials
302-831-8701
302-831-8525 (FAX)
0 Kudos
Message 2 of 3
(2,785 Views)
In article <38c41370@newsgroups.ni.com>, Shan Pin Koh wrote:

>100 to 0 and when it reaches 0, it will assert a FALSE to indicate that the

>There is a CASE sequence inside the WHILE loop. It will not stop until all
>the sequences
>have completed. How can I stop a CASE sequence or is there a work-around


Can you just send the same FALSE signal to the case node (and use an OR if
you need to)?

Harry

--
0 Kudos
Message 3 of 3
(2,785 Views)