Author Topic: Python (how to start on WinXP to control meters via GPIB interface)  (Read 8067 times)

0 Members and 1 Guest are viewing this topic.

Offline peluleTopic starter

  • Frequent Contributor
  • **
  • Posts: 520
  • Country: de
  • What is business? It’s other people’s money
So far I am using LabView to write controls (GPIB) for my lab. LabView includes the Application Builder to create stand-alone executeable. But this is a high amount of work just for some simple or basic tasks like just sending a config string to my meters.
Have got the impression, Python may a suitable solution for such small task, as it is a scripting language..
I am totally new on Python and have no glue, how to start and what minimum setup needed.

I like to setup a basic environment on my WinXP system, simply to control meters via the GPIB card.
- PC based in WinXP Professional
    (a must, as my whole lab environment is based on, would not operate on linux or newer win-versions).
- equipped with NI GPIB card (tested & operating)
- optional a USB/GPIB interface (tested & operating)
I would preferred a solution which could also create stand-alone executeables. But not a must.
I have tried to collect information but got totally confused on that many options.
What would you recommand for a start-up environment?
Any tip & hint is welcome.
BR
PeLuLe

You will learn something new every single day
 

Offline Lukas

  • Frequent Contributor
  • **
  • Posts: 412
  • Country: de
    • carrotIndustries.net
Re: Python (how to start on WinXP to control meters via GPIB interface)
« Reply #1 on: January 24, 2016, 11:11:38 pm »
Python + pyvisa works perfectly on Windows. At least on Windows 7. What's your reason for sticking with XP?
 

Offline eliocor

  • Supporter
  • ****
  • Posts: 561
  • Country: it
    • rhodiatoce
Re: Python (how to start on WinXP to control meters via GPIB interface)
« Reply #2 on: January 24, 2016, 11:25:57 pm »
Instead of learning python, if you know a little of Pascal, you can use EZGPIB: http://www.ulrich-bangert.de/html/downloads.html
Unluckily the developer is dead, but I never had any need for a newer release of EZGPIB.
- it works flawlessly on Windows XP
- it works with NI GPIB cards
- it works with NI and Keysight/Agilent USB-GPIB interfaces
- it works!
 

Offline peluleTopic starter

  • Frequent Contributor
  • **
  • Posts: 520
  • Country: de
  • What is business? It’s other people’s money
Re: Python (how to start on WinXP to control meters via GPIB interface)
« Reply #3 on: January 25, 2016, 12:51:10 am »
@ eliocor
Had already tested EZGPIB (as I have experiance with TurboPASCAL in my past). In principle it works, but thats not that simple as I would expect for Python.

@ Lukas
Why to stick with XP - simply because all my equipment runs fine with it, several tools & hw do NOT work with the newer versions (missing drivers...) and last but not least: never change a running system.
This is my Lab-Only system, no connection to the WWW, thus no need for critical updates (even it would possible if you change it in the registry to the POS version as desribed in another thread here)

You will learn something new every single day
 

Offline tooki

  • Super Contributor
  • ***
  • Posts: 14875
  • Country: ch
Re: Python (how to start on WinXP to control meters via GPIB interface)
« Reply #4 on: January 26, 2016, 09:06:09 pm »
"Never change a running system" is how you amass mountains of technical debt that causes future upgrades to be massive undertakings, as opposed to little bits here and there. And often, that is forced by failure of some system, which you then can't fix or replace, so you're forced to upgrade everything at once.

Yeah, I used to do IT consulting. Avoid technical debt. It's bad mmkay? ;)
 

Offline ivaylo

  • Frequent Contributor
  • **
  • Posts: 661
  • Country: us
Re: Python (how to start on WinXP to control meters via GPIB interface)
« Reply #5 on: January 27, 2016, 07:57:21 am »
Easiest on XP would probably be Anaconda - http://docs.continuum.io/advanced-installation
 

Offline free_electron

  • Super Contributor
  • ***
  • Posts: 8788
  • Country: us
    • SiliconValleyGarage
Re: Python (how to start on WinXP to control meters via GPIB interface)
« Reply #6 on: January 27, 2016, 09:18:31 am »
Pyvisa is a total piece of junk. it is slow and badly written.
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Offline Lukas

  • Frequent Contributor
  • **
  • Posts: 412
  • Country: de
    • carrotIndustries.net
Re: Python (how to start on WinXP to control meters via GPIB interface)
« Reply #7 on: January 27, 2016, 10:03:41 am »
Pyvisa is a total piece of junk. it is slow and badly written.
I'm using pyvisa for quite some time now and never had any problems with it. I can't recall the exact speed, but even downloading millions of samples from oscilloscopes didn't took too long.
 

Offline ivaylo

  • Frequent Contributor
  • **
  • Posts: 661
  • Country: us
Re: Python (how to start on WinXP to control meters via GPIB interface)
« Reply #8 on: January 28, 2016, 03:33:19 am »
Pyvisa is a total piece of junk. it is slow and badly written.
I'm using pyvisa for quite some time now and never had any problems with it. I can't recall the exact speed, but even downloading millions of samples from oscilloscopes didn't took too long.
Same here...
 

Offline peluleTopic starter

  • Frequent Contributor
  • **
  • Posts: 520
  • Country: de
  • What is business? It’s other people’s money
Re: Python (how to start on WinXP to control meters via GPIB interface)
« Reply #9 on: January 28, 2016, 09:05:57 pm »
Many thanks all for the hints. Still puzzeling, what to use (too many out there)
I have looked to Anaconda and PyVisa.

In my understanding
- Anaconda is an Python 3.5 istallation package (ref: http://docs.continuum.io/anaconda/index)
- PyVisa is an add-on, requires an existing Python 2.6 or >=3.2 installation (ref: https://pypi.python.org/pypi/PyVISA)
Am I correct, that both could be combined?

Does anyone having experiance with "PyScripter"?
- It's a Windows running Pyhton IDE (incl. degugger) supporting Python up to v3.4 under MIT free sw licnese.
- IDE has advantage for starters as you are able to watch to variables.
- Would be charming to combine it with PyVisa.
Is there any experiance with out there?

PeLuLe

You will learn something new every single day
 

Online nfmax

  • Super Contributor
  • ***
  • Posts: 1667
  • Country: gb
Re: Python (how to start on WinXP to control meters via GPIB interface)
« Reply #10 on: January 28, 2016, 09:33:04 pm »
I've just started out on this route myself. You are correct, Anaconda is a Python installer. If I remember correctly, you can install PyVISA through Anaconda. I also installed an IDE using Anaconda, which is called 'spyder' or something like that. I'm using Python 3.5, the Keysight IO suite VISA libraries,and an Agilent 82357B USB to GPIB adapter (a genuine one!) It all works together OK, but I haven't had time to do much with it since I got it working (on Windows 7)
 

Offline ade

  • Supporter
  • ****
  • Posts: 231
  • Country: ca
Re: Python (how to start on WinXP to control meters via GPIB interface)
« Reply #11 on: January 28, 2016, 09:57:13 pm »
Anaconda is probably not required.  Python now comes with it's own official package manager called pip.  You can install PyVISA using pip.

Latest versions of Python no longer support Windows XP.  The latest version you can install is Python 3.4 (which has pip).

As for IDEs, that's a matter of personal preference.  The best IDEs for Python include PyCharm and Komodo (which no longer supports Windows XP).  Lots of Python developers just use editors (such as Sublime Text) instead of full IDEs.

PyScripter is no longer being actively developed.  So if you run into issues, you're pretty much on your own.
« Last Edit: January 28, 2016, 09:59:45 pm by ade »
 

Offline Lukas

  • Frequent Contributor
  • **
  • Posts: 412
  • Country: de
    • carrotIndustries.net
Re: Python (how to start on WinXP to control meters via GPIB interface)
« Reply #12 on: January 28, 2016, 10:21:16 pm »
Anaconda is a good choice. It already includes many third-party packages like numpy or matplotlib you may use later on. It comes bundled with the spyder IDE and ipython notebook. It's mostly down to personal preference which style of interaction you prefer. Some people really like spyder, I much prefer ipython notebbok, primarily of the possibility to have inline plots.
For installing pyvisa in anaconda, just invoke pip install pyvisa in the anaconda command prompt.
 

Offline max_torque

  • Super Contributor
  • ***
  • Posts: 1334
  • Country: gb
    • bitdynamics
Re: Python (how to start on WinXP to control meters via GPIB interface)
« Reply #13 on: January 29, 2016, 11:24:04 am »
What i use for quick little coms useage is Microsoft Excel, ie VBA!

Pretty much everyones got it already installed, it's robust and stable, and comes with built in graphing capability.  VBA scripting is extremely easy, and if your NI GPIB card comes with a supporting APi (which it probably does) it's extremely easy to interface!

If you want it to look like a stand alone app, you can just make excel.exe invisible when it runs, and just show the VBA form, that's what i do.....
 

Offline peluleTopic starter

  • Frequent Contributor
  • **
  • Posts: 520
  • Country: de
  • What is business? It’s other people’s money
Re: Python (how to start on WinXP to control meters via GPIB interface)
« Reply #14 on: February 07, 2016, 09:12:40 pm »
Thanks max_torque,
will give hem a try... Did not expect to return to BASIC again, but... "Never say never".
But will continue my investigation to Python also.

BR
PeLuLe
You will learn something new every single day
 

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11718
  • Country: my
  • reassessing directives...
Re: Python (how to start on WinXP to control meters via GPIB interface)
« Reply #15 on: February 08, 2016, 04:15:42 am »
"Never change a running system" is how you amass mountains of technical debt that causes future upgrades to be massive undertakings, as opposed to little bits here and there.
the paradox of little bits here and there waste time and money actually if you calculate it long term but ymmv, this is specific to my case. one better put the money in bank to grow and at the same time continue to enjoy and make profit from a system that is not broken. i'm also the one who stick with XP because its not broken. but from time to time i keep an eye on my equipments and softwares which can be ported to the new OS which cant. because if my expensive items and sw cant be ported, yeah its a mass undertaking for an upgrade.. so i better get rid of it the longest i can. technical support and all the jargons the came with it are just hoax in my little world as long as my system works. the only problem with this attitude is i'm not helping the market or economy, i'm just helping myself.
The Ultimatum of False Logic... http://www.soasystem.com/false_logic.jpg
 

Offline tooki

  • Super Contributor
  • ***
  • Posts: 14875
  • Country: ch
Re: Python (how to start on WinXP to control meters via GPIB interface)
« Reply #16 on: February 08, 2016, 08:48:55 am »
Well, as someone with a professional background in the software world, I can say that upgrade laggards not only don't help the economy, but cause huge problems for the software industry. One of Microsoft's biggest mistakes, IMHO, is supporting old OSes for so long, because it created a culture of businesses/organizations holding onto old OSes for forever. (I remember one customer whose university began their upgrade TO Win XP in 2011!!  :palm: ) And this in turn means developers cannot use any of the new technologies that were added to the OS since then. In the software my employer made, there were tons and tons of features that we could have added much more easily if people had just left XP behind. We spent far more time debugging problems in XP than in newer Windows versions, because the newer Windows could simply do more on its own.

In contrast, Apple is perhaps a bit too excessive in supporting only the newest OS version. In terms of software, this isn't a huge problem, but it is for companies that need to replace a machine, and find that invariably, the new Mac can only run the very latest OS version, not even one version back. But on the whole, Apple's policy of "encouraging" people to run the latest software is the better way to go, both for security, but again especially for pushing the platform forward.
 

Offline HAL-42b

  • Frequent Contributor
  • **
  • Posts: 423
Re: Python (how to start on WinXP to control meters via GPIB interface)
« Reply #17 on: February 08, 2016, 10:18:45 am »
Microsoft is also responsible for the words 'software' and 'features' to make my skin crawl when used together.

I remember the time when they were called simply 'programs'. The word 'software' is just a Microsoft marketing wank word imposed on us and I refuse to accept it.
 

Offline retrolefty

  • Super Contributor
  • ***
  • Posts: 1648
  • Country: us
  • measurement changes behavior
Re: Python (how to start on WinXP to control meters via GPIB interface)
« Reply #18 on: February 08, 2016, 01:24:13 pm »
Python + pyvisa works perfectly on Windows. At least on Windows 7. What's your reason for sticking with XP?

 I think he stated the why of the requirement.

Quote
- PC based in WinXP Professional
    (a must, as my whole lab environment is based on, would not operate on linux or newer win-versions).
 

Offline tooki

  • Super Contributor
  • ***
  • Posts: 14875
  • Country: ch
Re: Python (how to start on WinXP to control meters via GPIB interface)
« Reply #19 on: February 08, 2016, 05:35:24 pm »
Microsoft is also responsible for the words 'software' and 'features' to make my skin crawl when used together.

I remember the time when they were called simply 'programs'. The word 'software' is just a Microsoft marketing wank word imposed on us and I refuse to accept it.
Bzzzzt, nope. The word "software" dates back to 1953, 2 years before Bill G. was born, and 22 years before Microsoft was founded. But moreover, "programs" and "software" are not synonyms. "Software" is a collective term, encompassing programs as well as things that are not customarily referred to as programs (such as the OS kernel, shared libraries, and plug-ins). In English, it's considered incorrect to call a program "a software"* -- it's an uncountable noun that demands with it a quantity adjective (e.g. "lots of software") or a countable noun (e.g. "a piece of software") whenever you aren't referring to the more abstract concept of software. "A program" (or "an application") on the other hand is completely correct.

As for "features" -- yes, it sometimes sounds like marketing wank, but the reason the industry settled on that, as opposed to "function", is because of the ambiguity between a function (as in feature), and a function (as in algorithm, subroutine or method). "Feature" for "something a user will use" and "function" for the mathematical/programming terms form a nice contrasting pair.

(I am a professional technical writer and translator. I've had this discussion countless times.)

*Yes, you'll find plenty of citations for "a software", but they are nearly universally by non-native speakers of English, and thus not representative of accepted usage.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf