Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #14973
| From | Nick Dokos <nicholas.dokos@hp.com> |
|---|---|
| Subject | Re: Data acquisition |
| References | <362e368f-829e-4477-bcfc-c0650d231029@j7g2000yqi.googlegroups.com> |
| Organization | HPCS |
| Date | 2011-10-25 12:29 -0400 |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.2214.1319560789.27778.python-list@python.org> (permalink) |
spintronic <sidorenko.andrey@gmail.com> wrote:
> Dear friends,
>
> I have a trouble with understanding the following. I have a very short
> script (shown below) which works fine if I "run" step by step (or line
> by line) in Python shell (type the first line/command -> press Enter,
> etc.). I can get all numbers (actually, there are no numbers but a
> long string, but this is not a problem) I need from a device:
>
> '0.3345098119,0.01069121274,0.02111624694,0.03833379529,0.02462816409,0.0774275008,0.06554297421,0.07366750919,0.08122602002,0.004018369318,0.03508462415,0.04829900696,0.06383554085, ...'
>
> However, when I start very the same list of commands as a script, it
> gives me the following, which is certainly wrong:
>
> [0.0, 0.0, 0.0, 0.0, 0.0,...]
>
> Any ideas? Why there is a difference when I run the script or do it
> command by command?
>
> ===========================
> from visa import *
>
> mw = instrument("GPIB0::20::INSTR", timeout = None)
>
> mw.write("*RST")
> mw.write("CALC1:DATA? FDATA")
>
> a=mw.read()
>
> print a
> ===========================
> (That is really all!)
>
>
> PS In this case I use Python Enthought for Windows, but I am not an
> expert in Windows (I work usually in Linux but now I need to run this
> data acquisition under Windows).
> --
> http://mail.python.org/mailman/listinfo/python-list
>
Shot in the dark: could it be that you have to add delays to give the
instrument time to adjust? When you do it from the python shell, line by
line, there is a long delay between one line and the next.
Nick
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Data acquisition spintronic <sidorenko.andrey@gmail.com> - 2011-10-25 08:51 -0700
Re: Data acquisition Jean-Michel Pichavant <jeanmichel@sequans.com> - 2011-10-25 18:15 +0200
Re: Data acquisition spintronic <sidorenko.andrey@gmail.com> - 2011-10-25 10:35 -0700
Re: Data acquisition Nick Dokos <nicholas.dokos@hp.com> - 2011-10-25 12:29 -0400
Re: Data acquisition spintronic <sidorenko.andrey@gmail.com> - 2011-10-25 10:22 -0700
Re: Data acquisition Dietmar Schwertberger <news@schwertberger.de> - 2011-10-25 23:31 +0200
Re: Data acquisition John Gordon <gordon@panix.com> - 2011-10-25 16:43 +0000
Re: Data acquisition spintronic <sidorenko.andrey@gmail.com> - 2011-10-25 10:31 -0700
Re: Data acquisition John Gordon <gordon@panix.com> - 2011-10-25 18:34 +0000
Re: Data acquisition "Paul Simon" <psimon@sonic.net> - 2011-10-25 15:06 -0700
Re: Data acquisition Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2011-10-25 17:08 -0700
Re: Data acquisition spintronic <sidorenko.andrey@gmail.com> - 2011-10-26 08:58 -0700
Re: Data acquisition Dietmar Schwertberger <news@schwertberger.de> - 2011-10-26 19:35 +0200
csiph-web