Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: Nucleo_modbus_protocol_test
ModbusSlaveRTU Class Reference
Modbus RTU class for slave devices. More...
#include <ModbusSlaveRTU.h>
Public Types | |
| enum | MbStatusTypes_t { LISTENING = 0x20, PROCESSING = 0x21, SENDING = 0x23 } |
Public Member Functions | |
| ModbusSlaveRTU (uint8_t id, MessageQueue< uint8_t > *txQueue, MessageQueue< uint8_t > *rxQueue, ThreadSafeArray_t *coilRegisters, ThreadSafeArray_t *inputRegisters, ThreadSafeArray_t *holdingRegisters) | |
| Creates a Modbus Slave RTU object. | |
| void | trigger (void) |
| Function to start the Modbus RTU Slave engine. | |
| MbStatusTypes_t | getStatus (void) |
| Gets the status of the internal FSM. | |
| void | FSM (void) |
| Internal FSM process. | |
Detailed Description
Modbus RTU class for slave devices.
It shares data with other software components via a Message queue object, and can exist more than one Modbus Slave RTU instances in a application program.
Definition at line 36 of file ModbusSlaveRTU.h.
Member Enumeration Documentation
| enum MbStatusTypes_t |
Status of the internal modbus FSM.
- Enumerator:
LISTENING Listening for incomming requests.
PROCESSING Processing received request.
SENDING Sending generated response.
Definition at line 40 of file ModbusSlaveRTU.h.
Constructor & Destructor Documentation
| ModbusSlaveRTU | ( | uint8_t | id, |
| MessageQueue< uint8_t > * | txQueue, | ||
| MessageQueue< uint8_t > * | rxQueue, | ||
| ThreadSafeArray_t * | coilRegisters, | ||
| ThreadSafeArray_t * | inputRegisters, | ||
| ThreadSafeArray_t * | holdingRegisters | ||
| ) |
Creates a Modbus Slave RTU object.
- Parameters:
-
id Mosbus address. txQueue Message queue to write modbus responses into. rxQueue Message queue to read modbus requests from. *coilRegisters Pointer to the memory space reserved for the coil registers. *inputRegisters Pointer to the memory space reserved for the input registers. *inputRegisters Pointer to the memory space reserved for the holding registers.
Definition at line 25 of file ModbusSlaveRTU.cpp.
Member Function Documentation
| void FSM | ( | void | ) |
Internal FSM process.
Definition at line 63 of file ModbusSlaveRTU.cpp.
| ModbusSlaveRTU::MbStatusTypes_t getStatus | ( | void | ) |
Gets the status of the internal FSM.
- Returns:
- Status value as defined in MbStatusTypes_t.
Definition at line 58 of file ModbusSlaveRTU.cpp.
| void trigger | ( | void | ) |
Function to start the Modbus RTU Slave engine.
Definition at line 53 of file ModbusSlaveRTU.cpp.
Generated on Thu Jul 14 2022 20:27:53 by
1.7.2