LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Shift Registers in while loop when string is connected to registers

Solved!
Go to solution

So the way the program is written right now, it will go to the case 0 of the sequence structure, and create some random number.  Then the state machine will start becasue case 1 of the sequence structure is called, and it will go to the "initial" state because that is what is wired to the shift register outside othe while loop.  Once we are in the "initial" state we tell the state machine to next go to the "display" state by wiring that constant to the shift register inside the loop.  Once we are in the display state we tell the state machine to next go to the "check error" state.  Once in check error we tell it to go to get input.  

 

A few things that could be issues.  First you have no way to stop your code, one of your states is going to have to be exit, where you wire a True to the stop, and it will be false in all other cases.

 

The other issue is the random number, notice how it isn't wired through in most of your cases?  Only in check error do you wire it through, but in all other cases it is unwired, which will probably mean it gets reset to 0 before going to the next state and I don't think that is what you want.  BTW here is some more help on state machines and how they work.  These examples use enums (the blue constants with text in them) for the states, but just think of them as more strickly typed strings with explicit values that it can be.

 

http://www.ni.com/tutorial/7595/en/

0 Kudos
Message 11 of 13
(897 Views)

Hoovah you suggested to use case structures. How can I pass the values from one case to other case like I did using stacked sequence structures.

0 Kudos
Message 12 of 13
(856 Views)

Hint: It's in the title of your post. 

0 Kudos
Message 13 of 13
(854 Views)