In its current state your vi is very difficult to read.  I don't
understand why you have the sequence structure in parallel to your
main loop.  This appears to be an initialization stage but could cause
problems since it is running in parallel.  I think, though, that you
may have already run into this problem as it looks like you are doing
the same initializations within the loop.

It is good practice to avoid sequence structures.  Your code will not
execute until the data that is required is ready.  You can use this
data dependency to force the order of execution.  You can run wires
directly rather than using the local variables as you have done
extensively in your program.  While local variables are certainly
useful in specific situations, it appears that they can be avoided in
most, if not all, of your cases.

I would also suggest that you program some of the tasks into subvis.
This is beneficial for several reasons.  First, it compacts the code
so that it can fit on one screen.  Second, it provides a convenient
way to force data dependency.  You can use Error In and Error Out
clusters to force the flow of the data.  You can do this even if these
are just passing through.  LV has good examples on how to create and
use subvis.

In order to see the graphs update inside the loop you must put them
inside the loop.  An indicator will not update until all structures
preceding it have completed.

If you'll clean up your vi so that the block diagram fits on one
screen it will be much easier to help you to help you to make it do
what you want it to do.

Reply via email to