State
pyrung.core.state
Immutable system state for PLC simulation.
The core data structure for the Redux-style architecture. All state transitions produce new SystemState instances.
SystemState
Bases: PRecord
Immutable snapshot of PLC state at a point in time.
Attributes:
| Name | Type | Description |
|---|---|---|
scan_id |
Monotonically increasing scan counter. |
|
timestamp |
Simulation clock in seconds. |
|
tags |
Immutable mapping of tag names to values (bool, int, float, str). |
|
memory |
Immutable mapping for internal state (timers, counters, etc). |
with_tags
Return new state with updated tags. Original unchanged.
with_memory
Return new state with updated memory. Original unchanged.