> One of the most serious limitations of LabView from my perspective is the
> inability of the platform to accommodate top-down programming practice. In
> LabView, applications need to be (or at least should be) designed from the
> top down BUT allways must be programmed from the bottom up. In otherwords,
> you must define all of the lower level sub-VIs prior to incorporating them
> into a higher level vi.
>
> It would really be nice to be able to lay out a LabView program like a flow
> chart using sub-VIs where only the input and output of the VI is defined.
> The detail could be added at a later stage. This is really valuable for
> large projects where the detail work is divided among many programmers.
> All of the traditional languages (c, c++, etc.) permit this kind of data
> abstraction so it is hard for me to believe that something like this has not
> been incorporated into LabView.
>
> Am I missing something here? Is there a way to do top-down programming that
> I have totally missed?
>
While it could be a bit easier, it is indeed possible to write top-down SW
in LV.
One very quick technique, similar to what is often done in textual
languages, is to just use comments. In otherwords, make a label with
the name or description of each high-level action taking place. Put
the labels in the correct sequence, in parallel threads, parallel
loops, or whatver combination makes sense. Then you probably want to
handle the major datatypes, place them on the panel so that you have
terminals to arrange along with the blocks.
As you flesh out the different blocks, you can replace them with very
light-weight VIs. If you are using template VIs that already have the
connector and some of the controls selected, then this isn't too much
work. Here is another technique that may come in handy.
Place a sequence structure around the label. You can wire any input
to the border of the sequence. You can drop any constant into the
sequence to return a datatype/value until the block is completed.
This takes very little time, and you can always use more than one
frame of the sequence if you need to. When you are ready to make
the subVI, you can select the sequence, choose Create SubVI from
Selection from the Edit menu, and it will automatically make the
controls, indicators, and place them on the connector pane. You
can save the VI using the block name and optionally make an icon.
Back on the upper-level diagram, you can show the subVI name label
and put off the icon until the later.
When you get around to fleshing out the function further, you
should probably popup on the sequence and remove the sequence.
Now you can repeat the steps as necessary to flesh out this VI.
Keep in mind that at each point above, the application is pretty
much always able to run. It allows for a pretty smooth top-down
design/imlementation along with some of the cool LV features that
enable bottom-up implementation.
If you need further abstraction, you may want to look at GOOP
(Graphical Object Oriented Programming) as was covered at NIWeek 99.
I'm sure you can get the proceedings or a white paper if you look
on the web site or contact NI.
Greg McKaskle