{"action":"created","issue":{"url":"https://api.github.com/repos/Galvant/InstrumentKit/issues/127","repository_url":"https://api.github.com/repos/Galvant/InstrumentKit","labels_url":"https://api.github.com/repos/Galvant/InstrumentKit/issues/127/labels{/name}","comments_url":"https://api.github.com/repos/Galvant/InstrumentKit/issues/127/comments","events_url":"https://api.github.com/repos/Galvant/InstrumentKit/issues/127/events","html_url":"https://github.com/Galvant/InstrumentKit/issues/127","id":160215741,"number":127,"title":"libusb0-dll:err [control_msg] on usbtmc","user":{"login":"CatherineH","id":1953328,"avatar_url":"https://avatars.githubusercontent.com/u/1953328?v=3","gravatar_id":"","url":"https://api.github.com/users/CatherineH","html_url":"https://github.com/CatherineH","followers_url":"https://api.github.com/users/CatherineH/followers","following_url":"https://api.github.com/users/CatherineH/following{/other_user}","gists_url":"https://api.github.com/users/CatherineH/gists{/gist_id}","starred_url":"https://api.github.com/users/CatherineH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CatherineH/subscriptions","organizations_url":"https://api.github.com/users/CatherineH/orgs","repos_url":"https://api.github.com/users/CatherineH/repos","events_url":"https://api.github.com/users/CatherineH/events{/privacy}","received_events_url":"https://api.github.com/users/CatherineH/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-06-14T15:45:32Z","updated_at":"2016-06-15T16:15:27Z","closed_at":null,"body":"I've moved the tektronix scope back to the lab, so I need to test the latest bug fixes on the windows lab computer instead of my linux computer. I've encountered an error generated by libusb/pyusb, however, it doesn't occur with usbtmc alone. For comparison, here is the working code in usbtmc:\r\n\r\n```\r\nfrom usbtmc import Instrument\r\ninstr = Instrument(0x0699, 0x0365)\r\nprint(instr.ask(\"*IDN?\"))\r\n```\r\nThis results in the expected result.\r\n\r\nand here is my equivalent InstrumentKit code:\r\n\r\n```\r\nfrom instruments.tektronix import TekTDS224\r\ntek = TekTDS224.open_usbtmc(idVendor=0x0699, idProduct=0x0365)\r\nprint(tek.query(\"*IDN?\"))\r\n```\r\n\r\nwhich produces the error:\r\n\r\n```\r\nTraceback (most recent call last):\r\n  File \"~\\InstrumentKit\\doc\\examples\\tektronix\\usbtmc_example.py\", line 8, in <module>\r\n    print(tek.query(\"*IDN?\"))\r\n  File \"~\\InstrumentKit\\instruments\\abstract_instruments\\instrument.py\", line 132, in query\r\n    value = self._file.query(cmd, size)\r\n  File \"~\\InstrumentKit\\instruments\\abstract_instruments\\comm\\abstract_comm.py\", line 233, in query\r\n    resp = self._query(msg, size)\r\n  File \"~\\InstrumentKit\\instruments\\abstract_instruments\\comm\\usbtmc_communicator.py\", line 181, in _query\r\n    return self._filelike.ask(msg, num=size, encoding=\"utf-8\")\r\n  File \"C:\\Python34\\lib\\site-packages\\python_usbtmc-0.7-py3.4.egg\\usbtmc\\usbtmc.py\", line 575, in ask\r\n  File \"C:\\Python34\\lib\\site-packages\\python_usbtmc-0.7-py3.4.egg\\usbtmc\\usbtmc.py\", line 555, in write\r\n  File \"C:\\Python34\\lib\\site-packages\\python_usbtmc-0.7-py3.4.egg\\usbtmc\\usbtmc.py\", line 464, in write_raw\r\n  File \"C:\\Python34\\lib\\site-packages\\python_usbtmc-0.7-py3.4.egg\\usbtmc\\usbtmc.py\", line 338, in open\r\n  File \"C:\\Python34\\lib\\site-packages\\python_usbtmc-0.7-py3.4.egg\\usbtmc\\usbtmc.py\", line 645, in clear\r\n  File \"C:\\Python34\\lib\\site-packages\\pyusb-1.0.0rc1-py3.4.egg\\usb\\core.py\", line 1043, in ctrl_transfer\r\n  File \"C:\\Python34\\lib\\site-packages\\pyusb-1.0.0rc1-py3.4.egg\\usb\\backend\\libusb0.py\", line 588, in ctrl_transfer\r\n  File \"C:\\Python34\\lib\\site-packages\\pyusb-1.0.0rc1-py3.4.egg\\usb\\backend\\libusb0.py\", line 425, in _check\r\nusb.core.USBError: [Errno None] b'libusb0-dll:err [control_msg] sending control message failed, win error: The I/O operation has been aborted because of either a thread exit or an application request.\\r\\n\\n'\r\n```\r\n\r\nThis bug is probably difficult to diagnose from a distance without a usbtmc device, so I'll poke around."},"comment":{"url":"https://api.github.com/repos/Galvant/InstrumentKit/issues/comments/226238926","html_url":"https://github.com/Galvant/InstrumentKit/issues/127#issuecomment-226238926","issue_url":"https://api.github.com/repos/Galvant/InstrumentKit/issues/127","id":226238926,"user":{"login":"CatherineH","id":1953328,"avatar_url":"https://avatars.githubusercontent.com/u/1953328?v=3","gravatar_id":"","url":"https://api.github.com/users/CatherineH","html_url":"https://github.com/CatherineH","followers_url":"https://api.github.com/users/CatherineH/followers","following_url":"https://api.github.com/users/CatherineH/following{/other_user}","gists_url":"https://api.github.com/users/CatherineH/gists{/gist_id}","starred_url":"https://api.github.com/users/CatherineH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CatherineH/subscriptions","organizations_url":"https://api.github.com/users/CatherineH/orgs","repos_url":"https://api.github.com/users/CatherineH/repos","events_url":"https://api.github.com/users/CatherineH/events{/privacy}","received_events_url":"https://api.github.com/users/CatherineH/received_events","type":"User","site_admin":false},"created_at":"2016-06-15T16:15:27Z","updated_at":"2016-06-15T16:15:27Z","body":"Digging further...\r\n\r\nI placed .ask() commands at several steps, one within the USBTMCCommunicator initialization, one  within open_usbtmc, and the final after open_usbtmc(). \r\n\r\nThe first two execute as expected, but the final results in a timeout error:\r\n\r\n```\r\nin initialization  TEKTRONIX,TDS 2004B,C033931,CF:91.1CT FV:v22.01\r\nin open_usbtmc,  TEKTRONIX,TDS 2004B,C033931,CF:91.1CT FV:v22.01\r\nTraceback (most recent call last):\r\n  File \"~\\InstrumentKit\\doc\\examples\\tektronix\\usbtmc_example.py\", line 14, in <module>\r\n    print(\"in main, \", tek._file._filelike.ask(\"*IDN?\"))\r\n  File \"C:\\Python34\\lib\\site-packages\\python_usbtmc-0.7-py3.4.egg\\usbtmc\\usbtmc.py\", line 576, in ask\r\n  File \"C:\\Python34\\lib\\site-packages\\python_usbtmc-0.7-py3.4.egg\\usbtmc\\usbtmc.py\", line 559, in read\r\n  File \"C:\\Python34\\lib\\site-packages\\python_usbtmc-0.7-py3.4.egg\\usbtmc\\usbtmc.py\", line 508, in read_raw\r\n  File \"C:\\Python34\\lib\\site-packages\\pyusb-1.0.0rc1-py3.4.egg\\usb\\core.py\", line 402, in read\r\n  File \"C:\\Python34\\lib\\site-packages\\pyusb-1.0.0rc1-py3.4.egg\\usb\\core.py\", line 988, in read\r\n  File \"C:\\Python34\\lib\\site-packages\\pyusb-1.0.0rc1-py3.4.egg\\usb\\backend\\libusb0.py\", line 537, in bulk_read\r\n  File \"C:\\Python34\\lib\\site-packages\\pyusb-1.0.0rc1-py3.4.egg\\usb\\backend\\libusb0.py\", line 622, in __read\r\n  File \"C:\\Python34\\lib\\site-packages\\pyusb-1.0.0rc1-py3.4.egg\\usb\\backend\\libusb0.py\", line 425, in _check\r\nusb.core.USBError: [Errno None] b'libusb0-dll:err [_usb_reap_async] timeout error\\n'\r\n```"}}
{"actor":{"display_login":"CatherineH"}}