> I am "fresh" to the National Instruments software
> world. I have purchased the LabVIEW software and
> have written some minor applications. However, I
> recently encountered a "pro" in this software
> world who advised that the LabWindows/CVI
> environment is better for applications/systems
> requiring more intelligence. He cited several key
> things:
>
> Easier to modify (adding something to labVIEW is
> difficult...moving wires and icons to make room
> for new "code")
>
> Easier to document (not quite sure here)
>
> Easier to implement variations of code
> (sometimes simple tasks require complex
> wires in LabVIEW)
>
> He cited some other things as well. What is the
> feeling out there with respect to choosing one
> verses the other? Any example criteria by which
> to evaluate suitability?
>
The pro, probably prefers LW because he knows and is
comfortable with C. I say this because he lists some
positives, but no negatives. Both tools are very
comparable, and NI offers both of them so that you
can choose the one that best fits your knowledge and
experience. If you already know C and are aware of
its strengths and limitations, then LW is a good
choice and you won't be sorry for picking it.
If you don't know C or are frequently frustrated by
the lack of safeguards, then LV is probably a better
choice for you.
It isn't a black-n-white issue, and that is why NI
offers both. I know and use both, and appreciate
the differences. IMO, since LV allows you to connect
DLLS, ActiveX and other external code, but lets you
work at a high level most of the time, making it a
great choice for most engineers and scientists.
--------------
As for the negatives he lists:
Writing C code means making up lots of variable names
and doing lots of tabbing and wrapping code into a
readable format. Writing LV code means making up way
fewer variable names, and arranging icons and wires
into a readable format. The task for LV is perhaps
slightly harder, but the LV editor has lots of features
for making it easy. If the pro doesn't know how to
"make space" by option dragging a rectangle, then its
easy to see how he would say this. Also, if you want
to make a C programmer drool sometime, select some code
and choose Create SubVI from Selection from the edit menu.
It is just an editor feature made easier by the languages
natural information about dataflow, but it often makes
them turn green with envy.
Documenting code is another personal choice. In C, you
/* comment */ your code, and reading it is as simple as
parsing the /* */'s. If using C++, then you get to choose
between /* */ and simply \\ and that goes to the end of a
line. This is offset a bit if the code uses good variable
names for temporary variables.
In LV, the comments are pretty much any and all text you
see since the code isn't text. You can show as many labels
and drop as many free labels as you like. The help window
is also an invaluable way of seeing the comments to another
level of detail. If the icon doesn't remind you of its
function, then the help window will give you a name and
what the parameters do.
Sometimes simple problems have simple solutions, and
sometimes they don't. The language and tool choice
scramble things up a bit, but both languages support
sub-functions to encapsulate code to hide the complicated
parts behind an easier to use interface. Averaging two
arrays is a good example of a task that is two icons and
a constant in LV and looks hard in C; so be sure to \\comment
the C code so that its obvious that it is an average of each
element. On the otherhand, once you get the hang of C's
array indexing and structure dotting syntax, it is very
compact and powerful; so manipulating and accessing elements
looks simple once you understand the syntax.
For comparison, you can open up similar examples that ship
with the products. Choose examples similar to what you
normally write and try to explain the examples to a friend
or an imaginary friend. Which was easier. Then try to make
a similar set of modifications to the examples. Add a few
additional buttons or some signal processing or file I/O.
Keep in mind that the language you choose to explain or
modify first will affect how you do on the second one --
sometimes making it easier, sometimes harder.
-------------
Basically, both languages are powerful and they bring with
them their tradeoffs. I'd encourage you to learn both,
that way you can choose the best tool for each job.
Greg McKaskle