Class CpModbusRelay
Defined in File cp_modbus_relay.hpp
Inheritance Relationships
Base Type
public smacc2::ISmaccComponent
Class Documentation
-
class CpModbusRelay : public smacc2::ISmaccComponent
Component that handles Modbus coil read/write operations for 8-channel relay.
Responsibilities:
Write single coil (channel on/off)
Write all coils simultaneously
Read single coil status
Read all coil statuses
Emit operation result signals
Channel numbering: 1-8 (user-friendly) Coil addresses: 0x0000-0x0007 (0-indexed internally)
Public Functions
-
CpModbusRelay()
-
virtual ~CpModbusRelay()
-
void onInitialize() override
-
template<typename TOrthogonal, typename TClient>
inline void onStateOrthogonalAllocation() Configure component for event posting during orthogonal allocation.
-
bool writeCoil(int channel, bool state)
-
bool readCoil(int channel, bool &state)
-
bool writeAllCoils(bool state)
-
bool writeAllCoils(uint8_t mask)
-
bool readAllCoils(uint8_t &states)
-
template<typename T>
inline smacc2::SmaccSignalConnection onWriteSuccess(void (T::* callback)(int, bool), T *object)