LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Will a shift register in one section of code maintain the latest value when state machine moves to different section?

Hello,

 

    If I have a state machine that's running a portion of code that uses shift registers that change with each iteration, when the state machine moves to a different loop, then returns to the loop with the shift registers, will they maintain their latest know value, or be reset? There is no code that would programmatically reset them. 

 

With the shift registers on the outside while loop, I would guess that they maintain the latest value while the state machine runs in the internal case structure.

 

 

Thanks!

0 Kudos
Message 1 of 5
(327 Views)

You need to attach a simplified version of your code.

 

We cannot tell what vague terms mean (loop, different loop, outside, internal, change, ...)

 

It is all in the dataflow and if the shift register wire goes through a case or event structure, make sure to wire it across all cases.

 

If you are unsure, a small test program would probably answer all your questions! Have you tried?

Message 2 of 5
(288 Views)

When you say "State Machine", I assume you mean a While (or possibly For) loop surrounding a Case Structure, with Shift Registers on the Loop structure.  When you finish any of the While "cases" and "loop" to the next State, the (left) Shift Register values are updated.

 

If the Case itself contains a While Loop with Shift Registers (I'm not sure I've done that, myself), it won't affect the "outer" Shift Registers unless the "inner" loop wires itself to one of the "outer" registers on exit.  [I think -- hard to visualize such a case ...]

 

Bob Schor

Message 4 of 5
(209 Views)

Without seeing your code all I can say is you must pass a wire through all cases to connect the shift register.input and output  

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 5 of 5
(135 Views)