2010/12/22 Venkat, Karthikeyan <kvenk...@jaguarlandrover.com>:
> Hello everyone,
>
> I am a total newbie to pythonUSB.
>
> I am using the PyUSB interface for one of the devices which has a FTDI chip.
>
> I could read the device ID and get the serial number of it.
>
> I need to read and write data to the device.
>
> The example provided on the website is not sufficient to read or write data.
>
> Could you provide some examples which i could try out so that i can talk
> with the device?
>
> I have refered the programmers guide for D2XX programming but it seems to be
> written for C programming.
> I tried to modify to suit to a python environment.
>
> For eg,  in the code below:
>
> # ----------
> # import the PyUSB module
> import d2xx
> global EventDword,TxBytes,RxBytes,
> BytesReceived
> EventDword =TxBytes=RxBytes=BytesReceived=0
> # list devices by description, returns tuple of attached devices description
> strings
> d = d2xx.listDevices(d2xx.OPEN_BY_DESCRIPTION)
> print d
>
> # list devices by serial, returns tuple of attached devices serial strings
> d = d2xx.listDevices() # implicit d2xx.OPEN_BY_SERIAL_NUMBER
> print d
>
> h = d2xx.open(0)
> print h
>
> # get queue status
> print h.getQueueStatus()
>
> # set RX/TX timeouts
> h.setTimeouts(1000,1000)
>
> print h.read(5)
>
>
> # ----------
> The python interpreter exits once it reaches print h.read(5).
>
> I need read data from the device and write to it as well.
>
> The device is  data acquisition system which is connected to the PC via a
> USB cable.
>
> The output received for execution of the code till it reaches the Read is as
> below:
>
>>> ('USB Interface IF-U1',)
>>>> ('EAT2QBD0',)
>>>> <FtobjType object at 0x00A17300>
>>>> 0
> [Dbg]>>>
>
> This tells me that i am connected to the device and get the object of it.
> But i need to use it and read and write data from the device as well.
>
> Any help in this regard is highly appreciated.
>
I am afraid this is the wrong PyUSB mailing list... There is a bit of
confusion because there are two PyUSB's. This one which is a generic
USB module for Python and PyUSB FTDI module, which is that you are
using....

-- 
Best Regards,
Wander Lairson Costa
LCoN - Laboratório de Computação Natural - Natural Computing Laboratory
(http://www.mackenzie.com.br/lcon.html)
Programa de Pós-Graduação em Engenharia Elétrica (PPGEE)
Faculdade de Computação e Informática (FCI)
Universidade Presbiteriana Mackenzie - SP - Brazil

------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your 
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
pyusb-users mailing list
pyusb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyusb-users

Reply via email to