Offset for response data in PDU.
Modbus controller handler structure
Characteristics descriptor type is used to describe characteristic and link it with Modbus parameters that reflect its data.
Modbus controller handler structure
Modbus register request type structure
Device communication structure to setup Modbus controller
Offset of function code in PDU.
Modbus area descriptor list item
protocol stack in illegal state.
Modbus Event Stack started
Modbus slave addr list item for the master
Pointers to information about connected clients
Parameter access event information type
Most modules in the protocol stack are completly optional and can be excluded. This is specially important if target resources are very small and program memory space should be saved. All of these settings are available in the file mbconfig.h
Modbus controller interface structure
Modbus controller semaphore
illegal register address.
Request mode for parameter to use in data dictionary
The key (name) of the parameter
Modbus controller event group
Master information structure for each connected slave
The total slaves in Modbus Master system.
Read register values and pass to protocol stack.
Modbus communication info
Modbus data buffer pointer
controller notification queue
Parameter storage area descriptor
Modbus controller parameter description table
Size of mb parameter in registers
Master count of connected slaves
Transaction identifier (TID) for slave
Float, U8, U16, U32, ASCII, etc.
Character for high nibble of byte.
Request receive data error.
Request execute function error.
Modbus start address for area descriptor
register area descriptors
TCP/UDP IP address (string)
Receiver is in idle state.
Receive frame data error.
Modbus controller parameter description table size
Interface get_cid_info method
Interface get_parameter method
Interface send_request method
Interface set_descriptor method
Interface set_parameter method
Stack callback discrete rw method
Stack callback input rw method
Stack callback holding rw method
Stack callback coils rw method
Maximum number of Modbus functions codes the protocol stack should support. The maximum number of supported Modbus functions must be greater than the sum of all enabled functions in this file and custom function handlers. If set to small adding more functions will fail.
Interface method check_event
Interface method get_param_info
buffer left bytes to receive transaction
Number of bytes in the parameter.
Slave address information list
Modbus transacion info structure
Instance address for storage area descriptor
last TID counter from packet
Master current slave information
Type of storage area descriptor
the characteristic of the device are readable & writable & triggerable
Offset of Modbus-PDU in Ser-PDU.
Device communication parameters for master
Slave address of device in the Modbus segment
If master send a frame which is not broadcast,the master will wait sometime for slave. And if slave is not respond in this time,the master will process this timeout error.
Device communication parameters for master
Interface method set_descriptor
Stack callback discrete rw method
Stack callback input rw method
Stack callback holding rw method
Stack callback coils rw method
receive response timestamp
Protocol type used by port
Receive response time stamp
Modbus start address for area descriptor
Receiver is in idle state.
Frame is beeing received.
Character for low nibble of byte.
Maximum size of a Modbus frame.
Offset of slave address in Ser-PDU.
Callback function for the porting layer when a new byte is available. Depending upon the mode this callback function is used by the RTU or ASCII transmission layers. In any case a call to xMBPortSerialGetByte() must immediately return a new character.
Modbus number of registers
Modbus parameter options for description table
illegal register address.
Transaction information structure.
The macro to access arrays of elements for type conversion.
Number of bytes which should be allocated for the Report Slave ID command. This number limits the maximum size of the additional segment in the report slave id function. See eMBSetSlaveID( ) for more information on how to set this value. It is only used if MB_FUNC_OTHER_REP_SLAVEID_ENABLED is set to 1.
Master TCP/UDP handling task handle
represents the IP address of the slave
Instance address for storage area descriptor
Instance size for area descriptor (bytes)
Modbus Event Read Holding registers.
Modbus Event Read Input registers.
Modbus Event Read Discrete bits.
Modbus data storage address
Modbus port type serial master.
Modbus port type serial slave.
Transmitter is in idle state.
Parameter options used to check limits and etc.
Interface method set_descriptor
Modbus communication mode
the characteristic of the device are triggerable
No error, processing completed.
timestamp of event posted
The option is required for support of RTU over TCP.
Modbus communication mode
The Modbus area descriptor entry
Master current processing slave index
index of the address info
Modbus Event Write Holding registers.
Modbus Event Write Coils.
Timestamp of Modbus Event (uS)
Modbus event register size (number of registers)
The physical units of the parameter
Parameter name (OFFSET in the parameter structure)
Receiver is in idle state.
Transmitter is in idle state.
Transmitter is in idle state.
Default CR character for Modbus ASCII.
Transmitter is in transfer finish and wait receive state.
Master sent broadcast ,then delay sometime.
Modbus UART parity settings
Index of the slave address
IP address string of the slave
Modbus communication port (UART) number
Modbus port type TCP master.
Modbus port type TCP slave.
common interface method types Interface method init
This is the Modbus register address. This is the 0 based value.
the characteristic of the device are readable
the characteristic of the device are writable
Master wait respond for slave.
Modbus communication port (UART) number
Modbus UART parity settings
Instance size for area descriptor (bytes)
Network netif interface pointer for port
Master TCP/UDP port number
Master netif interface pointer
slave unit ID (UID) field for MBAP frame
Transmitter is in transfer finish and wait receive state.
Receiver is in initial state.
Frame is beeing received.
Transmitter is in transfer state.
Master receive frame T3.5 timeout.
Modbus communication mode
Frame is beeing received.
Starting transmission (':' sent).
Sending of data (Address, Data, LRC).
Notify sender that the frame has been sent.
Receiver is in initial state.
Size of LRC field in PDU.
Size of CRC field in PDU.
Default LF character for Modbus ASCII.
Minimum size of a Modbus ASCII frame.
pointer to data structure
Interface get_cid_info method
Interface get_parameter method
Interface send_request method
Interface set_parameter method
Modbus unique transaction identificator
Modbus last transaction error type
Modbus destination short address (or UID)
Modbus last transaction function code
Modbus last transaction exception code returned by slave
the characteristic of the device are readable & writable
If master send a broadcast frame, the master will wait time of convert to delay,
Type of storage area descriptor
Interface method get_param_info
Constants which defines the format of a modbus frame. The example is shown for a Modbus RTU/ASCII frame. Note that the Modbus PDU is not dependent on the underlying transport. +-----------+---------------+----------------------------+-------------+ | Address | Function Code | Data | CRC/LRC | +-----------+---------------+----------------------------+-------------+ | | | | (2) (3/2') (3') (4) (1) ... MB_SER_PDU_SIZE_MAX = 256 (2) ... MB_SER_PDU_ADDR_OFF = 0 (3) ... MB_SER_PDU_PDU_OFF = 1 (4) ... MB_SER_PDU_SIZE_CRC = 2 (1') ... MB_PDU_SIZE_MAX = 253 (2') ... MB_PDU_FUNC_OFF = 0 (3') ... MB_PDU_DATA_OFF = 1 Maximum size of a PDU.
Modbus communication mode
Modbus communication port (UART) number
Modbus UART parity settings
This option defines the number of data bits per ASCII character. A parity bit is added before the stop bit which keeps the actual byte size at 10 bits.
The character timeout value for Modbus ASCII. The character timeout value is not fixed for Modbus ASCII and is therefore a configuration option. It should be set to the maximum expected delay time of the network.
Starting transmission (':' sent).
Sending of data (Address, Data, LRC).
Notify sender that the frame has been sent.
Receiver is in initial state.
Transmitter is in transfer state.
Minimum size of a Modbus RTU frame.
Minimum size of a Modbus RTU frame.
Modbus address table for connection
the characteristic of the device are readable & triggerable
the characteristic of the device are writable & triggerable
Access permissions based on mode
Double GHEFCDAB floating point, big endian, reversed register order
Double BADCFEHG floating point, little endian, reversed register order
Unsigned 8, register value
I8 signed integer in high byte of register
I8 signed integer in low byte of register
U8 unsigned integer written to hi byte of register
U8 unsigned integer written to low byte of register
I16 signed integer, big endian
I16 signed integer, little endian
U16 unsigned integer, big endian
U16 unsigned integer, little endian
I32 ABCD signed integer, big endian
I32 CDAB signed integer, big endian, reversed register order
I32 BADC signed integer, little endian, reversed register order
I32 DCBA signed integer, little endian
U32 ABCD unsigned integer, big endian
U32 CDAB unsigned integer, big endian, reversed register order
U32 BADC unsigned integer, little endian, reversed register order
U32 DCBA unsigned integer, little endian
Float ABCD floating point, big endian
Float CDAB floating point big endian, reversed register order
Float BADC floating point, little endian, reversed register order
Float DCBA floating point, little endian
I64, ABCDEFGH signed integer, big endian
I64, HGFEDCBA signed integer, little endian
I64, GHEFCDAB signed integer, big endian, reversed register order
I64, BADCFEHG signed integer, little endian, reversed register order
U64, ABCDEFGH unsigned integer, big endian
U64, HGFEDCBA unsigned integer, little endian
U64, GHEFCDAB unsigned integer, big endian, reversed register order
U64, BADCFEHG unsigned integer, little endian, reversed register order
Double ABCDEFGH floating point, big endian
Double HGFEDCBA floating point, little endian
#include "mb.h"
This module defines the interface for the application. It contains the basic functions and types required to use the Modbus protocol stack. A typical application will want to call eMBInit() first. If the device is ready to answer network requests it must then call eMBEnable() to activate the protocol stack. In the main loop the function eMBPoll() must be called periodically. The time interval between pooling depends on the configured Modbus timeout. If an RTOS is available a separate task should be created and the task should always call the function eMBPoll().
// Initialize protocol stack in RTU mode for a slave with address 10 = 0x0A
eMBInit( MB_RTU, 0x0A, 38400, MB_PAR_EVEN );
// Enable the Modbus Protocol Stack.
eMBEnable( );
for( ;; )
{
// Call the main polling loop of the Modbus protocol stack.
eMBPoll( );
...
}
Use the default Modbus TCP port (502)
#include "mb.h"
This module defines the interface for the application. It contains the basic functions and types required to use the Modbus Master protocol stack. A typical application will want to call eMBMasterInit() first. If the device is ready to answer network requests it must then call eMBEnable() to activate the protocol stack. In the main loop the function eMBMasterPoll() must be called periodically. The time interval between pooling depends on the configured Modbus timeout. If an RTOS is available a separate task should be created and the task should always call the function eMBMasterPoll().
// Initialize protocol stack in RTU mode for a Master
eMBMasterInit( MB_RTU, 38400, MB_PAR_EVEN );
// Enable the Modbus Protocol Stack.
eMBMasterEnable( );
for( ;; )
{
// Call the main polling loop of the Modbus Master protocol stack.
eMBMasterPoll( );
...
}
Use the default Modbus Master TCP port (502)
Modbus slave address field (dummy for master)
Modbus slave address field for UID
Step of parameter change tracking