Python (how to start on WinXP to control meters via GPIB interface) - Page 1
Forum section: electronics / beginners

author: pelule
author_rank: Frequent Contributor
timestamp: January 24, 2016, 09:41:26 pm
content: 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.BRPeLuLe

author: Lukas
author_rank: Frequent Contributor
timestamp: January 24, 2016, 11:11:38 pm
content: Python + pyvisa works perfectly on Windows. At least on Windows 7. What's your reason for sticking with XP?

author: eliocor
author_rank: Unknown
timestamp: January 24, 2016, 11:25:57 pm
content: Instead of learning python, if you know a little of Pascal, you can use EZGPIB:http://www.ulrich-bangert.de/html/downloads.htmlUnluckily 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!

author: pelule
author_rank: Frequent Contributor
timestamp: January 25, 2016, 12:51:10 am
content: @ eliocorHad 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.@ LukasWhy 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)

author: tooki
author_rank: Super Contributor
timestamp: January 26, 2016, 09:06:09 pm
content: "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?

author: ivaylo
author_rank: Frequent Contributor
timestamp: January 27, 2016, 07:57:21 am
content: Easiest on XP would probably be Anaconda -http://docs.continuum.io/advanced-installation

author: free_electron
author_rank: Super Contributor
timestamp: January 27, 2016, 09:18:31 am
content: Pyvisa is a total piece of junk. it is slow and badly written.

author: Lukas
author_rank: Frequent Contributor
timestamp: January 27, 2016, 10:03:41 am
content: Quote from: free_electron on January 27, 2016, 09:18:31 amI'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.

author: ivaylo
author_rank: Frequent Contributor
timestamp: January 28, 2016, 03:33:19 am
content: Quote from: Lukas on January 27, 2016, 10:03:41 amSame here...

author: pelule
author_rank: Frequent Contributor
timestamp: January 28, 2016, 09:05:57 pm
content: 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

author: nfmax
author_rank: Super Contributor
timestamp: January 28, 2016, 09:33:04 pm
content: 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)

author: ade
author_rank: Unknown
timestamp: January 28, 2016, 09:57:13 pm
content: Anaconda is probably not required. Python now comes with it's own official package manager calledpip. 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.

author: Lukas
author_rank: Frequent Contributor
timestamp: January 28, 2016, 10:21:16 pm
content: 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.

author: max_torque
author_rank: Super Contributor
timestamp: January 29, 2016, 11:24:04 am
content: 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.....

author: pelule
author_rank: Frequent Contributor
timestamp: February 07, 2016, 09:12:40 pm
content: 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.BRPeLuLe

author: Mechatrommer
author_rank: Super Contributor
timestamp: February 08, 2016, 04:15:42 am
content: Quote from: tooki on January 26, 2016, 09:06:09 pmthe 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.

author: tooki
author_rank: Super Contributor
timestamp: February 08, 2016, 08:48:55 am
content: 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!!) 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.

author: HAL-42b
author_rank: Frequent Contributor
timestamp: February 08, 2016, 10:18:45 am
content: 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.

author: retrolefty
author_rank: Super Contributor
timestamp: February 08, 2016, 01:24:13 pm
content: Quote from: Lukas on January 24, 2016, 11:11:38 pmI think he stated the why of the requirement.Quote

author: tooki
author_rank: Super Contributor
timestamp: February 08, 2016, 05:35:24 pm
content: Quote from: HAL-42b on February 08, 2016, 10:18:45 amBzzzzt, 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" arenotsynonyms. "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.