LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Resetting a shift register

Solved!
Go to solution

Hey guys, I'm trying to get my VI to zero out/clear the shift register values once I reach a certain goal without having to restart my VI. I have it to where after so many (defined) cycles have been ran, my data button go to default (off). I want to be able to press this data button again to aquire more data if needed...but my problem is that the shift register is holding the previous count! If I can get my shift register to clear to 0, I think I can proceed to the next phase of my program. Yes, it's for vanitys sake, but nonetheless, wanted.

0 Kudos
Message 1 of 9
(3,113 Views)
Solution
Accepted by topic author glskinner

You could use a state machine. You could have two states: Idle, and Running maybe ? I've attached an example.

You could reset your counter when condition is met (To transition state) without stopping the program.Hope this helps.


Kudos are the best way to say thanks 🙂
0 Kudos
Message 2 of 9
(3,106 Views)

Hey Srid, could you please give a 2011 version of your example? I'm not able to open it for some reason.

0 Kudos
Message 3 of 9
(3,098 Views)

Here you go. 11.0


Kudos are the best way to say thanks 🙂
0 Kudos
Message 4 of 9
(3,092 Views)

I know this may sound like a dumb question but, how do you get the case selectors such as run and idle to not be red?

0 Kudos
Message 5 of 9
(3,080 Views)

I don't see it red ? Did you modify the VI ?

 

So you could add more states if you want by right clicking the enum. In the case statement, on one of the case selectors if you right click, there should be an option to add a case for every value. 


Kudos are the best way to say thanks 🙂
0 Kudos
Message 6 of 9
(3,073 Views)

I'm lost, the example makes sense but I'm just not sure how to implement it into my VI. arg!

0 Kudos
Message 7 of 9
(3,071 Views)

The simple answer to your original question is to make the false state of the case structure wire a zero to the shift register. However as suggested, the better way is to use a state machine.

Charles Chickering
Architecture is art with rules.

...and the rules are more like guidelines
Message 8 of 9
(3,060 Views)

I see it now...works! thanks gentlemen!

0 Kudos
Message 9 of 9
(3,040 Views)