|
ProtoCore v0.0.2
Deterministic, zero-heap network stack for embedded targets
|
Modbus-master southbound driver adapter (PC_ENABLE_SOUTHBOUND && PC_ENABLE_MODBUS_MASTER). More...
#include "protocore_config.h"#include "services/fieldbus/modbus/modbus.h"#include "services/net/southbound/southbound.h"#include <stddef.h>#include <stdint.h>Go to the source code of this file.
Modbus-master southbound driver adapter (PC_ENABLE_SOUTHBOUND && PC_ENABLE_MODBUS_MASTER).
Binds the transport-agnostic Modbus TCP master codec (services/fieldbus/modbus/modbus_master) into the southbound driver framework (services/net/southbound), so an app addresses a Modbus slave the same way as any other field device: register the driver, then read/write points (register addresses) by name through the one facade. A point id is a register address; the block (matrix) path is the atomic multi-register transfer a single Modbus request satisfies (read up to 125, write up to 123 registers).
A holding-register driver (FC 0x03) is read/write: read / read_block use FC 0x03/0x04, write / write_block use Write Single (FC 0x06) / Write Multiple (FC 0x10). An input-register driver (FC 0x04) is read-only - a Modbus input register cannot be written - so its write / write_block stay unbound (the framework reports Sb::SB_ERR_UNSUPPORTED).
The app owns the transport: it supplies a pc_sb_modbus_txn seam that sends a request ADU and receives the reply (over pc_client for Modbus TCP, or a serial gateway). Pure otherwise - no heap, no sockets, host-testable with a mock transaction routed straight into the slave codec.
Definition in file sb_modbus.h.