timeout
This commit is contained in:
@@ -133,11 +133,21 @@ class PrologixEndpointLoop:
|
|||||||
from pymeasure.adapters import PrologixAdapter # type: ignore
|
from pymeasure.adapters import PrologixAdapter # type: ignore
|
||||||
|
|
||||||
res = self.endpoint.conn["resource"]
|
res = self.endpoint.conn["resource"]
|
||||||
to_ms = int(self.endpoint.conn.get("gpib_read_timeout_ms", 500))
|
gpib_to_ms = int(self.endpoint.conn.get("gpib_read_timeout_ms", 5000))
|
||||||
log.info(f"gpib_read_timeout_ms set to {to_ms}")
|
serial_to_ms = int(
|
||||||
|
self.endpoint.conn.get("serial_timeout_ms", gpib_to_ms + 2000)
|
||||||
|
)
|
||||||
|
|
||||||
|
log.info(f"gpib_read_timeout_ms set to {gpib_to_ms}")
|
||||||
|
log.info(f"serial_timeout_ms set to {serial_to_ms}")
|
||||||
|
|
||||||
# auto=False gives us manual control over addressing
|
# auto=False gives us manual control over addressing
|
||||||
self._adapter = PrologixAdapter(res, gpib_read_timeout=to_ms, auto=False)
|
self._adapter = PrologixAdapter(
|
||||||
|
res,
|
||||||
|
gpib_read_timeout=gpib_to_ms,
|
||||||
|
serial_timeout=serial_to_ms,
|
||||||
|
auto=False,
|
||||||
|
)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self._adapter.flush_read_buffer()
|
self._adapter.flush_read_buffer()
|
||||||
|
|||||||
Reference in New Issue
Block a user