Closed Schneider1 closed 4 years ago
Thanks for the report. So obviously we need to fix the timeout implementation to avoid the infinite loop in the case where we expect a new packet but none show up.
After lets say I am not exactly surprised that NI-VISA has workaround for imperfect implementation of the protocol. I tried to check the VXI-11 specification but it does not suggest that this is an ok behavior. I am not sure however how to best handle it in pyvisa-py. One way would be to add a way to specify the number of packet expected when receiving records and force it to be one when creating the link. I am honestly a bit worried by this solution since the specification never mentions how many packets will be used for an operation. But I do not see a another workaround. Do not hesitate to open a PR if you come up with a solution, I personally won't have time to work on this soon.
Instrument details
Output of
pyvisa-info
Opening the connection with
rm.open_resource('TCPIP0::10.22.197.10')
gets stuck in an infinite loop, without throwing a timeout.After some search, I found that pyvisa-py keeps waiting for a second segment, since the first segment has the "last" flag disabled. However, there is no next segment sent. So this looks like a bug in the device, BUT when I try the same using the NI-VISA backend, everything works well. In the latter case, I checked with Wireshark that device again sends the "last=False" flag (resulting in a RPC Fragment), but NI-VISA can shomehow cope with the situation.
If I do a very dirty fix and set
last=True
in protocols/rpc.py:377, everything works fine and all other commands set the "last" flag correctly.Any ideas, why this device behaves so strange? Why does NI-VISA not have a problem with that? How can I solve this?