"jyang72211" <x@no.email> wrote in message
news:1235655606987-860875@exchange.ni.com...
> Hi, I have heard that all vi should fit on one screen. I have a
main vi that have multiple parallel loops. The first loop is to detect
the user request, the second loop is to perform the request, the third loop
is to control my samples with digital out and analog out, the forth loop is
to display analog in data on the screen, the fifth loop is to empty the daq
buffer continuously, and the sixth loop is to log data into a
file. If I have 6 loops in parallel, it is impossible for this vi
to fit on one screen. Is there a better way to organize this?
BTW, this is a multiple producers and multiple consumers architecture.
Thanks!
An ideal Vi should fit on screen, because it provides more overview.
One way to "hide" the parallel loops, is but putting them in sub VI's. This
is only useful if only one loop deals with UI stuff. If one loop does one
type of DAQ, it's easy to put this in a sub VI. I'd start this sub VI
dynamically in the UI loop, but you might as well keep it as a normal VI
running parallel of the UI loops.
But I wouldn't force this. There is absolutely nothing wrong with a few
parallel loops, where each loop takes the full width, and 60% of the height
of the screen! The reason this became a rule, is to avoid diagrams with: one
big sequence. In it, four steps. In each step, a nested case, while loop,
two parallel for loops and in there again two or three sequence structures
with 8 steps, and 40 nodes kludged together. But shrinking something like
this (with a few more sequence structures) is not helpful.
I think there is nothing wrong with a few (perhaps un to 5 or 6) parallel
loops, as long as there is a logic behind there existence. I often make a
DAQ VI. In it, there are perhaps 10 loops that read data from serial, tcp/ip
and fieldpoint devices. So, would it be helpful if I put them in subVI's? I
think, in this case, not. The reason for the rule is it provides a better
overview, and this solution would give *less* overview, so, not a good
idea...
I'd say: if there is a good reason, and you keep it structured, it is just
as good as hiding the same stuff behind (dynamic) sub vi's...
There are some benefits in keeping your diagrams small. It forces you to
separate your code, and those peaces are more likely to be simpler (thus
less errors), and more reusable. In the above example of the DAQ loop,
putting the loops in seperate subVI's, would result in reusable DAQ VI's. So
it's a delicate issue, don't follow the rules blindly, try to see why they
are there.
Regards,
Wiebe.