Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #14989

Re: Data acquisition

From Dennis Lee Bieber <wlfraed@ix.netcom.com>
Subject Re: Data acquisition
Date 2011-10-25 17:08 -0700
Organization > Bestiaria Support Staff <
References <362e368f-829e-4477-bcfc-c0650d231029@j7g2000yqi.googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.2220.1319587812.27778.python-list@python.org> (permalink)

Show all headers | View raw


On Tue, 25 Oct 2011 08:51:27 -0700 (PDT), spintronic
<sidorenko.andrey@gmail.com> declaimed the following in
gmane.comp.python.general:

> 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:

	<snip> 

> 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,...]

	<snip> 
> mw = instrument("GPIB0::20::INSTR", timeout = None)
>
	Does "timeout=None" mean "wait forever", or "return with whatever is
available"?

	If the latter, it would mean the script is running too fast for the
device to respond, and you should add some sleeps.

>From the PyVisa documentation:

doc> Here, my device may be a device, an interface or whatever, and its
timeout is set to 25 seconds. Floating-point values
doc> are allowed. If you set it to zero, all operations must succeed
instantaneously. You must not set it to None. Instead, if
doc> you want to remove the timeout, just say
doc> del my_device.timeout
doc> Now every operation of the resource takes as long as it takes, even
indefinitely if necessary.

Note the warning: "YOU MUST NOT SET IT TO NONE"

> mw.write("*RST")
> mw.write("CALC1:DATA? FDATA")
>
	Does the write() buffer? Do you need to flush the output (something
that may be occurring in the background with the interactive session).
-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
        wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


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