Logo
- class snap7.logo.Logo(*, auto_reconnect: bool = False, max_retries: int = 3, retry_delay: float = 1.0, backoff_factor: float = 2.0, max_delay: float = 30.0, heartbeat_interval: float = 0, max_requests_per_second: float = 0, rate_limit_algorithm: Literal['fixed', 'token_bucket'] = 'fixed', rate_limit_behavior: Literal['block', 'raise'] = 'block', rate_limit_burst: int | None = None, on_disconnect: Callable[[], None] | None = None, on_reconnect: Callable[[], None] | None = None, **kwargs: object)[source]
A snap7 Siemens Logo client.
There are two main comfort functions available:
Logo.read()andLogo.write(). This function offers high-level access to the VM addresses of the Siemens Logo just use the form:Notes
V10.3 for bit values V10 for the complete byte VW12 for a word (used for analog values) For more information see examples for Siemens Logo 7 and 8
- __init__(*, auto_reconnect: bool = False, max_retries: int = 3, retry_delay: float = 1.0, backoff_factor: float = 2.0, max_delay: float = 30.0, heartbeat_interval: float = 0, max_requests_per_second: float = 0, rate_limit_algorithm: Literal['fixed', 'token_bucket'] = 'fixed', rate_limit_behavior: Literal['block', 'raise'] = 'block', rate_limit_burst: int | None = None, on_disconnect: Callable[[], None] | None = None, on_reconnect: Callable[[], None] | None = None, **kwargs: object) None[source]
Initialize Logo client.
- Parameters:
auto_reconnect – Reconnect automatically after connection loss.
max_retries – Maximum number of reconnection attempts.
retry_delay – Initial reconnection delay in seconds.
backoff_factor – Multiplier for successive retry delays.
max_delay – Maximum reconnection delay in seconds.
heartbeat_interval – Heartbeat interval in seconds (0 disables it).
max_requests_per_second – Maximum outbound requests per second (0 disables it).
rate_limit_algorithm –
fixedfor even spacing ortoken_bucketfor bursts.rate_limit_behavior –
blockto wait orraiseto reject immediately.rate_limit_burst – Token bucket capacity. Defaults to one second of requests.
on_disconnect – Callback invoked when the connection is lost.
on_reconnect – Callback invoked after successful reconnection.
**kwargs – Ignored. Kept for backwards compatibility.
- connect(ip_address: str, tsap_snap7: int, tsap_logo: int, tcp_port: int = 102) Logo[source]
Connect to a Siemens LOGO server.
Notes
Howto setup Logo communication configuration see: https://snap7.sourceforge.net/logo.html
- Parameters:
ip_address – IP ip_address of server
tsap_snap7 – TSAP SNAP7 Client (e.g. 10.00 = 0x1000)
tsap_logo – TSAP Logo Server (e.g. 20.00 = 0x2000)
tcp_port – TCP port of server
- Returns:
The snap7 Logo instance