|
liblightmodbus
2.0
A lightweight, cross-platform Modbus RTU library
|
Represents Modbus master device's status and configuration. More...
#include <master.h>
Collaboration diagram for modbusMaster:Data Fields | |
| uint8_t | predictedResponseLength |
| Predicted number of response bytes to be received from slave upon succesful request. More... | |
| struct { | |
| uint8_t frame [LIGHTMODBUS_STATIC_MEM_MASTER_REQUEST] | |
| Statically allocated memory for the request frame. More... | |
| uint8_t * frame | |
| A pointer to dynamically allocated memory for the request frame. More... | |
| uint8_t length | |
| Length of the request frame in bytes. More... | |
| } | request |
| Struct containing master's request for the slave. More... | |
| struct { | |
| uint8_t frame [LIGHTMODBUS_STATIC_MEM_MASTER_RESPONSE] | |
| Statically allocated memory for the response frame. More... | |
| const uint8_t * frame | |
| A pointer to dynamically allocated memory for the response frame. More... | |
| uint8_t length | |
| Length of the response frame in bytes. More... | |
| } | response |
| Struct containing slave's response to the master's request. More... | |
| struct { | |
| uint8_t address | |
| Addres of slave that sent in the data. More... | |
| uint16_t index | |
| Modbus address of the first register/coil. More... | |
| uint16_t count | |
| Number of data units (coils, registers, etc.) More... | |
| uint8_t length | |
| Length of data in bytes. More... | |
| ModbusDataType type | |
| Type of data. More... | |
| uint8_t function | |
| Function that accessed the data. More... | |
| union { | |
| uint8_t coils [LIGHTMODBUS_STATIC_MEM_MASTER_DATA] | |
| Statically allocated array for received coils data. More... | |
| uint16_t regs [LIGHTMODBUS_STATIC_MEM_MASTER_DATA >> 1] | |
| Statically allocated array for received registers data. More... | |
| } | |
| uint8_t * coils | |
| A pointer to dynamically allocated memory for the received coils data. More... | |
| uint16_t * regs | |
| A pointer to dynamically allocated memory for the received registers data. More... | |
| } | data |
| Contains data received from the slave. More... | |
| struct { | |
| uint8_t address | |
| Slave device address. More... | |
| uint8_t function | |
| Function that has thrown the exception. More... | |
| ModbusExceptionCode code | |
| Exception code. More... | |
| } | exception |
| Contains exception data received from the slave. More... | |
| ModbusFrameError | parseError |
| More precise information according encountered frame parsing error. More... | |
| ModbusFrameError | buildError |
| More precise information according encountered frame building error. More... | |
| ModbusMasterUserFunction * | userFunctions |
| A pointer to an array of user-defined Modbus functions. More... | |
| uint16_t | userFunctionCount |
| Number of the user functions in the array. More... | |
Represents Modbus master device's status and configuration.
| uint8_t modbusMaster::address |
Addres of slave that sent in the data.
Slave device address.
| ModbusFrameError modbusMaster::buildError |
More precise information according encountered frame building error.
| ModbusExceptionCode modbusMaster::code |
Exception code.
| uint8_t modbusMaster::coils[LIGHTMODBUS_STATIC_MEM_MASTER_DATA] |
Statically allocated array for received coils data.
Each bit of this array corresponds to one coil value.
| uint8_t* modbusMaster::coils |
A pointer to dynamically allocated memory for the received coils data.
Each bit of this array corresponds to one coil value.
| uint16_t modbusMaster::count |
Number of data units (coils, registers, etc.)
| struct { ... } modbusMaster::data |
Contains data received from the slave.
The space for data inside this structure can either be dynamically or statically allocated (see Disabling dynamic memory allocation).
| struct { ... } modbusMaster::exception |
Contains exception data received from the slave.
| uint8_t modbusMaster::frame[LIGHTMODBUS_STATIC_MEM_MASTER_RESPONSE] |
Statically allocated memory for the request frame.
Statically allocated memory for the response frame.
| uint8_t* modbusMaster::frame |
A pointer to dynamically allocated memory for the request frame.
| const uint8_t* modbusMaster::frame |
A pointer to dynamically allocated memory for the response frame.
| uint8_t modbusMaster::function |
Function that accessed the data.
Function that has thrown the exception.
| uint16_t modbusMaster::index |
Modbus address of the first register/coil.
| uint8_t modbusMaster::length |
Length of the request frame in bytes.
Length of data in bytes.
Length of the response frame in bytes.
| ModbusFrameError modbusMaster::parseError |
More precise information according encountered frame parsing error.
| uint8_t modbusMaster::predictedResponseLength |
Predicted number of response bytes to be received from slave upon succesful request.
| uint16_t modbusMaster::regs[LIGHTMODBUS_STATIC_MEM_MASTER_DATA >> 1] |
Statically allocated array for received registers data.
Data in this array always has currently used platform's native endianness.
| uint16_t* modbusMaster::regs |
A pointer to dynamically allocated memory for the received registers data.
Data in this array always has currently used platform's native endianness.
| struct { ... } modbusMaster::request |
Struct containing master's request for the slave.
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_MASTER_REQUEST macro| struct { ... } modbusMaster::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_MASTER_RESPONSE macro| ModbusDataType modbusMaster::type |
Type of data.
| uint16_t modbusMaster::userFunctionCount |
Number of the user functions in the array.
| ModbusMasterUserFunction* modbusMaster::userFunctions |
A pointer to an array of user-defined Modbus functions.
1.8.13