Skip to content

Commit

Permalink
Fix offset for CTD which are 32 bits (numat#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexrudd2 authored May 3, 2024
1 parent ee0edff commit 6ac8b83
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clickplc/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ async def _get_ctd(self, start: int, end: int) -> dict:
if end is not None and (end < 1 or end > 250):
raise ValueError('CTD end must be in [1, 250]')

address = 49152 + start - 1
address = 49152 + 2 * (start - 1) # 32-bit
count = 1 if end is None else (end - start + 1)
registers = await self.read_registers(address, count * 2)
bigendian = Endian.BIG if self.pymodbus35plus else Endian.Big # type:ignore[attr-defined]
Expand Down

0 comments on commit 6ac8b83

Please sign in to comment.