{"action":"created","issue":{"url":"https://api.github.com/repos/hgrecco/pyvisa/issues/134","labels_url":"https://api.github.com/repos/hgrecco/pyvisa/issues/134/labels{/name}","comments_url":"https://api.github.com/repos/hgrecco/pyvisa/issues/134/comments","events_url":"https://api.github.com/repos/hgrecco/pyvisa/issues/134/events","html_url":"https://github.com/hgrecco/pyvisa/issues/134","id":68300604,"number":134,"title":"No error thrown when resource doesn't exist","user":{"login":"timrae","id":2818274,"avatar_url":"https://avatars.githubusercontent.com/u/2818274?v=3","gravatar_id":"","url":"https://api.github.com/users/timrae","html_url":"https://github.com/timrae","followers_url":"https://api.github.com/users/timrae/followers","following_url":"https://api.github.com/users/timrae/following{/other_user}","gists_url":"https://api.github.com/users/timrae/gists{/gist_id}","starred_url":"https://api.github.com/users/timrae/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timrae/subscriptions","organizations_url":"https://api.github.com/users/timrae/orgs","repos_url":"https://api.github.com/users/timrae/repos","events_url":"https://api.github.com/users/timrae/events{/privacy}","received_events_url":"https://api.github.com/users/timrae/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-04-14T08:18:24Z","updated_at":"2015-05-19T03:43:43Z","closed_at":"2015-05-19T03:43:43Z","body":"I just updated to v1.6.1.2 from something much older (not sure which version sorry), and while I used to get an exception when I opened an instrument that wasn't switched on, I now get a `GPIBInstrument` object back without any failures:\r\n\r\n```\r\nrm=pyvisa.ResourceManager()\r\nrm.open_resource(\"GPIB::15\")\r\n<'GPIBInstrument'(u'GPIB0::15::INSTR')>\r\n```\r\n\r\n```\r\n>>> rm.list_resources()\r\n(u'ASRL1::INSTR', u'ASRL10::INSTR', u'ASRL15::INSTR', u'GPIB0::20::INSTR', u'GPIB0::25::INSTR')\r\n```\r\n\r\nQuerying the instrument leads to the following error:\r\n\r\n```\r\n>>> i.query(\"*IDN?\")\r\nTraceback (most recent call last):\r\n  File \"<stdin>\", line 1, in <module>\r\n  File \"C:\\Users\\Tim-Lab\\AppData\\Local\\Enthought\\Canopy\\User\\lib\\site-packages\\pyvisa\\resources\\messagebased.py\", line 378, in query\r\n    self.write(message)\r\n  File \"C:\\Users\\Tim-Lab\\AppData\\Local\\Enthought\\Canopy\\User\\lib\\site-packages\\pyvisa\\resources\\messagebased.py\", line 184, in write\r\n    count = self.write_raw(message.encode(enco))\r\n  File \"C:\\Users\\Tim-Lab\\AppData\\Local\\Enthought\\Canopy\\User\\lib\\site-packages\\pyvisa\\resources\\messagebased.py\", line 162, in write_raw\r\n    return self.visalib.write(self.session, message)\r\n  File \"C:\\Users\\Tim-Lab\\AppData\\Local\\Enthought\\Canopy\\User\\lib\\site-packages\\pyvisa\\ctwrapper\\functions.py\", line 1854, in write\r\n    ret = library.viWrite(session, data, len(data), byref(return_count))\r\n  File \"C:\\Users\\Tim-Lab\\AppData\\Local\\Enthought\\Canopy\\User\\lib\\site-packages\\pyvisa\\ctwrapper\\highlevel.py\", line 180, in _return_handler\r\n    raise errors.VisaIOError(ret_value)\r\nVisaIOError: VI_ERROR_NLISTENERS (-1073807265): No listeners condition is detected (both NRFD and NDAC are deasserted).\r\n```\r\n\r\nIs there a way to re-enable the old behavior, or a better way to test if the instrument is available other than catching an exception to `query`? I've tried updating to the latest development version (56515d3d00543b37b44f35f41fbc53a2e7b7b34c) with no luck"},"comment":{"url":"https://api.github.com/repos/hgrecco/pyvisa/issues/comments/103322182","html_url":"https://github.com/hgrecco/pyvisa/issues/134#issuecomment-103322182","issue_url":"https://api.github.com/repos/hgrecco/pyvisa/issues/134","id":103322182,"user":{"login":"hgrecco","id":278566,"avatar_url":"https://avatars.githubusercontent.com/u/278566?v=3","gravatar_id":"","url":"https://api.github.com/users/hgrecco","html_url":"https://github.com/hgrecco","followers_url":"https://api.github.com/users/hgrecco/followers","following_url":"https://api.github.com/users/hgrecco/following{/other_user}","gists_url":"https://api.github.com/users/hgrecco/gists{/gist_id}","starred_url":"https://api.github.com/users/hgrecco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hgrecco/subscriptions","organizations_url":"https://api.github.com/users/hgrecco/orgs","repos_url":"https://api.github.com/users/hgrecco/repos","events_url":"https://api.github.com/users/hgrecco/events{/privacy}","received_events_url":"https://api.github.com/users/hgrecco/received_events","type":"User","site_admin":false},"created_at":"2015-05-19T03:43:43Z","updated_at":"2015-05-19T03:43:43Z","body":"I am closing this. Feel free to reopen if needed."}}