Skip to content

Commit

Permalink
allowed suppress_end_en, changed Session_read so it won't hang when s…
Browse files Browse the repository at this point in the history
…uppress_end_en==True
  • Loading branch information
hcoffin-vecatom committed Sep 17, 2024
1 parent ecd7b35 commit d441059
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
7 changes: 3 additions & 4 deletions pyvisa_py/sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -796,10 +796,9 @@ def _read(
if current:
out.extend(current)
end_indicator_received = end_indicator_checker(current)
if end_indicator_received:
if not suppress_end_en:
# RULE 6.1.1
return bytes(out), StatusCode.success
if end_indicator_received and not suppress_end_en:
# RULE 6.1.1
return bytes(out), StatusCode.success
else:
if termination_char_en and (term_char in current):
# RULE 6.1.2
Expand Down
6 changes: 1 addition & 5 deletions pyvisa_py/usb.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,6 @@ def _usb_reader():

supress_end_en, _ = self.get_attribute(ResourceAttribute.suppress_end_enabled)

if supress_end_en:
raise ValueError(
"VI_ATTR_SUPPRESS_END_EN == True is currently unsupported by pyvisa-py"
)

term_char, _ = self.get_attribute(ResourceAttribute.termchar)
term_char_en, _ = self.get_attribute(ResourceAttribute.termchar_enabled)

Expand Down Expand Up @@ -306,6 +301,7 @@ def list_resources() -> List[str]:
)
return out


def read(self, count: int) -> Tuple[bytes, StatusCode]:
"""Reads data from device or interface synchronously.
Expand Down

0 comments on commit d441059

Please sign in to comment.