LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Stratergy for re-writing "Stacked Sequence Structure" Architecture

Hi.

   I have inhereted rather a large code base consisting of lots of "Stacked Sequence Structure" architecture. This architecture make is impossible to pass error clusters through so I am attempting to come up with a method to replace this architecture without something better. The current users of the code are acoustomed to the way it looks, so I am basically constrained to turning the sequence structure into a case structure and putting it inside a for loop.

 

I have attempted creating a shift register for each outputted variable, and assigning them all a "Use Default if Unwired" meaning I can simply transform my sequence structure into a case structure and all I have to do is add a default step will all of the variables wired straight though. Unfortunalty when I do this, my exis results seem to be only the last result and not any of the others.

 

Can anyone tell me why this is? The application does not seem to be functioning as I would expect it to. I know one way to avoid this would be to have rails for each variable running through the middle of each step, but this makes the code even more unmessy and is not a adiquate solution...

 

I have attached my half baked solution vi, and the problem vi.

Help would be greatly appreciated!

Download All
0 Kudos
Message 1 of 6
(2,423 Views)

You get only the last value because the default value when unwired is an empty string.

 

I would suggest using a single exit tunnel and either placing a concantanate string in each case or building an array.

0 Kudos
Message 2 of 6
(2,414 Views)

My feeling is that you don't really understand how shift registers work.  Shift registers are written to with every iteration of the loop.  When the loop terminates, the most recent value in the shift register is output.  In the code you show, the final case you execute is case 2 -- where you write two empty strings and the string constant "Two" to the output shift registers.  Hence, that is what the shift registers will contain when your loop terminates. 

 

If you don't want to overwrite a previous value that's been written to a shift register, you need to run wires through the case structure, connecting the input shift register to the output shift register.  Why is this "not an adequate solution"? 

 

How did you think shift registers worked?

0 Kudos
Message 3 of 6
(2,410 Views)

A more refined vi. Do not re-use code in a case statement.

 

 

0 Kudos
Message 4 of 6
(2,386 Views)

can you save that last one for LV 2010 please someone?

0 Kudos
Message 5 of 6
(2,367 Views)

Here it is, please find attached.

Mahdieh G
Applications Engineer
National Instruments UK&Ireland
0 Kudos
Message 6 of 6
(2,350 Views)