[volt-nuts] do you like Labview in your labs?
cfharris at erols.com
Tue Dec 7 16:23:41 UTC 2010
Python is appealing for a number of reasons. First, it is an
interpreted scripting language. You can make changes on the
fly and instantly see their effect. Second, it is a very highly
structured object oriented language. Third, it is available on
virtually all operating systems, and runs on virtually all processors.
Fourth, it has thousands of library functions available. Chances are
that anything you want to do, library wise, has already been done, and
is waiting for you... python and graphs, python and surfaces, python
and audio, python and Octave, python and C++, python and burning DVD's,
python and well, visa compliant GPIB drivers...
Because it is scripted, Python is never going to be the fastest running
solution, but how fast do you need your GPIB code to be? The libraries
are typically written in C++, and are blindingly quick. The ease with
which you can make small changes and test them makes quick utilities
easy to put together. The easy integration with packages like wxPython
makes building beautiful integrated graphical applications easy to toss
together.... and wxPython builds GUI's anywhere python runs... including
Perl would work too, but unless you are very disciplined, perl scripts
end up being write only... totally unintelligible when you come back
later to make changes... sometimes even the next day...
I like C a lot; however, it takes a serious amount of setting up
to make the compiler not barf with lots of undefined references.
Python shares a characteristic with BASIC in that using a variable
will cause it to be created, of the right type, and properly initialized.
And, unlike Labview, python will survive the NI's eventual bankruptcy, or
sale. Python is heavily used in Linux, BSD unix, and even windows. It
will be here for a long while.
Marvin E. Gozum wrote:
> Hi Chuck,
> Thanks for the clarification. Since the 3478A is a popular DVM in the
> secondary market, this is good to know and for the archives of volt-nuts
> to log your Prologix experience; I see the initial struggles over at
> time-nuts archive.
> Thanks for the Python code! I like its look, but the simplicity of
> device interfacing begs the question, why Python over competitors, not
> just Labview, why not C or Pascal or Basic etc., for writing support
> code for instruments?
> Doesn't seem like the fastest out there and these benchmarks do not
> measure code size either.
> I don't know the answer. Right now, I just use what I have.
> But it seems overall being aware or knowing the commands of GPIB and
> Prologix and establishing a connection to these devices through a
> minimalist way: serial port/USB/dll layer is a stable floor, it made
> your Python code very readable; if I simply let any app interface
> automatically, should things malfunction, I'd have to trace the fault
> from some established working floor.
> I don't think I'd be able to do this if I obtained an interface library
> in any language or Labview and relied on its abstraction to keep my
> instruments together without knowing how its done.
> If I write it myself, it seems it doesn't matter what the language is,
> unless it offered some value in maintenance, speed or code size.
More information about the volt-nuts