"""PLC 通信层。 对外只暴露三样东西: * :func:`build_publisher` —— 按配置创建发布器(Modbus 从站 / S7 推送 / 两者); * :class:`~portcv.plc.publisher.PlcPublisher` —— 发布器接口; * :class:`~portcv.plc.modbus_server.ModbusTcpServer` —— 需要自己做探测/自检时直接用。 寄存器映射与 PLC 侧约定详见 :mod:`portcv.schema`(数据来源)与 :mod:`portcv.plc.modbus_server`(地址规划)。 """ from .modbus_server import ModbusTcpServer from .publisher import ( ModbusServerPublisher, MultiPublisher, NullPublisher, PlcPublisher, build_publisher, ) from .registers import ( CMD_CLEAR_STATS, CMD_IDLE, CMD_LABELS, CMD_REQUEST, CMD_RESET, COMMAND_FIELD_NOTES, SCL_SNIPPET, SNAPSHOT_FIELD_NOTES, addresses, command_rows, decode_command, decode_snapshot, encode_command, encode_snapshot, flag_bits, holding_offsets, input_offsets, snapshot_rows, ) __all__ = [ "CMD_CLEAR_STATS", "CMD_IDLE", "CMD_LABELS", "CMD_REQUEST", "CMD_RESET", "COMMAND_FIELD_NOTES", "ModbusServerPublisher", "ModbusTcpServer", "MultiPublisher", "NullPublisher", "PlcPublisher", "SCL_SNIPPET", "SNAPSHOT_FIELD_NOTES", "addresses", "build_publisher", "command_rows", "decode_command", "decode_snapshot", "encode_command", "encode_snapshot", "flag_bits", "holding_offsets", "input_offsets", "snapshot_rows", ]