pyvisa / pyvisa-py

A pure python PyVISA backend
https://pyvisa-py.readthedocs.io
MIT License
288 stars 124 forks source link

Very slow visalib.read() with instruments connected by USB #48

Closed ayrodriguez closed 8 years ago

ayrodriguez commented 9 years ago

The visalib.read() function takes about 6 seconds to return, whereas with usbtmc it's instantaneous.

pyvisa version 1.8.dev0 pyvisa-py version 0.2.dev2

hgrecco commented 9 years ago

Sorry but I missed this, can you provide more info.

herm commented 9 years ago

I'm having the same issue. The problem is located here: https://github.com/hgrecco/pyvisa-py/blob/master/pyvisa-py/usb.py#L98

USB communication never checks for the termination character but instead always uses the timeout.

hgrecco commented 9 years ago

Please submit a PR, I will be happy to review it and merge it during the weekend.

herm commented 9 years ago

I'm not sure how to fix it correctly. lambda current: term_char_en and current.endswith(chr(term_char)) works, but I think term_char_en should default to True for TMC but I don't know what the best place would be to set it. I will try to find a solution for this next week.

herm commented 9 years ago

This should be fixed now.

hgrecco commented 9 years ago

@ayrodriguez Please confirm that this is fixed for you and close it! Thanks for the report and Thanks @herm for the fix!

hgrecco commented 8 years ago

I am closing this for now. Feel free to reopen or open another if necessary.