LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to clear a shift register?

I have a for loop with i=1 with a single shift register (and internal
add operator). The internals of the for loop are wired and encased in a
case structure such that when the case input is true, the input to the
case structure is added to a running total of the input values and then
output. This works well, however I need to at times clear the output of
the shift register while the VI is running. What would be a good way to
do this? Thank you.
0 Kudos
Message 1 of 6
(5,612 Views)
JeffC,

If I followed your request correctly, I think you could do what you want by adding a case to your case structure. Rather than using a boolean connected to the selector terminal, use an enum with at least three items: Clear, Add, Idle. See the many postings on Action Engines.

Lynn
Message 2 of 6
(5,606 Views)
JeffC wrote:
> I have a for loop with i=1 with a single shift register (and internal
> add operator). The internals of the for loop are wired and encased in a
> case structure such that when the case input is true, the input to the
> case structure is added to a running total of the input values and then
> output. This works well, however I need to at times clear the output of
> the shift register while the VI is running. What would be a good way to
> do this? Thank you.
I should add, here is a jpg of the block diagram I am using.

http://img165.imageshack.us/my.php?image=runningsumna4.jpg
0 Kudos
Message 3 of 6
(5,573 Views)

I think ur expect this method.

 

See the attachement.

 

-Kumar B

0 Kudos
Message 4 of 6
(5,558 Views)
Kumars suggestion needs an OR, so the clear happens even if the case is FALSE. I would also set the clear button to "latch when released".
 
 
Somehow, it seems silly to need an extra inner N=1 FOR loop just to contain a shift register. Why can't you use to outer loop for the shift register as in the modification below. This would simplify things without change in functionality. Right?
 
 
How fast do you need the outer loop to run?

Message Edited by altenbach on 07-30-2007 10:13 PM

Download All
0 Kudos
Message 5 of 6
(5,551 Views)
altenbach wrote:
> Kumars suggestion needs an OR, so the clear happens even if the case is FALSE. I would also set the clear button to "latch when released".
>  
> <img src="http://forums.ni.com/attachments/ni/170/262322/1/resetShifter.png">
> &nbsp;
> Somehow, it seems silly to need an extra inner N=1 FOR loop just to contain a shift register. Why can't you use to outer loop for the shift register as in the modification below. This would simplify things without change in functionality. Right?
> &nbsp;
> <img src="http://forums.ni.com/attachments/ni/170/262322/2/resetShifter1.png">
> &nbsp;
> How fast do you need the outer loop to run?Message Edited by altenbach on 07-30-2007 10:13 PM
>
>
> resetShifter.png:
> http://forums.ni.com/attachments/ni/170/262322/1/resetShifter.png
>
>
> resetShifter1.png:
> http://forums.ni.com/attachments/ni/170/262322/2/resetShifter1.png
Thank you both very much! The examples work perfectly for me. My outer
while loop contains several functions of which my counter is one and is
why I decided to use the inner for loop.
0 Kudos
Message 6 of 6
(5,539 Views)