Files
syr4ok d6e9ac13d1 refactor: make modbus controller cross-platform and improve locking
- Added cross-platform file locking using msvcrt (Windows) and fcntl (Unix).
- Switched to pathlib for robust path management and automatic directory creation.
- Updated is_host_reachable to support Windows ping syntax.
- Added atexit handler to ensure lock file descriptors are closed properly.

NOTE: Verified on Linux (LMDE 7). Windows compatibility implemented but not yet tested.
2026-04-10 15:27:23 +03:00

12 lines
527 B
Plaintext

[modbus]
host = 192.168.X.X # IP address of the Modbus device
port = 4196 # Port number for the Modbus device
unit = 1 # Unit ID for the Modbus channel
coil_base = 1 # Base address for coils (0 for 0-7 channel use, 1 for 1-8 channel use)
timeout = 1 # Timeout value in seconds
max_channel = 7 # Maximum number of channels of the Modbus device model (7 - 0-7, as 8 channels summary)
[paths]
lock_file = modbus_controller.lock
log_file = modbus_logs/modbus_controller.log