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


Groups > comp.lang.python > #34685

Re: problem with usbtmc-communication

Path csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!cs.uu.nl!news.stack.nl!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <malaclypse2@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.002
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'failing': 0.05; 'interpreter.': 0.07; 'subject:skip:c 10': 0.07; 'okay': 0.09; 'python:': 0.09; 'read()': 0.09; '(the': 0.15; 'dec': 0.15; 'file,': 0.15; 'buffering': 0.16; 'buffering=0)': 0.16; 'c):': 0.16; 'disables': 0.16; 'emit': 0.16; 'jerry': 0.16; 'newlines': 0.16; 'personally,': 0.16; 'truncates': 0.16; 'url:all': 0.16; 'wrote:': 0.17; 'driver': 0.17; 'examples': 0.18; 'code,': 0.18; 'subject:problem': 0.22; 'help.': 0.22; 'example': 0.23; "python's": 0.23; "haven't": 0.23; 'to:2**1': 0.23; 'device': 0.24; 'header:In-Reply-To:1': 0.25; 'am,': 0.27; 'message- id:@mail.gmail.com': 0.27; 'jean': 0.29; 'probably': 0.29; 'link.': 0.30; 'file': 0.32; 'could': 0.32; '11,': 0.33; 'docs': 0.33; 'explains': 0.33; 'url:home': 0.33; 'to:addr:python-list': 0.33; 'that,': 0.34; 'received:google.com': 0.34; 'done': 0.34; 'thanks': 0.34; 'along': 0.35; 'open': 0.35; 'doing': 0.35; 'received:209.85.220': 0.35; 'received:209.85': 0.35; 'there': 0.35; 'but': 0.36; 'subject:with': 0.36; 'should': 0.36; 'received:209': 0.37; 'well.': 0.37; 'subject:: ': 0.38; 'skip:o 20': 0.38; 'things': 0.38; 'to:addr:python.org': 0.39; 'subject:-': 0.40; 'header:Received:5': 0.40; 'think': 0.40; 'skip:u 10': 0.60; "you've": 0.61; 'behavior': 0.64; 'url:be': 0.65; 'url:htm': 0.71; 'url:lc': 0.84; 'url:upload': 0.91; 'url:cc': 0.98
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=L/Lzkbn4qU8eBwPv9Z8Zq3j0v3+tFAQ0nt2/b4kpihQ=; b=iWBNt+suNO42Gq2e+VDvAlJGCzkA82OtXrj8a7Cm6p9plMSgA6madtvaLntyFNnKQV aOcsWUfTq0ITPfjLFxRRBbIuTrSUzX8CYvgdziHani9d3q5ojmSsV101Y2UtGyKQQMxQ A3Y6aYO3Ef0QPxC4Yv8p19XQbAyGMWJfaQfSHDyFNcHvjY2X44w619DE/efMejcRBAT5 iesKz84sUhlAkz5jEjgjl+oBzmC8UtQOCis780iPIpz6J2G7hN7KgyNwp+la10ir6NPb OtxWaHzfJqMvkW337Y3xH9HrusEK75Aon9dKc4YFUsXrELJKpYyKX+sIl+v4uNPoQzgR IfvA==
MIME-Version 1.0
In-Reply-To <50b9eb4f-f319-491d-894c-2a9386b6941a@x20g2000vbf.googlegroups.com>
References <05927d41-f73f-4fef-9a6d-4133e5c7d86a@n8g2000vbb.googlegroups.com> <mailman.462.1354631633.29569.python-list@python.org> <0910382a-08df-4325-806f-a4c3cdf6bd7b@f17g2000vbz.googlegroups.com> <mailman.492.1354721221.29569.python-list@python.org> <fc36067e-9b74-4eed-b1db-92ee5760af30@c16g2000yqi.googlegroups.com> <mailman.533.1354746072.29569.python-list@python.org> <d8253611-dab9-461a-8b82-9c52287718a9@w8g2000yqm.googlegroups.com> <mailman.564.1354805416.29569.python-list@python.org> <123edfab-b46a-4a47-8b73-3f47e807e074@c16g2000yqi.googlegroups.com> <mailman.586.1354824932.29569.python-list@python.org> <01cdbc70-7e46-4225-9baa-b555619d1aa8@10g2000yqo.googlegroups.com> <99b04e06-734c-4702-bf74-855e28d8f633@x20g2000vbf.googlegroups.com> <mailman.675.1355153683.29569.python-list@python.org> <50b9eb4f-f319-491d-894c-2a9386b6941a@x20g2000vbf.googlegroups.com>
Date Tue, 11 Dec 2012 19:49:26 -0500
Subject Re: problem with usbtmc-communication
From Jerry Hill <malaclypse2@gmail.com>
To Jean Dubois <jeandubois314@gmail.com>, "python-list (General)" <python-list@python.org>
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding quoted-printable
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.771.1355294042.29569.python-list@python.org> (permalink)
Lines 34
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1355294042 news.xs4all.nl 6897 [2001:888:2000:d::a6]:50021
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:34685

Show key headers only | View raw


On Tue, Dec 11, 2012 at 1:58 AM, Jean Dubois <jeandubois314@gmail.com> wrote:
>
> I found examples in the usbtmc kernel driver documentation (the
> examples there are given in C):
> http://www.home.agilent.com/upload/cmc_upload/All/usbtmc.htm?&cc=BE&lc=dut

Thanks for that link.  I think it explains how the driver works pretty
well.  I haven't done any work with devices like this, but I see a few
things in those docs that might help.

In their example code, they open the device with: open(“/dev/usbtmc1”,O_RDWR);

That's not exactly the same as what you've been doing.  I would try
opening the file this way in python:
usb_device = open('/dev/usbtmc1', 'w+', buffering=0)

That truncates the file after it opening it, and disables any
buffering that might be going on.

Then, I would try writing to the device with usb_device.write() and
usb_device.read().  read() attempts to read to end-of-file, and based
on the docs, the driver will work okay that way.  Doing that, along
with turning off buffering when you open the file, should eliminate
any issues with the driver failing to emit newlines someplace.

Personally, I would probably try playing with the device from python's
interactive interpreter.  I think that could shed a lot of light on
the behavior you're seeing.

-- 
Jerry

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


Thread

[newbie] problem with usbtmc-communication Jean Dubois <jeandubois314@gmail.com> - 2012-12-04 04:14 -0800
  Re: [newbie] problem with usbtmc-communication wrw@mac.com - 2012-12-04 09:33 -0500
    Re: problem with usbtmc-communication Jean Dubois <jeandubois314@gmail.com> - 2012-12-04 08:12 -0800
      Re: problem with usbtmc-communication wrw@mac.com - 2012-12-05 10:26 -0500
        Re: problem with usbtmc-communication Jean Dubois <jeandubois314@gmail.com> - 2012-12-05 12:38 -0800
          Re: problem with usbtmc-communication wrw@mac.com - 2012-12-05 17:21 -0500
            Re: problem with usbtmc-communication Jean Dubois <jeandubois314@gmail.com> - 2012-12-06 05:50 -0800
              Re: problem with usbtmc-communication wrw@mac.com - 2012-12-06 09:50 -0500
                Re: problem with usbtmc-communication Jean Dubois <jeandubois314@gmail.com> - 2012-12-06 11:41 -0800
                Re: problem with usbtmc-communication Dave Angel <d@davea.name> - 2012-12-06 15:10 -0500
                Re: problem with usbtmc-communication wrw@mac.com - 2012-12-06 15:15 -0500
                Re: problem with usbtmc-communication Jean Dubois <jeandubois314@gmail.com> - 2012-12-07 05:46 -0800
                Re: problem with usbtmc-communication Jean Dubois <jeandubois314@gmail.com> - 2012-12-10 05:31 -0800
                Re: problem with usbtmc-communication wrw@mac.com - 2012-12-10 10:34 -0500
                Re: problem with usbtmc-communication Jean Dubois <jeandubois314@gmail.com> - 2012-12-10 22:58 -0800
                Re: problem with usbtmc-communication wrw@mac.com - 2012-12-11 09:34 -0500
                Re: problem with usbtmc-communication Jean Dubois <jeandubois314@gmail.com> - 2012-12-11 12:48 -0800
                Re: problem with usbtmc-communication wrw@mac.com - 2012-12-11 21:21 -0500
                Re: problem with usbtmc-communication Jerry Hill <malaclypse2@gmail.com> - 2012-12-11 19:49 -0500
                Re: problem with usbtmc-communication Jean Dubois <jeandubois314@gmail.com> - 2012-12-12 08:16 -0800
          Re: problem with usbtmc-communication Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-12-05 18:08 -0500
  Re: [newbie] problem with usbtmc-communication Terry Reedy <tjreedy@udel.edu> - 2012-12-04 14:55 -0500
    Re: problem with usbtmc-communication Jean Dubois <jeandubois314@gmail.com> - 2012-12-06 06:05 -0800
    Re: problem with usbtmc-communication Jean Dubois <jeandubois314@gmail.com> - 2012-12-06 07:44 -0800
      Re: problem with usbtmc-communication Terry Reedy <tjreedy@udel.edu> - 2012-12-06 15:28 -0500
        Re: problem with usbtmc-communication Jean Dubois <jeandubois314@gmail.com> - 2012-12-07 05:51 -0800

csiph-web