liblightmodbus
2.0
A lightweight, cross-platform Modbus RTU library
|
Represents Modbus slave device's status and configuration. More...
#include <slave.h>
Data Fields | |
uint8_t | address |
The slave's address. More... | |
ModbusRegisterCallbackFunction | registerCallback |
The pointer to the user-defined register callback function. More... | |
void * | registerCallbackContext |
The user data pointer passed to the callback function each time it's used. More... | |
uint16_t * | registers |
Pointer to registers data. More... | |
uint16_t * | inputRegisters |
Pointer to input registers data. More... | |
uint8_t * | registerMask |
Mask for register write protection (each bit corresponds to one register) More... | |
uint16_t | registerMaskLength |
Write protection mask (registerMask) length in bytes (each byte covers 8 registers) More... | |
uint16_t | registerCount |
Slave's register count. More... | |
uint16_t | inputRegisterCount |
Slave's input register count. More... | |
uint8_t * | coils |
Pointer to coils data. More... | |
uint8_t * | discreteInputs |
Pointer to discrete inputs data. More... | |
uint8_t * | coilMask |
Masks for coil write protection (each bit corresponds to one coil) More... | |
uint16_t | coilMaskLength |
Write protection mask (coilMask) length in bytes (each byte covers 8 coils) More... | |
uint16_t | coilCount |
Slave's coil count. More... | |
uint16_t | discreteInputCount |
Slave's discrete input count. More... | |
ModbusExceptionCode | lastException |
Exception code of the last exception generated by modbusBuildException. More... | |
ModbusFrameError | parseError |
More specific error code of problem encountered during frame parsing. More... | |
ModbusSlaveUserFunction * | userFunctions |
A pointer to user defined Modbus functions array. More... | |
uint16_t | userFunctionCount |
Number of user-defined Modbus functions /see userFunctions. More... | |
struct { | |
uint8_t frame [LIGHTMODBUS_STATIC_MEM_SLAVE_RESPONSE] | |
Statically allocated memory for the response frame. More... | |
uint8_t * frame | |
A pointer to dynamically allocated memory for the response frame. More... | |
uint8_t length | |
Frame length in bytes. More... | |
} | response |
Struct containing slave's response to the master's request. More... | |
struct { | |
uint8_t frame [LIGHTMODBUS_STATIC_MEM_SLAVE_REQUEST] | |
Statically allocated memory for the request frame. More... | |
const uint8_t * frame | |
A pointer to dynamically allocated memory for the request frame. More... | |
uint8_t length | |
Frame length in bytes. More... | |
} | request |
Struct containing master's request frame. More... | |
Represents Modbus slave device's status and configuration.
uint8_t modbusSlave::address |
The slave's address.
uint16_t modbusSlave::coilCount |
Slave's coil count.
uint8_t* modbusSlave::coilMask |
Masks for coil write protection (each bit corresponds to one coil)
uint16_t modbusSlave::coilMaskLength |
Write protection mask (coilMask) length in bytes (each byte covers 8 coils)
uint8_t* modbusSlave::coils |
Pointer to coils data.
uint16_t modbusSlave::discreteInputCount |
Slave's discrete input count.
uint8_t* modbusSlave::discreteInputs |
Pointer to discrete inputs data.
uint8_t modbusSlave::frame[LIGHTMODBUS_STATIC_MEM_SLAVE_REQUEST] |
Statically allocated memory for the response frame.
Statically allocated memory for the request frame.
uint8_t* modbusSlave::frame |
A pointer to dynamically allocated memory for the response frame.
const uint8_t* modbusSlave::frame |
A pointer to dynamically allocated memory for the request frame.
uint16_t modbusSlave::inputRegisterCount |
Slave's input register count.
uint16_t* modbusSlave::inputRegisters |
Pointer to input registers data.
ModbusExceptionCode modbusSlave::lastException |
Exception code of the last exception generated by modbusBuildException.
uint8_t modbusSlave::length |
Frame length in bytes.
ModbusFrameError modbusSlave::parseError |
More specific error code of problem encountered during frame parsing.
This variable is set up by modbusBuildExceptionErr function
ModbusRegisterCallbackFunction modbusSlave::registerCallback |
The pointer to the user-defined register callback function.
LIGHTMODBUS_COIL_CALLBACK
or LIGHTMODBUS_REGISTER_CALLBACK
to be defined void* modbusSlave::registerCallbackContext |
The user data pointer passed to the callback function each time it's used.
uint16_t modbusSlave::registerCount |
Slave's register count.
uint8_t* modbusSlave::registerMask |
Mask for register write protection (each bit corresponds to one register)
uint16_t modbusSlave::registerMaskLength |
Write protection mask (registerMask) length in bytes (each byte covers 8 registers)
uint16_t* modbusSlave::registers |
Pointer to registers data.
struct { ... } modbusSlave::request |
Struct containing master's request frame.
frame
member depends on the library configuration. It can be either a statically allocated array or a pointer to dynamically allocated memory. The behavior is dependant on definition of the LIGHTMODBUS_STATIC_MEM_SLAVE_REQUEST
macrostruct { ... } modbusSlave::response |
Struct containing slave's response to the master's request.
frame
member depends on the library configuration. It can be either a statically allocated array or a pointer to dynamically allocated memory. The behavior is dependant on definition of the LIGHTMODBUS_STATIC_MEM_SLAVE_RESPONSE
macrouint16_t modbusSlave::userFunctionCount |
Number of user-defined Modbus functions /see userFunctions.
ModbusSlaveUserFunction* modbusSlave::userFunctions |
A pointer to user defined Modbus functions array.
SLAVE_USER_FUNCTIONS
module (see Building liblightmodbus)