You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
defread_area(self, area: Areas, dbnumber: int, start: int, size: int) ->bytearray:
"""Reads a data area from a PLC With it you can read DB, Inputs, Outputs, Merkers, Timers and Counters. Args: area: area to be read from. dbnumber: number of the db to be read from. In case of Inputs, Marks or Outputs, this should be equal to 0. start: byte index to start reading. size: number of bytes to read. Returns: Buffer with the data read. Raises: :obj:`ValueError`: if the area is not defined in the `Areas` Example: >>> import snap7 >>> client = snap7.client.Client() >>> client.connect("192.168.0.1", 0, 0) >>> buffer = client.read_area(Areas.DB, 1, 10, 4) # Reads the DB number 1 from the byte 10 to the byte 14. >>> buffer bytearray(b'\\x00\\x00') """
dbnumber: number of the db to be read from. In case of Inputs, Marks or Outputs, this should be equal to 0.
from snap7 reference
DB Number if Area = S7AreaDB, otherwise is ignored.
I think maybe use dbnumber: number of the db to be read from when area type is DB, otherwise is ignored to consist with snap7 and less confused.
The text was updated successfully, but these errors were encountered:
from snap7 reference
I think maybe use
dbnumber: number of the db to be read from when area type is DB, otherwise is ignored
to consist with snap7 and less confused.The text was updated successfully, but these errors were encountered: