Data Types
The datatypes module provides S7 data type definitions and address encoding.
S7 data types and conversion utilities.
Handles S7-specific data types, endianness conversion, and address encoding.
- class snap7.datatypes.S7DataTypes[source]
S7 data type conversion utilities.
- static decode_s7_data(data: bytes, word_len: S7WordLen, count: int) List[bool | int | float][source]
Decode S7 data from bytes to Python values.
Handles Siemens big-endian byte order.
- static encode_address(area: S7Area, db_number: int, start: int, word_len: S7WordLen, count: int) bytes[source]
Encode S7 address into parameter format.
Returns 12-byte parameter section for read/write operations.
- static encode_s7_data(values: Sequence[bool | int | float], word_len: S7WordLen) bytes[source]
Encode Python values to S7 data bytes.
Handles Siemens big-endian byte order.